From dc131810cdc49134449fb05640ed74b6c2888c97 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 29 Mar 2018 18:38:27 -0700 Subject: [PATCH 1/9] [AutoPR web/resource-manager] Adding BillingMeters API (#2545) * Generated from 346651741dcafd1a91d0741d726aef7cdac29c4d Adding BillingMeters API * Generated from 2c9ced71b2b53f7039ec9ddbcbe4f23f05897e89 Adding reference to readme.md * Generated from 1723dbe3e971a273cd0d143700e69c20912f9bce Merge branch 'master' of https://github.com/andreyse/azure-rest-api-specs * Generated from 1723dbe3e971a273cd0d143700e69c20912f9bce Merge branch 'master' of https://github.com/andreyse/azure-rest-api-specs --- .../websiteManagement2/lib/LICENSE.txt | 21 + .../lib/lib/models/abnormalTimePeriod.js | 94 + .../lib/lib/models/address.js | 92 + .../lib/lib/models/addressResponse.js | 95 + .../lib/lib/models/analysisData.js | 123 + .../lib/lib/models/analysisDefinition.js | 88 + .../lib/lib/models/apiDefinitionInfo.js | 52 + .../lib/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/lib/models/appServiceEnvironment.js | 444 + .../models/appServiceEnvironmentCollection.js | 68 + .../appServiceEnvironmentPatchResource.js | 478 + .../models/appServiceEnvironmentResource.js | 499 + .../lib/lib/models/appServicePlan.js | 296 + .../lib/models/appServicePlanCollection.js | 67 + .../lib/models/appServicePlanPatchResource.js | 248 + .../lib/lib/models/applicationLogsConfig.js | 89 + .../lib/lib/models/applicationStack.js | 103 + .../lib/models/applicationStackCollection.js | 68 + .../lib/lib/models/autoHealActions.js | 77 + .../lib/lib/models/autoHealCustomAction.js | 61 + .../lib/lib/models/autoHealRules.js | 86 + .../lib/lib/models/autoHealTriggers.js | 93 + .../azureBlobStorageApplicationLogsConfig.js | 73 + .../models/azureBlobStorageHttpLogsConfig.js | 72 + .../azureTableStorageApplicationLogsConfig.js | 63 + .../lib/lib/models/backupItem.js | 223 + .../lib/lib/models/backupItemCollection.js | 68 + .../lib/lib/models/backupRequest.js | 157 + .../lib/lib/models/backupSchedule.js | 108 + .../lib/lib/models/billingMeter.js | 121 + .../lib/lib/models/billingMeterCollection.js | 68 + .../lib/lib/models/capability.js | 68 + .../lib/lib/models/certificate.js | 297 + .../lib/lib/models/certificateCollection.js | 68 + .../lib/lib/models/certificateDetails.js | 125 + .../lib/lib/models/certificateEmail.js | 95 + .../lib/lib/models/certificateOrderAction.js | 102 + .../lib/models/certificatePatchResource.js | 276 + .../lib/lib/models/cloningInfo.js | 159 + .../lib/lib/models/connStringInfo.js | 71 + .../lib/lib/models/connStringValueTypePair.js | 63 + .../lib/models/connectionStringDictionary.js | 95 + .../lib/lib/models/contact.js | 131 + .../lib/lib/models/continuousWebJob.js | 180 + .../lib/models/continuousWebJobCollection.js | 67 + .../lib/lib/models/corsSettings.js | 61 + .../lib/lib/models/csmMoveResourceEnvelope.js | 73 + .../lib/lib/models/csmOperationCollection.js | 68 + .../lib/lib/models/csmOperationDescription.js | 86 + .../csmOperationDescriptionProperties.js | 56 + .../lib/lib/models/csmOperationDisplay.js | 76 + .../lib/models/csmPublishingProfileOptions.js | 55 + .../lib/lib/models/csmSlotEntity.js | 62 + .../lib/lib/models/csmUsageQuota.js | 89 + .../lib/lib/models/csmUsageQuotaCollection.js | 68 + .../models/customHostnameAnalysisResult.js | 232 + .../lib/lib/models/dataSource.js | 77 + .../lib/lib/models/databaseBackupSetting.js | 81 + .../lib/lib/models/defaultErrorResponse.js | 64 + .../lib/models/defaultErrorResponseError.js | 101 + .../defaultErrorResponseErrorDetailsItem.js | 74 + .../lib/lib/models/deletedSite.js | 98 + .../lib/lib/models/deletedWebAppCollection.js | 68 + .../lib/lib/models/deployment.js | 160 + .../lib/lib/models/deploymentCollection.js | 68 + .../lib/lib/models/deploymentLocations.js | 97 + .../lib/models/detectorAbnormalTimePeriod.js | 137 + .../lib/lib/models/detectorDefinition.js | 116 + .../lib/lib/models/diagnosticAnalysis.js | 144 + .../models/diagnosticAnalysisCollection.js | 68 + .../lib/lib/models/diagnosticCategory.js | 88 + .../models/diagnosticCategoryCollection.js | 68 + .../models/diagnosticDetectorCollection.js | 68 + .../lib/models/diagnosticDetectorResponse.js | 189 + .../lib/lib/models/diagnosticMetricSample.js | 102 + .../lib/lib/models/diagnosticMetricSet.js | 105 + .../lib/lib/models/dimension.js | 78 + .../lib/lib/models/domain.js | 414 + .../models/domainAvailablilityCheckResult.js | 73 + .../lib/lib/models/domainCollection.js | 68 + .../models/domainControlCenterSsoRequest.js | 72 + .../lib/models/domainOwnershipIdentifier.js | 87 + .../domainOwnershipIdentifierCollection.js | 68 + .../lib/lib/models/domainPatchResource.js | 393 + .../lib/lib/models/domainPurchaseConsent.js | 78 + .../domainRecommendationSearchParameters.js | 62 + .../lib/lib/models/enabledConfig.js | 53 + .../lib/lib/models/errorEntity.js | 109 + .../lib/lib/models/errorResponse.js | 61 + .../lib/lib/models/experiments.js | 62 + .../models/fileSystemApplicationLogsConfig.js | 55 + .../lib/models/fileSystemHttpLogsConfig.js | 78 + .../lib/lib/models/functionEnvelope.js | 169 + .../lib/models/functionEnvelopeCollection.js | 68 + .../lib/lib/models/functionSecrets.js | 95 + .../lib/lib/models/geoRegion.js | 106 + .../lib/lib/models/geoRegionCollection.js | 68 + .../lib/lib/models/globalCsmSkuDescription.js | 127 + .../lib/lib/models/handlerMapping.js | 74 + .../lib/lib/models/hostName.js | 110 + .../lib/lib/models/hostNameBinding.js | 161 + .../lib/models/hostNameBindingCollection.js | 68 + .../lib/lib/models/hostNameSslState.js | 98 + .../hostingEnvironmentDeploymentInfo.js | 60 + .../models/hostingEnvironmentDiagnostics.js | 60 + .../lib/models/hostingEnvironmentProfile.js | 70 + .../lib/lib/models/httpLogsConfig.js | 81 + .../lib/lib/models/hybridConnection.js | 148 + .../lib/models/hybridConnectionCollection.js | 68 + .../lib/lib/models/hybridConnectionKey.js | 98 + .../lib/lib/models/hybridConnectionLimits.js | 99 + .../lib/lib/models/identifier.js | 87 + .../lib/lib/models/identifierCollection.js | 68 + .../lib/lib/models/index.d.ts | 7284 + .../lib/lib/models/index.js | 278 + .../lib/lib/models/ipSecurityRestriction.js | 62 + .../lib/lib/models/localizableString.js | 60 + .../lib/lib/models/mSDeploy.js | 152 + .../lib/lib/models/mSDeployLog.js | 96 + .../lib/lib/models/mSDeployLogEntry.js | 73 + .../lib/lib/models/mSDeployStatus.js | 127 + .../lib/lib/models/managedServiceIdentity.js | 71 + .../lib/lib/models/metricAvailabilily.js | 60 + .../lib/lib/models/metricAvailability.js | 60 + .../lib/lib/models/metricDefinition.js | 133 + .../lib/lib/models/metricSpecification.js | 182 + .../lib/lib/models/migrateMySqlRequest.js | 98 + .../lib/lib/models/migrateMySqlStatus.js | 110 + .../lib/lib/models/nameIdentifier.js | 52 + .../lib/models/nameIdentifierCollection.js | 68 + .../lib/lib/models/nameValuePair.js | 60 + .../lib/models/networkAccessControlEntry.js | 79 + .../lib/lib/models/networkFeatures.js | 150 + .../lib/lib/models/operation.js | 121 + .../lib/models/perfMonCounterCollection.js | 68 + .../lib/lib/models/perfMonResponse.js | 77 + .../lib/lib/models/perfMonSample.js | 77 + .../lib/lib/models/perfMonSet.js | 95 + .../lib/lib/models/premierAddOn.js | 172 + .../lib/lib/models/premierAddOnOffer.js | 171 + .../lib/models/premierAddOnOfferCollection.js | 68 + .../lib/lib/models/processInfo.js | 405 + .../lib/lib/models/processInfoCollection.js | 68 + .../lib/lib/models/processModuleInfo.js | 168 + .../lib/models/processModuleInfoCollection.js | 68 + .../lib/lib/models/processThreadInfo.js | 183 + .../lib/models/processThreadInfoCollection.js | 68 + .../lib/lib/models/proxyOnlyResource.js | 84 + .../lib/lib/models/publicCertificate.js | 106 + .../lib/models/publicCertificateCollection.js | 68 + .../lib/lib/models/pushSettings.js | 121 + .../lib/lib/models/rampUpRule.js | 125 + .../lib/lib/models/recommendation.js | 274 + .../lib/models/recommendationCollection.js | 68 + .../lib/lib/models/recommendationRule.js | 203 + .../models/reissueCertificateOrderRequest.js | 113 + .../models/relayServiceConnectionEntity.js | 135 + .../models/renewCertificateOrderRequest.js | 104 + .../lib/lib/models/requestsBasedTrigger.js | 60 + .../lib/lib/models/resource.js | 106 + .../lib/lib/models/resourceCollection.js | 67 + .../lib/lib/models/resourceHealthMetadata.js | 97 + .../resourceHealthMetadataCollection.js | 68 + .../lib/lib/models/resourceMetric.js | 146 + .../lib/models/resourceMetricAvailability.js | 62 + .../lib/models/resourceMetricCollection.js | 68 + .../lib/models/resourceMetricDefinition.js | 162 + .../resourceMetricDefinitionCollection.js | 68 + .../lib/lib/models/resourceMetricName.js | 62 + .../lib/lib/models/resourceMetricProperty.js | 60 + .../lib/lib/models/resourceMetricValue.js | 117 + .../lib/models/resourceNameAvailability.js | 78 + .../models/resourceNameAvailabilityRequest.js | 71 + .../lib/lib/models/responseMetaData.js | 57 + .../lib/lib/models/restoreRequest.js | 193 + .../lib/lib/models/restoreResponse.js | 89 + .../lib/lib/models/serviceSpecification.js | 62 + .../websiteManagement2/lib/lib/models/site.js | 671 + .../lib/lib/models/siteAuthSettings.js | 401 + .../lib/lib/models/siteCloneability.js | 108 + .../lib/models/siteCloneabilityCriterion.js | 60 + .../lib/lib/models/siteConfig.js | 548 + .../lib/lib/models/siteConfigResource.js | 581 + .../models/siteConfigResourceCollection.js | 68 + .../models/siteConfigurationSnapshotInfo.js | 97 + ...siteConfigurationSnapshotInfoCollection.js | 69 + .../lib/lib/models/siteExtensionInfo.js | 249 + .../lib/models/siteExtensionInfoCollection.js | 68 + .../lib/lib/models/siteInstance.js | 88 + .../lib/lib/models/siteLimits.js | 68 + .../lib/lib/models/siteLogsConfig.js | 165 + .../lib/lib/models/siteMachineKey.js | 76 + .../lib/lib/models/sitePatchResource.js | 636 + .../lib/lib/models/sitePhpErrorLogFlag.js | 113 + .../lib/lib/models/siteSeal.js | 52 + .../lib/lib/models/siteSealRequest.js | 61 + .../lib/lib/models/siteSourceControl.js | 123 + .../lib/lib/models/skuCapacity.js | 80 + .../lib/lib/models/skuDescription.js | 137 + .../lib/lib/models/skuInfo.js | 99 + .../lib/lib/models/skuInfoCollection.js | 68 + .../lib/lib/models/skuInfos.js | 70 + .../lib/lib/models/slotConfigNamesResource.js | 109 + .../lib/lib/models/slotDifference.js | 147 + .../lib/models/slotDifferenceCollection.js | 68 + .../lib/lib/models/slotSwapStatus.js | 74 + .../lib/models/slowRequestsBasedTrigger.js | 68 + .../lib/lib/models/snapshot.js | 88 + .../lib/lib/models/snapshotCollection.js | 69 + .../lib/lib/models/snapshotRecoveryRequest.js | 133 + .../lib/lib/models/snapshotRecoveryTarget.js | 65 + .../lib/lib/models/solution.js | 134 + .../lib/lib/models/sourceControl.js | 119 + .../lib/lib/models/sourceControlCollection.js | 68 + .../lib/lib/models/stackMajorVersion.js | 90 + .../lib/lib/models/stackMinorVersion.js | 71 + .../lib/lib/models/stampCapacity.js | 136 + .../lib/lib/models/stampCapacityCollection.js | 68 + .../lib/lib/models/statusCodesBasedTrigger.js | 84 + .../lib/lib/models/storageMigrationOptions.js | 117 + .../lib/models/storageMigrationResponse.js | 90 + .../lib/lib/models/stringDictionary.js | 94 + .../lib/lib/models/tldLegalAgreement.js | 77 + .../lib/models/tldLegalAgreementCollection.js | 68 + .../lib/lib/models/topLevelDomain.js | 97 + .../models/topLevelDomainAgreementOption.js | 64 + .../lib/models/topLevelDomainCollection.js | 68 + .../lib/lib/models/triggeredJobHistory.js | 96 + .../models/triggeredJobHistoryCollection.js | 68 + .../lib/lib/models/triggeredJobRun.js | 170 + .../lib/lib/models/triggeredWebJob.js | 191 + .../lib/models/triggeredWebJobCollection.js | 68 + .../lib/lib/models/usage.js | 162 + .../lib/lib/models/usageCollection.js | 68 + .../websiteManagement2/lib/lib/models/user.js | 121 + .../lib/lib/models/validateRequest.js | 126 + .../lib/lib/models/validateResponse.js | 65 + .../lib/lib/models/validateResponseError.js | 60 + .../lib/lib/models/virtualApplication.js | 88 + .../lib/lib/models/virtualDirectory.js | 60 + .../lib/lib/models/virtualIPMapping.js | 76 + .../lib/lib/models/virtualNetworkProfile.js | 78 + .../lib/lib/models/vnetGateway.js | 97 + .../lib/lib/models/vnetInfo.js | 143 + .../lib/lib/models/vnetParameters.js | 104 + .../lib/lib/models/vnetRoute.js | 123 + .../models/vnetValidationFailureDetails.js | 105 + .../lib/models/vnetValidationTestFailure.js | 96 + .../lib/lib/models/webAppCollection.js | 68 + .../lib/models/webAppInstanceCollection.js | 68 + .../lib/lib/models/webJob.js | 154 + .../lib/lib/models/webJobCollection.js | 68 + .../lib/lib/models/workerPool.js | 96 + .../lib/lib/models/workerPoolCollection.js | 68 + .../lib/lib/models/workerPoolResource.js | 159 + .../operations/appServiceCertificateOrders.js | 6774 + .../lib/operations/appServiceEnvironments.js | 18725 +++ .../lib/lib/operations/appServicePlans.js | 10483 ++ .../lib/lib/operations/billingMeters.js | 483 + .../certificateRegistrationProvider.js | 475 + .../lib/lib/operations/certificates.js | 2089 + .../lib/lib/operations/deletedWebApps.js | 467 + .../lib/lib/operations/diagnostics.js | 6345 + .../operations/domainRegistrationProvider.js | 475 + .../lib/lib/operations/domains.js | 5682 + .../lib/lib/operations/index.d.ts | 56146 +++++++ .../lib/lib/operations/index.js | 31 + .../lib/lib/operations/provider.js | 1379 + .../lib/lib/operations/recommendations.js | 2944 + .../resourceHealthMetadataOperations.js | 2470 + .../lib/lib/operations/topLevelDomains.js | 1200 + .../lib/lib/operations/webApps.js | 116459 +++++++++++++++ .../lib/lib/webSiteManagementClient.d.ts | 1381 + .../lib/lib/webSiteManagementClient.js | 4748 + .../lib/models/abnormalTimePeriod.js | 94 + .../websiteManagement2/lib/models/address.js | 92 + .../lib/models/addressResponse.js | 95 + .../lib/models/analysisData.js | 123 + .../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 | 444 + .../models/appServiceEnvironmentCollection.js | 68 + .../appServiceEnvironmentPatchResource.js | 478 + .../models/appServiceEnvironmentResource.js | 499 + .../lib/models/appServicePlan.js | 296 + .../lib/models/appServicePlanCollection.js | 67 + .../lib/models/appServicePlanPatchResource.js | 248 + .../lib/models/applicationLogsConfig.js | 89 + .../lib/models/applicationStack.js | 103 + .../lib/models/applicationStackCollection.js | 68 + .../lib/models/autoHealActions.js | 77 + .../lib/models/autoHealCustomAction.js | 61 + .../lib/models/autoHealRules.js | 86 + .../lib/models/autoHealTriggers.js | 93 + .../azureBlobStorageApplicationLogsConfig.js | 73 + .../models/azureBlobStorageHttpLogsConfig.js | 72 + .../azureTableStorageApplicationLogsConfig.js | 63 + .../lib/models/backupItem.js | 223 + .../lib/models/backupItemCollection.js | 68 + .../lib/models/backupRequest.js | 157 + .../lib/models/backupSchedule.js | 108 + .../lib/models/billingMeter.js | 84 + .../lib/models/capability.js | 68 + .../lib/models/certificate.js | 297 + .../lib/models/certificateCollection.js | 68 + .../lib/models/certificateDetails.js | 125 + .../lib/models/certificateEmail.js | 95 + .../lib/models/certificateOrderAction.js | 102 + .../lib/models/certificatePatchResource.js | 276 + .../lib/models/cloningInfo.js | 159 + .../lib/models/connStringInfo.js | 71 + .../lib/models/connStringValueTypePair.js | 63 + .../lib/models/connectionStringDictionary.js | 95 + .../websiteManagement2/lib/models/contact.js | 131 + .../lib/models/continuousWebJob.js | 180 + .../lib/models/continuousWebJobCollection.js | 67 + .../lib/models/corsSettings.js | 61 + .../lib/models/csmMoveResourceEnvelope.js | 73 + .../lib/models/csmOperationCollection.js | 68 + .../lib/models/csmOperationDescription.js | 86 + .../csmOperationDescriptionProperties.js | 56 + .../lib/models/csmOperationDisplay.js | 76 + .../lib/models/csmPublishingProfileOptions.js | 55 + .../lib/models/csmSlotEntity.js | 62 + .../lib/models/csmUsageQuota.js | 89 + .../lib/models/csmUsageQuotaCollection.js | 68 + .../models/customHostnameAnalysisResult.js | 232 + .../lib/models/dataSource.js | 77 + .../lib/models/databaseBackupSetting.js | 81 + .../lib/models/defaultErrorResponse.js | 64 + .../lib/models/defaultErrorResponseError.js | 101 + .../defaultErrorResponseErrorDetailsItem.js | 74 + .../lib/models/deletedSite.js | 98 + .../lib/models/deletedWebAppCollection.js | 68 + .../lib/models/deployment.js | 160 + .../lib/models/deploymentCollection.js | 68 + .../lib/models/deploymentLocations.js | 97 + .../lib/models/detectorAbnormalTimePeriod.js | 137 + .../lib/models/detectorDefinition.js | 116 + .../lib/models/diagnosticAnalysis.js | 144 + .../models/diagnosticAnalysisCollection.js | 68 + .../lib/models/diagnosticCategory.js | 88 + .../models/diagnosticCategoryCollection.js | 68 + .../models/diagnosticDetectorCollection.js | 68 + .../lib/models/diagnosticDetectorResponse.js | 189 + .../lib/models/diagnosticMetricSample.js | 102 + .../lib/models/diagnosticMetricSet.js | 105 + .../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 | 109 + .../lib/models/errorResponse.js | 61 + .../lib/models/experiments.js | 62 + .../models/fileSystemApplicationLogsConfig.js | 55 + .../lib/models/fileSystemHttpLogsConfig.js | 78 + .../lib/models/functionEnvelope.js | 169 + .../lib/models/functionEnvelopeCollection.js | 68 + .../lib/models/functionSecrets.js | 95 + .../lib/models/geoRegion.js | 106 + .../lib/models/geoRegionCollection.js | 68 + .../lib/models/globalCsmSkuDescription.js | 127 + .../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 | 81 + .../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 | 7271 + .../websiteManagement2/lib/models/index.js | 277 + .../lib/models/ipSecurityRestriction.js | 62 + .../lib/models/localizableString.js | 60 + .../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 | 71 + .../lib/models/metricAvailabilily.js | 60 + .../lib/models/metricAvailability.js | 60 + .../lib/models/metricDefinition.js | 133 + .../lib/models/metricSpecification.js | 182 + .../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/operation.js | 121 + .../lib/models/perfMonCounterCollection.js | 68 + .../lib/models/perfMonResponse.js | 77 + .../lib/models/perfMonSample.js | 77 + .../lib/models/perfMonSet.js | 95 + .../lib/models/premierAddOn.js | 172 + .../lib/models/premierAddOnOffer.js | 171 + .../lib/models/premierAddOnOfferCollection.js | 68 + .../lib/models/processInfo.js | 405 + .../lib/models/processInfoCollection.js | 68 + .../lib/models/processModuleInfo.js | 168 + .../lib/models/processModuleInfoCollection.js | 68 + .../lib/models/processThreadInfo.js | 183 + .../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 | 274 + .../lib/models/recommendationCollection.js | 68 + .../lib/models/recommendationRule.js | 203 + .../models/reissueCertificateOrderRequest.js | 113 + .../models/relayServiceConnectionEntity.js | 135 + .../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 | 146 + .../lib/models/resourceMetricAvailability.js | 62 + .../lib/models/resourceMetricCollection.js | 68 + .../lib/models/resourceMetricDefinition.js | 162 + .../resourceMetricDefinitionCollection.js | 68 + .../lib/models/resourceMetricName.js | 62 + .../lib/models/resourceMetricProperty.js | 60 + .../lib/models/resourceMetricValue.js | 117 + .../lib/models/resourceNameAvailability.js | 78 + .../models/resourceNameAvailabilityRequest.js | 71 + .../lib/models/responseMetaData.js | 57 + .../lib/models/restoreRequest.js | 193 + .../lib/models/restoreResponse.js | 89 + .../lib/models/serviceSpecification.js | 62 + .../websiteManagement2/lib/models/site.js | 671 + .../lib/models/siteAuthSettings.js | 401 + .../lib/models/siteCloneability.js | 108 + .../lib/models/siteCloneabilityCriterion.js | 60 + .../lib/models/siteConfig.js | 548 + .../lib/models/siteConfigResource.js | 581 + .../models/siteConfigResourceCollection.js | 68 + .../models/siteConfigurationSnapshotInfo.js | 97 + ...siteConfigurationSnapshotInfoCollection.js | 69 + .../lib/models/siteExtensionInfo.js | 249 + .../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 | 636 + .../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 | 137 + .../websiteManagement2/lib/models/skuInfo.js | 99 + .../lib/models/skuInfoCollection.js | 68 + .../websiteManagement2/lib/models/skuInfos.js | 70 + .../lib/models/slotConfigNamesResource.js | 109 + .../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/snapshotRecoveryRequest.js | 133 + .../lib/models/snapshotRecoveryTarget.js | 65 + .../websiteManagement2/lib/models/solution.js | 134 + .../lib/models/sourceControl.js | 119 + .../lib/models/sourceControlCollection.js | 68 + .../lib/models/stackMajorVersion.js | 90 + .../lib/models/stackMinorVersion.js | 71 + .../lib/models/stampCapacity.js | 136 + .../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/tldLegalAgreement.js | 77 + .../lib/models/tldLegalAgreementCollection.js | 68 + .../lib/models/topLevelDomain.js | 97 + .../models/topLevelDomainAgreementOption.js | 64 + .../lib/models/topLevelDomainCollection.js | 68 + .../lib/models/triggeredJobHistory.js | 96 + .../models/triggeredJobHistoryCollection.js | 68 + .../lib/models/triggeredJobRun.js | 170 + .../lib/models/triggeredWebJob.js | 191 + .../lib/models/triggeredWebJobCollection.js | 68 + .../websiteManagement2/lib/models/usage.js | 162 + .../lib/models/usageCollection.js | 68 + .../websiteManagement2/lib/models/user.js | 121 + .../lib/models/validateRequest.js | 126 + .../lib/models/validateResponse.js | 65 + .../lib/models/validateResponseError.js | 60 + .../lib/models/virtualApplication.js | 88 + .../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 | 123 + .../models/vnetValidationFailureDetails.js | 105 + .../lib/models/vnetValidationTestFailure.js | 96 + .../lib/models/webAppCollection.js | 68 + .../lib/models/webAppInstanceCollection.js | 68 + .../websiteManagement2/lib/models/webJob.js | 154 + .../lib/models/webJobCollection.js | 68 + .../lib/models/workerPool.js | 96 + .../lib/models/workerPoolCollection.js | 68 + .../lib/models/workerPoolResource.js | 159 + .../operations/appServiceCertificateOrders.js | 6774 + .../lib/operations/appServiceEnvironments.js | 18725 +++ .../lib/operations/appServicePlans.js | 10483 ++ .../certificateRegistrationProvider.js | 475 + .../lib/operations/certificates.js | 2089 + .../lib/operations/deletedWebApps.js | 467 + .../lib/operations/diagnostics.js | 6345 + .../operations/domainRegistrationProvider.js | 475 + .../lib/operations/domains.js | 5682 + .../lib/operations/global.js | 257 + .../lib/operations/index.d.ts | 56076 +++++++ .../lib/operations/index.js | 31 + .../lib/operations/provider.js | 1379 + .../lib/operations/recommendations.js | 2944 + .../resourceHealthMetadataOperations.js | 2470 + .../lib/operations/topLevelDomains.js | 1200 + .../lib/operations/webApps.js | 116459 +++++++++++++++ .../websiteManagement2/lib/package.json | 22 + .../lib/webSiteManagementClient.d.ts | 1381 + .../lib/webSiteManagementClient.js | 4748 + 559 files changed, 552734 insertions(+) create mode 100644 lib/services/websiteManagement2/lib/LICENSE.txt create mode 100644 lib/services/websiteManagement2/lib/lib/models/abnormalTimePeriod.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/address.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/addressResponse.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/analysisData.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/analysisDefinition.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/apiDefinitionInfo.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/appServiceCertificate.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/appServiceCertificateCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/appServiceCertificateOrder.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/appServiceCertificateOrderCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/appServiceCertificateOrderPatchResource.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/appServiceCertificatePatchResource.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/appServiceCertificateResource.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/appServiceEnvironment.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/appServiceEnvironmentCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/appServiceEnvironmentPatchResource.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/appServiceEnvironmentResource.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/appServicePlan.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/appServicePlanCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/appServicePlanPatchResource.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/applicationLogsConfig.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/applicationStack.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/applicationStackCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/autoHealActions.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/autoHealCustomAction.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/autoHealRules.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/autoHealTriggers.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/azureBlobStorageApplicationLogsConfig.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/azureBlobStorageHttpLogsConfig.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/azureTableStorageApplicationLogsConfig.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/backupItem.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/backupItemCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/backupRequest.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/backupSchedule.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/billingMeter.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/billingMeterCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/capability.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/certificate.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/certificateCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/certificateDetails.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/certificateEmail.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/certificateOrderAction.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/certificatePatchResource.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/cloningInfo.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/connStringInfo.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/connStringValueTypePair.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/connectionStringDictionary.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/contact.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/continuousWebJob.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/continuousWebJobCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/corsSettings.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/csmMoveResourceEnvelope.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/csmOperationCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/csmOperationDescription.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/csmOperationDescriptionProperties.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/csmOperationDisplay.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/csmPublishingProfileOptions.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/csmSlotEntity.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/csmUsageQuota.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/csmUsageQuotaCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/customHostnameAnalysisResult.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/dataSource.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/databaseBackupSetting.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/defaultErrorResponse.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/defaultErrorResponseError.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/defaultErrorResponseErrorDetailsItem.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/deletedSite.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/deletedWebAppCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/deployment.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/deploymentCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/deploymentLocations.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/detectorAbnormalTimePeriod.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/detectorDefinition.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/diagnosticAnalysis.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/diagnosticAnalysisCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/diagnosticCategory.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/diagnosticCategoryCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/diagnosticDetectorCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/diagnosticDetectorResponse.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/diagnosticMetricSample.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/diagnosticMetricSet.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/dimension.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/domain.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/domainAvailablilityCheckResult.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/domainCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/domainControlCenterSsoRequest.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/domainOwnershipIdentifier.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/domainOwnershipIdentifierCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/domainPatchResource.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/domainPurchaseConsent.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/domainRecommendationSearchParameters.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/enabledConfig.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/errorEntity.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/errorResponse.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/experiments.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/fileSystemApplicationLogsConfig.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/fileSystemHttpLogsConfig.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/functionEnvelope.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/functionEnvelopeCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/functionSecrets.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/geoRegion.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/geoRegionCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/globalCsmSkuDescription.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/handlerMapping.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/hostName.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/hostNameBinding.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/hostNameBindingCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/hostNameSslState.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/hostingEnvironmentDeploymentInfo.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/hostingEnvironmentDiagnostics.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/hostingEnvironmentProfile.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/httpLogsConfig.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/hybridConnection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/hybridConnectionCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/hybridConnectionKey.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/hybridConnectionLimits.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/identifier.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/identifierCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/index.d.ts create mode 100644 lib/services/websiteManagement2/lib/lib/models/index.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/ipSecurityRestriction.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/localizableString.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/mSDeploy.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/mSDeployLog.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/mSDeployLogEntry.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/mSDeployStatus.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/managedServiceIdentity.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/metricAvailabilily.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/metricAvailability.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/metricDefinition.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/metricSpecification.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/migrateMySqlRequest.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/migrateMySqlStatus.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/nameIdentifier.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/nameIdentifierCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/nameValuePair.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/networkAccessControlEntry.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/networkFeatures.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/operation.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/perfMonCounterCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/perfMonResponse.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/perfMonSample.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/perfMonSet.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/premierAddOn.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/premierAddOnOffer.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/premierAddOnOfferCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/processInfo.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/processInfoCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/processModuleInfo.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/processModuleInfoCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/processThreadInfo.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/processThreadInfoCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/proxyOnlyResource.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/publicCertificate.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/publicCertificateCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/pushSettings.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/rampUpRule.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/recommendation.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/recommendationCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/recommendationRule.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/reissueCertificateOrderRequest.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/relayServiceConnectionEntity.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/renewCertificateOrderRequest.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/requestsBasedTrigger.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/resource.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceHealthMetadata.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceHealthMetadataCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceMetric.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceMetricAvailability.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceMetricCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceMetricDefinition.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceMetricDefinitionCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceMetricName.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceMetricProperty.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceMetricValue.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceNameAvailability.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceNameAvailabilityRequest.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/responseMetaData.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/restoreRequest.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/restoreResponse.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/serviceSpecification.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/site.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/siteAuthSettings.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/siteCloneability.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/siteCloneabilityCriterion.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/siteConfig.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/siteConfigResource.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/siteConfigResourceCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/siteConfigurationSnapshotInfo.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/siteConfigurationSnapshotInfoCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/siteExtensionInfo.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/siteExtensionInfoCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/siteInstance.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/siteLimits.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/siteLogsConfig.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/siteMachineKey.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/sitePatchResource.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/sitePhpErrorLogFlag.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/siteSeal.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/siteSealRequest.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/siteSourceControl.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/skuCapacity.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/skuDescription.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/skuInfo.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/skuInfoCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/skuInfos.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/slotConfigNamesResource.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/slotDifference.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/slotDifferenceCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/slotSwapStatus.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/slowRequestsBasedTrigger.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/snapshot.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/snapshotCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/snapshotRecoveryRequest.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/snapshotRecoveryTarget.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/solution.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/sourceControl.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/sourceControlCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/stackMajorVersion.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/stackMinorVersion.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/stampCapacity.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/stampCapacityCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/statusCodesBasedTrigger.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/storageMigrationOptions.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/storageMigrationResponse.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/stringDictionary.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/tldLegalAgreement.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/tldLegalAgreementCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/topLevelDomain.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/topLevelDomainAgreementOption.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/topLevelDomainCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/triggeredJobHistory.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/triggeredJobHistoryCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/triggeredJobRun.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/triggeredWebJob.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/triggeredWebJobCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/usage.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/usageCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/user.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/validateRequest.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/validateResponse.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/validateResponseError.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/virtualApplication.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/virtualDirectory.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/virtualIPMapping.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/virtualNetworkProfile.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/vnetGateway.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/vnetInfo.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/vnetParameters.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/vnetRoute.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/vnetValidationFailureDetails.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/vnetValidationTestFailure.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/webAppCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/webAppInstanceCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/webJob.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/webJobCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/workerPool.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/workerPoolCollection.js create mode 100644 lib/services/websiteManagement2/lib/lib/models/workerPoolResource.js create mode 100644 lib/services/websiteManagement2/lib/lib/operations/appServiceCertificateOrders.js create mode 100644 lib/services/websiteManagement2/lib/lib/operations/appServiceEnvironments.js create mode 100644 lib/services/websiteManagement2/lib/lib/operations/appServicePlans.js create mode 100644 lib/services/websiteManagement2/lib/lib/operations/billingMeters.js create mode 100644 lib/services/websiteManagement2/lib/lib/operations/certificateRegistrationProvider.js create mode 100644 lib/services/websiteManagement2/lib/lib/operations/certificates.js create mode 100644 lib/services/websiteManagement2/lib/lib/operations/deletedWebApps.js create mode 100644 lib/services/websiteManagement2/lib/lib/operations/diagnostics.js create mode 100644 lib/services/websiteManagement2/lib/lib/operations/domainRegistrationProvider.js create mode 100644 lib/services/websiteManagement2/lib/lib/operations/domains.js create mode 100644 lib/services/websiteManagement2/lib/lib/operations/index.d.ts create mode 100644 lib/services/websiteManagement2/lib/lib/operations/index.js create mode 100644 lib/services/websiteManagement2/lib/lib/operations/provider.js create mode 100644 lib/services/websiteManagement2/lib/lib/operations/recommendations.js create mode 100644 lib/services/websiteManagement2/lib/lib/operations/resourceHealthMetadataOperations.js create mode 100644 lib/services/websiteManagement2/lib/lib/operations/topLevelDomains.js create mode 100644 lib/services/websiteManagement2/lib/lib/operations/webApps.js create mode 100644 lib/services/websiteManagement2/lib/lib/webSiteManagementClient.d.ts create mode 100644 lib/services/websiteManagement2/lib/lib/webSiteManagementClient.js 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/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/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/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/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/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/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/errorResponse.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/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/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/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/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/restoreResponse.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/snapshotRecoveryRequest.js create mode 100644 lib/services/websiteManagement2/lib/models/snapshotRecoveryTarget.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/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/global.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/package.json create mode 100644 lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts create mode 100644 lib/services/websiteManagement2/lib/webSiteManagementClient.js diff --git a/lib/services/websiteManagement2/lib/LICENSE.txt b/lib/services/websiteManagement2/lib/LICENSE.txt new file mode 100644 index 0000000000..5431ba98b9 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/lib/models/abnormalTimePeriod.js b/lib/services/websiteManagement2/lib/lib/models/abnormalTimePeriod.js new file mode 100644 index 0000000000..2a371f061c --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/abnormalTimePeriod.js @@ -0,0 +1,94 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing 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/lib/models/address.js b/lib/services/websiteManagement2/lib/lib/models/address.js new file mode 100644 index 0000000000..31450935e3 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/addressResponse.js b/lib/services/websiteManagement2/lib/lib/models/addressResponse.js new file mode 100644 index 0000000000..e8d64bc744 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/addressResponse.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'); + +/** + * 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/lib/models/analysisData.js b/lib/services/websiteManagement2/lib/lib/models/analysisData.js new file mode 100644 index 0000000000..244cbfcee4 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/analysisData.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'); + +/** + * 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/lib/models/analysisDefinition.js b/lib/services/websiteManagement2/lib/lib/models/analysisDefinition.js new file mode 100644 index 0000000000..66545279fd --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/apiDefinitionInfo.js b/lib/services/websiteManagement2/lib/lib/models/apiDefinitionInfo.js new file mode 100644 index 0000000000..c7bc43edc4 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/appServiceCertificate.js b/lib/services/websiteManagement2/lib/lib/models/appServiceCertificate.js new file mode 100644 index 0000000000..299b1210d7 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/appServiceCertificateCollection.js b/lib/services/websiteManagement2/lib/lib/models/appServiceCertificateCollection.js new file mode 100644 index 0000000000..5ca5f99e91 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/appServiceCertificateOrder.js b/lib/services/websiteManagement2/lib/lib/models/appServiceCertificateOrder.js new file mode 100644 index 0000000000..4adc193a58 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/appServiceCertificateOrderCollection.js b/lib/services/websiteManagement2/lib/lib/models/appServiceCertificateOrderCollection.js new file mode 100644 index 0000000000..6f45eabab2 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/appServiceCertificateOrderPatchResource.js b/lib/services/websiteManagement2/lib/lib/models/appServiceCertificateOrderPatchResource.js new file mode 100644 index 0000000000..2601b56004 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/appServiceCertificatePatchResource.js b/lib/services/websiteManagement2/lib/lib/models/appServiceCertificatePatchResource.js new file mode 100644 index 0000000000..6abc5ec0e5 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/appServiceCertificateResource.js b/lib/services/websiteManagement2/lib/lib/models/appServiceCertificateResource.js new file mode 100644 index 0000000000..b55a592086 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/appServiceEnvironment.js b/lib/services/websiteManagement2/lib/lib/models/appServiceEnvironment.js new file mode 100644 index 0000000000..af47066e3f --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/appServiceEnvironment.js @@ -0,0 +1,444 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 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 + */ + 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' + } + } + } + } + } + } + }; + } +} + +module.exports = AppServiceEnvironment; diff --git a/lib/services/websiteManagement2/lib/lib/models/appServiceEnvironmentCollection.js b/lib/services/websiteManagement2/lib/lib/models/appServiceEnvironmentCollection.js new file mode 100644 index 0000000000..7c44f399b6 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/appServiceEnvironmentPatchResource.js b/lib/services/websiteManagement2/lib/lib/models/appServiceEnvironmentPatchResource.js new file mode 100644 index 0000000000..990549c0b2 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/appServiceEnvironmentPatchResource.js @@ -0,0 +1,478 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 + */ + 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' + } + } + } + } + } + } + }; + } +} + +module.exports = AppServiceEnvironmentPatchResource; diff --git a/lib/services/websiteManagement2/lib/lib/models/appServiceEnvironmentResource.js b/lib/services/websiteManagement2/lib/lib/models/appServiceEnvironmentResource.js new file mode 100644 index 0000000000..458a7a0309 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/appServiceEnvironmentResource.js @@ -0,0 +1,499 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 + */ + 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' + } + } + } + } + } + } + }; + } +} + +module.exports = AppServiceEnvironmentResource; diff --git a/lib/services/websiteManagement2/lib/lib/models/appServicePlan.js b/lib/services/websiteManagement2/lib/lib/models/appServicePlan.js new file mode 100644 index 0000000000..b8ecc0f0b9 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/appServicePlan.js @@ -0,0 +1,296 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} appServicePlanName Name for the App Service plan. + * @member {string} [workerTierName] Target worker tier assigned to the App + * Service plan. + * @member {string} [status] App Service plan status. Possible values + * include: 'Ready', 'Pending', 'Creating' + * @member {string} [subscription] App Service plan subscription. + * @member {string} [adminSiteName] App Service plan administration site. + * @member {object} [hostingEnvironmentProfile] Specification for the App + * Service Environment to use for the App Service plan. + * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App + * Service Environment. + * @member {string} [hostingEnvironmentProfile.name] Name of the App Service + * Environment. + * @member {string} [hostingEnvironmentProfile.type] Resource type of the App + * Service Environment. + * @member {number} [maximumNumberOfWorkers] Maximum number of instances that + * can be assigned to this App Service plan. + * @member {string} [geoRegion] Geographical location for the App Service + * plan. + * @member {boolean} [perSiteScaling] If true, apps assigned to + * this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale + * to all instances of the plan. Default value: false . + * @member {number} [numberOfSites] Number of apps assigned to this App + * Service plan. + * @member {boolean} [isSpot] If true, this App Service Plan + * owns spot instances. + * @member {date} [spotExpirationTime] The time when the server farm expires. + * Valid only if it is a spot server farm. + * @member {string} [resourceGroup] Resource group of the App Service plan. + * @member {boolean} [reserved] If Linux 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' + } + } + } + }, + appServicePlanName: { + required: true, + serializedName: 'properties.name', + type: { + name: 'String' + } + }, + workerTierName: { + required: false, + serializedName: 'properties.workerTierName', + type: { + name: 'String' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'properties.status', + type: { + name: 'Enum', + allowedValues: [ 'Ready', 'Pending', 'Creating' ] + } + }, + subscription: { + required: false, + readOnly: true, + serializedName: 'properties.subscription', + type: { + name: 'String' + } + }, + adminSiteName: { + required: false, + serializedName: 'properties.adminSiteName', + type: { + name: 'String' + } + }, + hostingEnvironmentProfile: { + required: false, + serializedName: 'properties.hostingEnvironmentProfile', + type: { + name: 'Composite', + className: 'HostingEnvironmentProfile' + } + }, + maximumNumberOfWorkers: { + required: false, + readOnly: true, + serializedName: 'properties.maximumNumberOfWorkers', + type: { + name: 'Number' + } + }, + geoRegion: { + required: false, + readOnly: true, + serializedName: 'properties.geoRegion', + type: { + name: 'String' + } + }, + perSiteScaling: { + required: false, + serializedName: 'properties.perSiteScaling', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + numberOfSites: { + required: false, + readOnly: true, + serializedName: 'properties.numberOfSites', + type: { + name: 'Number' + } + }, + isSpot: { + required: false, + serializedName: 'properties.isSpot', + type: { + name: 'Boolean' + } + }, + spotExpirationTime: { + required: false, + serializedName: 'properties.spotExpirationTime', + type: { + name: 'DateTime' + } + }, + resourceGroup: { + required: false, + readOnly: true, + serializedName: 'properties.resourceGroup', + type: { + name: 'String' + } + }, + reserved: { + required: false, + serializedName: 'properties.reserved', + 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/lib/models/appServicePlanCollection.js b/lib/services/websiteManagement2/lib/lib/models/appServicePlanCollection.js new file mode 100644 index 0000000000..620bda3ea5 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/appServicePlanCollection.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 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, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = AppServicePlanCollection; diff --git a/lib/services/websiteManagement2/lib/lib/models/appServicePlanPatchResource.js b/lib/services/websiteManagement2/lib/lib/models/appServicePlanPatchResource.js new file mode 100644 index 0000000000..e08905aeec --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/appServicePlanPatchResource.js @@ -0,0 +1,248 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} appServicePlanPatchResourceName Name for the App Service + * plan. + * @member {string} [workerTierName] Target worker tier assigned to the App + * Service plan. + * @member {string} [status] App Service plan status. Possible values + * include: 'Ready', 'Pending', 'Creating' + * @member {string} [subscription] App Service plan subscription. + * @member {string} [adminSiteName] App Service plan administration site. + * @member {object} [hostingEnvironmentProfile] Specification for the App + * Service Environment to use for the App Service plan. + * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App + * Service Environment. + * @member {string} [hostingEnvironmentProfile.name] Name of the App Service + * Environment. + * @member {string} [hostingEnvironmentProfile.type] Resource type of the App + * Service Environment. + * @member {number} [maximumNumberOfWorkers] Maximum number of instances that + * can be assigned to this App Service plan. + * @member {string} [geoRegion] Geographical location for the App Service + * plan. + * @member {boolean} [perSiteScaling] If true, apps assigned to + * this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale + * to all instances of the plan. Default value: false . + * @member {number} [numberOfSites] Number of apps assigned to this App + * Service plan. + * @member {boolean} [isSpot] If true, this App Service Plan + * owns spot instances. + * @member {date} [spotExpirationTime] The time when the server farm expires. + * Valid only if it is a spot server farm. + * @member {string} [resourceGroup] Resource group of the App Service plan. + * @member {boolean} [reserved] If Linux 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' + } + }, + appServicePlanPatchResourceName: { + required: true, + serializedName: 'properties.name', + type: { + name: 'String' + } + }, + workerTierName: { + required: false, + serializedName: 'properties.workerTierName', + type: { + name: 'String' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'properties.status', + type: { + name: 'Enum', + allowedValues: [ 'Ready', 'Pending', 'Creating' ] + } + }, + subscription: { + required: false, + readOnly: true, + serializedName: 'properties.subscription', + type: { + name: 'String' + } + }, + adminSiteName: { + required: false, + serializedName: 'properties.adminSiteName', + type: { + name: 'String' + } + }, + hostingEnvironmentProfile: { + required: false, + serializedName: 'properties.hostingEnvironmentProfile', + type: { + name: 'Composite', + className: 'HostingEnvironmentProfile' + } + }, + maximumNumberOfWorkers: { + required: false, + readOnly: true, + serializedName: 'properties.maximumNumberOfWorkers', + type: { + name: 'Number' + } + }, + geoRegion: { + required: false, + readOnly: true, + serializedName: 'properties.geoRegion', + type: { + name: 'String' + } + }, + perSiteScaling: { + required: false, + serializedName: 'properties.perSiteScaling', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + numberOfSites: { + required: false, + readOnly: true, + serializedName: 'properties.numberOfSites', + type: { + name: 'Number' + } + }, + isSpot: { + required: false, + serializedName: 'properties.isSpot', + type: { + name: 'Boolean' + } + }, + spotExpirationTime: { + required: false, + serializedName: 'properties.spotExpirationTime', + type: { + name: 'DateTime' + } + }, + resourceGroup: { + required: false, + readOnly: true, + serializedName: 'properties.resourceGroup', + type: { + name: 'String' + } + }, + reserved: { + required: false, + serializedName: 'properties.reserved', + 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/lib/models/applicationLogsConfig.js b/lib/services/websiteManagement2/lib/lib/models/applicationLogsConfig.js new file mode 100644 index 0000000000..f807ba5142 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/applicationLogsConfig.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'; + +const models = require('./index'); + +/** + * 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/lib/models/applicationStack.js b/lib/services/websiteManagement2/lib/lib/models/applicationStack.js new file mode 100644 index 0000000000..0a52694422 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/applicationStack.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'; + +const models = require('./index'); + +/** + * 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/lib/models/applicationStackCollection.js b/lib/services/websiteManagement2/lib/lib/models/applicationStackCollection.js new file mode 100644 index 0000000000..03e5ff0ee5 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/autoHealActions.js b/lib/services/websiteManagement2/lib/lib/models/autoHealActions.js new file mode 100644 index 0000000000..c88cabffef --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/autoHealActions.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'); + +/** + * 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/lib/models/autoHealCustomAction.js b/lib/services/websiteManagement2/lib/lib/models/autoHealCustomAction.js new file mode 100644 index 0000000000..d60d7dc348 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/autoHealRules.js b/lib/services/websiteManagement2/lib/lib/models/autoHealRules.js new file mode 100644 index 0000000000..345b953e39 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/autoHealRules.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'; + +const models = require('./index'); + +/** + * 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/lib/models/autoHealTriggers.js b/lib/services/websiteManagement2/lib/lib/models/autoHealTriggers.js new file mode 100644 index 0000000000..7d60dca06e --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/autoHealTriggers.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'; + +const models = require('./index'); + +/** + * 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/lib/models/azureBlobStorageApplicationLogsConfig.js b/lib/services/websiteManagement2/lib/lib/models/azureBlobStorageApplicationLogsConfig.js new file mode 100644 index 0000000000..34571a8b2d --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/azureBlobStorageHttpLogsConfig.js b/lib/services/websiteManagement2/lib/lib/models/azureBlobStorageHttpLogsConfig.js new file mode 100644 index 0000000000..e7d85bf50e --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/azureTableStorageApplicationLogsConfig.js b/lib/services/websiteManagement2/lib/lib/models/azureTableStorageApplicationLogsConfig.js new file mode 100644 index 0000000000..ae109442ed --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/backupItem.js b/lib/services/websiteManagement2/lib/lib/models/backupItem.js new file mode 100644 index 0000000000..abff5af787 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/backupItemCollection.js b/lib/services/websiteManagement2/lib/lib/models/backupItemCollection.js new file mode 100644 index 0000000000..769f26fe98 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/backupRequest.js b/lib/services/websiteManagement2/lib/lib/models/backupRequest.js new file mode 100644 index 0000000000..dba65bf110 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/backupRequest.js @@ -0,0 +1,157 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} backupRequestName 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. + * @member {string} [backupRequestType] Type of the backup. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + */ + 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' + } + }, + backupRequestName: { + required: true, + serializedName: 'properties.name', + 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' + } + } + } + }, + backupRequestType: { + required: false, + serializedName: 'properties.type', + type: { + name: 'Enum', + allowedValues: [ 'Default', 'Clone', 'Relocation', 'Snapshot' ] + } + } + } + } + }; + } +} + +module.exports = BackupRequest; diff --git a/lib/services/websiteManagement2/lib/lib/models/backupSchedule.js b/lib/services/websiteManagement2/lib/lib/models/backupSchedule.js new file mode 100644 index 0000000000..b8d86ca61a --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/billingMeter.js b/lib/services/websiteManagement2/lib/lib/models/billingMeter.js new file mode 100644 index 0000000000..14229378b7 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/billingMeter.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'); + +/** + * 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 resource 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' + } + } + } + } + }; + } +} + +module.exports = BillingMeter; diff --git a/lib/services/websiteManagement2/lib/lib/models/billingMeterCollection.js b/lib/services/websiteManagement2/lib/lib/models/billingMeterCollection.js new file mode 100644 index 0000000000..731a97562d --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/capability.js b/lib/services/websiteManagement2/lib/lib/models/capability.js new file mode 100644 index 0000000000..1d81f3149e --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/certificate.js b/lib/services/websiteManagement2/lib/lib/models/certificate.js new file mode 100644 index 0000000000..200bd1eaf4 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/certificate.js @@ -0,0 +1,297 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} [geoRegion] Region of the certificate. + * @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' ] + } + }, + geoRegion: { + required: false, + readOnly: true, + serializedName: 'properties.geoRegion', + type: { + name: 'String' + } + }, + serverFarmId: { + required: false, + serializedName: 'properties.serverFarmId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = Certificate; diff --git a/lib/services/websiteManagement2/lib/lib/models/certificateCollection.js b/lib/services/websiteManagement2/lib/lib/models/certificateCollection.js new file mode 100644 index 0000000000..43f9fd446c --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/certificateDetails.js b/lib/services/websiteManagement2/lib/lib/models/certificateDetails.js new file mode 100644 index 0000000000..affae5c9fc --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/certificateEmail.js b/lib/services/websiteManagement2/lib/lib/models/certificateEmail.js new file mode 100644 index 0000000000..5ffdc8fae5 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/certificateOrderAction.js b/lib/services/websiteManagement2/lib/lib/models/certificateOrderAction.js new file mode 100644 index 0000000000..fc3635e0c7 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/certificateOrderAction.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'; + +const models = require('./index'); + +/** + * Certificate order action. + * + * @extends models['ProxyOnlyResource'] + */ +class CertificateOrderAction extends models['ProxyOnlyResource'] { + /** + * Create a CertificateOrderAction. + * @member {string} [certificateOrderActionType] 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' + } + }, + certificateOrderActionType: { + required: false, + serializedName: 'properties.type', + type: { + name: 'Enum', + allowedValues: [ 'CertificateIssued', 'CertificateOrderCanceled', 'CertificateOrderCreated', 'CertificateRevoked', 'DomainValidationComplete', 'FraudDetected', 'OrgNameChange', 'OrgValidationComplete', 'SanDrop', 'FraudCleared', 'CertificateExpired', 'CertificateExpirationWarning', 'FraudDocumentationRequired', 'Unknown' ] + } + }, + createdAt: { + required: false, + serializedName: 'properties.createdAt', + type: { + name: 'DateTime' + } + } + } + } + }; + } +} + +module.exports = CertificateOrderAction; diff --git a/lib/services/websiteManagement2/lib/lib/models/certificatePatchResource.js b/lib/services/websiteManagement2/lib/lib/models/certificatePatchResource.js new file mode 100644 index 0000000000..e68d49ee1a --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/certificatePatchResource.js @@ -0,0 +1,276 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} [geoRegion] Region of the certificate. + * @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' ] + } + }, + geoRegion: { + required: false, + readOnly: true, + serializedName: 'properties.geoRegion', + type: { + name: 'String' + } + }, + serverFarmId: { + required: false, + serializedName: 'properties.serverFarmId', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = CertificatePatchResource; diff --git a/lib/services/websiteManagement2/lib/lib/models/cloningInfo.js b/lib/services/websiteManagement2/lib/lib/models/cloningInfo.js new file mode 100644 index 0000000000..868a356c16 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/cloningInfo.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'; + +/** + * 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. + * @member {boolean} [ignoreQuotas] true if quotas should be + * ignored; otherwise, false. + */ + 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' + } + }, + ignoreQuotas: { + required: false, + serializedName: 'ignoreQuotas', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = CloningInfo; diff --git a/lib/services/websiteManagement2/lib/lib/models/connStringInfo.js b/lib/services/websiteManagement2/lib/lib/models/connStringInfo.js new file mode 100644 index 0000000000..e45a358633 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/connStringValueTypePair.js b/lib/services/websiteManagement2/lib/lib/models/connStringValueTypePair.js new file mode 100644 index 0000000000..b2d1bf7ca1 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/connectionStringDictionary.js b/lib/services/websiteManagement2/lib/lib/models/connectionStringDictionary.js new file mode 100644 index 0000000000..4166de86d0 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/contact.js b/lib/services/websiteManagement2/lib/lib/models/contact.js new file mode 100644 index 0000000000..c2d29b5130 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/contact.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'); + +/** + * 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/lib/models/continuousWebJob.js b/lib/services/websiteManagement2/lib/lib/models/continuousWebJob.js new file mode 100644 index 0000000000..ffba08bca7 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/continuousWebJob.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'; + +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} [continuousWebJobName] Job name. Used as job identifier + * in ARM resource URI. + * @member {string} [runCommand] Run command. + * @member {string} [url] Job URL. + * @member {string} [extraInfoUrl] Extra Info URL. + * @member {string} [jobType] 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.detailedStatus', + type: { + name: 'String' + } + }, + logUrl: { + required: false, + serializedName: 'properties.logUrl', + type: { + name: 'String' + } + }, + continuousWebJobName: { + required: false, + readOnly: true, + serializedName: 'properties.name', + type: { + name: 'String' + } + }, + runCommand: { + required: false, + serializedName: 'properties.runCommand', + type: { + name: 'String' + } + }, + url: { + required: false, + serializedName: 'properties.url', + type: { + name: 'String' + } + }, + extraInfoUrl: { + required: false, + serializedName: 'properties.extraInfoUrl', + type: { + name: 'String' + } + }, + jobType: { + required: false, + serializedName: 'properties.jobType', + type: { + name: 'Enum', + allowedValues: [ 'Continuous', 'Triggered' ] + } + }, + error: { + required: false, + serializedName: 'properties.error', + type: { + name: 'String' + } + }, + usingSdk: { + required: false, + serializedName: 'properties.usingSdk', + 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/lib/models/continuousWebJobCollection.js b/lib/services/websiteManagement2/lib/lib/models/continuousWebJobCollection.js new file mode 100644 index 0000000000..99a440181a --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/continuousWebJobCollection.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 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, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ContinuousWebJobCollection; diff --git a/lib/services/websiteManagement2/lib/lib/models/corsSettings.js b/lib/services/websiteManagement2/lib/lib/models/corsSettings.js new file mode 100644 index 0000000000..888cff3aac --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/csmMoveResourceEnvelope.js b/lib/services/websiteManagement2/lib/lib/models/csmMoveResourceEnvelope.js new file mode 100644 index 0000000000..fef33a9910 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/csmOperationCollection.js b/lib/services/websiteManagement2/lib/lib/models/csmOperationCollection.js new file mode 100644 index 0000000000..24c2e9b665 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/csmOperationDescription.js b/lib/services/websiteManagement2/lib/lib/models/csmOperationDescription.js new file mode 100644 index 0000000000..9375a0b953 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/csmOperationDescription.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'; + +const models = require('./index'); + +/** + * 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] + */ + 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/lib/models/csmOperationDescriptionProperties.js b/lib/services/websiteManagement2/lib/lib/models/csmOperationDescriptionProperties.js new file mode 100644 index 0000000000..77631076bc --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/csmOperationDescriptionProperties.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'); + +/** + * Properties available for a Microsoft.Web resource provider operation. + * + */ +class CsmOperationDescriptionProperties { + /** + * Create a CsmOperationDescriptionProperties. + * @member {object} [serviceSpecification] + * @member {array} [serviceSpecification.metricSpecifications] + */ + 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/lib/models/csmOperationDisplay.js b/lib/services/websiteManagement2/lib/lib/models/csmOperationDisplay.js new file mode 100644 index 0000000000..fa90f6c44d --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/csmPublishingProfileOptions.js b/lib/services/websiteManagement2/lib/lib/models/csmPublishingProfileOptions.js new file mode 100644 index 0000000000..1311235ff5 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/csmPublishingProfileOptions.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'; + +/** + * 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' + */ + 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' + } + } + } + } + }; + } +} + +module.exports = CsmPublishingProfileOptions; diff --git a/lib/services/websiteManagement2/lib/lib/models/csmSlotEntity.js b/lib/services/websiteManagement2/lib/lib/models/csmSlotEntity.js new file mode 100644 index 0000000000..286ea2fdd5 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/csmUsageQuota.js b/lib/services/websiteManagement2/lib/lib/models/csmUsageQuota.js new file mode 100644 index 0000000000..9d8687b3bc --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/csmUsageQuota.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'; + +const models = require('./index'); + +/** + * 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/lib/models/csmUsageQuotaCollection.js b/lib/services/websiteManagement2/lib/lib/models/csmUsageQuotaCollection.js new file mode 100644 index 0000000000..80459abab5 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/customHostnameAnalysisResult.js b/lib/services/websiteManagement2/lib/lib/models/customHostnameAnalysisResult.js new file mode 100644 index 0000000000..e141ca367e --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/dataSource.js b/lib/services/websiteManagement2/lib/lib/models/dataSource.js new file mode 100644 index 0000000000..1e4d2a6438 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/dataSource.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 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/lib/models/databaseBackupSetting.js b/lib/services/websiteManagement2/lib/lib/models/databaseBackupSetting.js new file mode 100644 index 0000000000..09b9255796 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/defaultErrorResponse.js b/lib/services/websiteManagement2/lib/lib/models/defaultErrorResponse.js new file mode 100644 index 0000000000..7626a48a16 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/defaultErrorResponse.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'; + +const models = require('./index'); + +/** + * 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/lib/models/defaultErrorResponseError.js b/lib/services/websiteManagement2/lib/lib/models/defaultErrorResponseError.js new file mode 100644 index 0000000000..678b354c64 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/defaultErrorResponseError.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'); + +/** + * 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: true, + readOnly: true, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: true, + 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/lib/models/defaultErrorResponseErrorDetailsItem.js b/lib/services/websiteManagement2/lib/lib/models/defaultErrorResponseErrorDetailsItem.js new file mode 100644 index 0000000000..f5f3609ef2 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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: true, + readOnly: true, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: true, + 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/lib/models/deletedSite.js b/lib/services/websiteManagement2/lib/lib/models/deletedSite.js new file mode 100644 index 0000000000..265245476b --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/deletedSite.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'; + +/** + * A deleted app. + * + */ +class DeletedSite { + /** + * Create a DeletedSite. + * @member {number} [id] 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} [name] Name of the deleted site + * @member {string} [slot] Slot of the deleted site + */ + constructor() { + } + + /** + * 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, + serializedName: 'id', + type: { + name: 'Number' + } + }, + deletedTimestamp: { + required: false, + readOnly: true, + serializedName: 'deletedTimestamp', + type: { + name: 'String' + } + }, + subscription: { + required: false, + readOnly: true, + serializedName: 'subscription', + type: { + name: 'String' + } + }, + resourceGroup: { + required: false, + readOnly: true, + serializedName: 'resourceGroup', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + slot: { + required: false, + readOnly: true, + serializedName: 'slot', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = DeletedSite; diff --git a/lib/services/websiteManagement2/lib/lib/models/deletedWebAppCollection.js b/lib/services/websiteManagement2/lib/lib/models/deletedWebAppCollection.js new file mode 100644 index 0000000000..e4e74927f6 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/deployment.js b/lib/services/websiteManagement2/lib/lib/models/deployment.js new file mode 100644 index 0000000000..052aab349d --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/deployment.js @@ -0,0 +1,160 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 {string} [deploymentId] Identifier for 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' + } + }, + deploymentId: { + required: false, + serializedName: 'properties.id', + 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.authorEmail', + type: { + name: 'String' + } + }, + startTime: { + required: false, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + serializedName: 'properties.endTime', + 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/lib/models/deploymentCollection.js b/lib/services/websiteManagement2/lib/lib/models/deploymentCollection.js new file mode 100644 index 0000000000..a8428276d9 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/deploymentLocations.js b/lib/services/websiteManagement2/lib/lib/models/deploymentLocations.js new file mode 100644 index 0000000000..ad15f8aec8 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/deploymentLocations.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'); + +/** + * 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/lib/models/detectorAbnormalTimePeriod.js b/lib/services/websiteManagement2/lib/lib/models/detectorAbnormalTimePeriod.js new file mode 100644 index 0000000000..4d97fd6c60 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/detectorAbnormalTimePeriod.js @@ -0,0 +1,137 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 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/lib/models/detectorDefinition.js b/lib/services/websiteManagement2/lib/lib/models/detectorDefinition.js new file mode 100644 index 0000000000..0c4aa92814 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/diagnosticAnalysis.js b/lib/services/websiteManagement2/lib/lib/models/diagnosticAnalysis.js new file mode 100644 index 0000000000..350a897abb --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/diagnosticAnalysisCollection.js b/lib/services/websiteManagement2/lib/lib/models/diagnosticAnalysisCollection.js new file mode 100644 index 0000000000..526e3d5542 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/diagnosticCategory.js b/lib/services/websiteManagement2/lib/lib/models/diagnosticCategory.js new file mode 100644 index 0000000000..f36e3076cc --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/diagnosticCategoryCollection.js b/lib/services/websiteManagement2/lib/lib/models/diagnosticCategoryCollection.js new file mode 100644 index 0000000000..fc20ff19c1 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/diagnosticDetectorCollection.js b/lib/services/websiteManagement2/lib/lib/models/diagnosticDetectorCollection.js new file mode 100644 index 0000000000..9b17e34ecb --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/diagnosticDetectorResponse.js b/lib/services/websiteManagement2/lib/lib/models/diagnosticDetectorResponse.js new file mode 100644 index 0000000000..880a1116cf --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/diagnosticMetricSample.js b/lib/services/websiteManagement2/lib/lib/models/diagnosticMetricSample.js new file mode 100644 index 0000000000..334dc95c9f --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/diagnosticMetricSet.js b/lib/services/websiteManagement2/lib/lib/models/diagnosticMetricSet.js new file mode 100644 index 0000000000..dec74d0fc2 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/diagnosticMetricSet.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'); + +/** + * 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/lib/models/dimension.js b/lib/services/websiteManagement2/lib/lib/models/dimension.js new file mode 100644 index 0000000000..53cbe470f0 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/domain.js b/lib/services/websiteManagement2/lib/lib/models/domain.js new file mode 100644 index 0000000000..8eed458789 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/domainAvailablilityCheckResult.js b/lib/services/websiteManagement2/lib/lib/models/domainAvailablilityCheckResult.js new file mode 100644 index 0000000000..545642c394 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/domainCollection.js b/lib/services/websiteManagement2/lib/lib/models/domainCollection.js new file mode 100644 index 0000000000..bd23f8a9b7 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/domainControlCenterSsoRequest.js b/lib/services/websiteManagement2/lib/lib/models/domainControlCenterSsoRequest.js new file mode 100644 index 0000000000..c383cb4e4a --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/domainOwnershipIdentifier.js b/lib/services/websiteManagement2/lib/lib/models/domainOwnershipIdentifier.js new file mode 100644 index 0000000000..357f342bab --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/domainOwnershipIdentifierCollection.js b/lib/services/websiteManagement2/lib/lib/models/domainOwnershipIdentifierCollection.js new file mode 100644 index 0000000000..a15ca8300a --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/domainPatchResource.js b/lib/services/websiteManagement2/lib/lib/models/domainPatchResource.js new file mode 100644 index 0000000000..65093da110 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/domainPurchaseConsent.js b/lib/services/websiteManagement2/lib/lib/models/domainPurchaseConsent.js new file mode 100644 index 0000000000..9cd02ca121 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/domainRecommendationSearchParameters.js b/lib/services/websiteManagement2/lib/lib/models/domainRecommendationSearchParameters.js new file mode 100644 index 0000000000..dd3a3b6af9 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/enabledConfig.js b/lib/services/websiteManagement2/lib/lib/models/enabledConfig.js new file mode 100644 index 0000000000..b45f899d15 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/errorEntity.js b/lib/services/websiteManagement2/lib/lib/models/errorEntity.js new file mode 100644 index 0000000000..7fe76aef2e --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/errorEntity.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'); + +/** + * 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/lib/models/errorResponse.js b/lib/services/websiteManagement2/lib/lib/models/errorResponse.js new file mode 100644 index 0000000000..32e994231a --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/errorResponse.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'; + +/** + * Error Response. + * + */ +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, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ErrorResponse; diff --git a/lib/services/websiteManagement2/lib/lib/models/experiments.js b/lib/services/websiteManagement2/lib/lib/models/experiments.js new file mode 100644 index 0000000000..cf40478e30 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/experiments.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'; + +const models = require('./index'); + +/** + * 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/lib/models/fileSystemApplicationLogsConfig.js b/lib/services/websiteManagement2/lib/lib/models/fileSystemApplicationLogsConfig.js new file mode 100644 index 0000000000..b64d80772f --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/fileSystemHttpLogsConfig.js b/lib/services/websiteManagement2/lib/lib/models/fileSystemHttpLogsConfig.js new file mode 100644 index 0000000000..e85d48eb3b --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/functionEnvelope.js b/lib/services/websiteManagement2/lib/lib/models/functionEnvelope.js new file mode 100644 index 0000000000..d7389e080d --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/functionEnvelope.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'); + +/** + * Web Job Information. + * + * @extends models['ProxyOnlyResource'] + */ +class FunctionEnvelope extends models['ProxyOnlyResource'] { + /** + * Create a FunctionEnvelope. + * @member {string} [functionEnvelopeName] Function name. + * @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' + } + }, + functionEnvelopeName: { + required: false, + readOnly: true, + serializedName: 'properties.name', + type: { + name: 'String' + } + }, + functionAppId: { + required: false, + readOnly: true, + serializedName: 'properties.functionAppId', + type: { + name: 'String' + } + }, + scriptRootPathHref: { + required: false, + serializedName: 'properties.scriptRootPathHref', + type: { + name: 'String' + } + }, + scriptHref: { + required: false, + serializedName: 'properties.scriptHref', + type: { + name: 'String' + } + }, + configHref: { + required: false, + serializedName: 'properties.configHref', + type: { + name: 'String' + } + }, + secretsFileHref: { + required: false, + serializedName: 'properties.secretsFileHref', + 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.testData', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = FunctionEnvelope; diff --git a/lib/services/websiteManagement2/lib/lib/models/functionEnvelopeCollection.js b/lib/services/websiteManagement2/lib/lib/models/functionEnvelopeCollection.js new file mode 100644 index 0000000000..11a87f9e7b --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/functionSecrets.js b/lib/services/websiteManagement2/lib/lib/models/functionSecrets.js new file mode 100644 index 0000000000..6c33bce188 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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.triggerUrl', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = FunctionSecrets; diff --git a/lib/services/websiteManagement2/lib/lib/models/geoRegion.js b/lib/services/websiteManagement2/lib/lib/models/geoRegion.js new file mode 100644 index 0000000000..bf004ffc2e --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/geoRegion.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'); + +/** + * Geographical region. + * + * @extends models['ProxyOnlyResource'] + */ +class GeoRegion extends models['ProxyOnlyResource'] { + /** + * Create a GeoRegion. + * @member {string} [geoRegionName] Region name. + * @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' + } + }, + geoRegionName: { + required: false, + readOnly: true, + serializedName: 'properties.name', + 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/lib/models/geoRegionCollection.js b/lib/services/websiteManagement2/lib/lib/models/geoRegionCollection.js new file mode 100644 index 0000000000..b4383a4013 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/globalCsmSkuDescription.js b/lib/services/websiteManagement2/lib/lib/models/globalCsmSkuDescription.js new file mode 100644 index 0000000000..4e36a7f290 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/globalCsmSkuDescription.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'); + +/** + * 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/lib/models/handlerMapping.js b/lib/services/websiteManagement2/lib/lib/models/handlerMapping.js new file mode 100644 index 0000000000..ee5dc87e3b --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/hostName.js b/lib/services/websiteManagement2/lib/lib/models/hostName.js new file mode 100644 index 0000000000..04e7ae98f7 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/hostNameBinding.js b/lib/services/websiteManagement2/lib/lib/models/hostNameBinding.js new file mode 100644 index 0000000000..f18fcbe373 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/hostNameBindingCollection.js b/lib/services/websiteManagement2/lib/lib/models/hostNameBindingCollection.js new file mode 100644 index 0000000000..701310c452 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/hostNameSslState.js b/lib/services/websiteManagement2/lib/lib/models/hostNameSslState.js new file mode 100644 index 0000000000..2158c960f7 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/hostingEnvironmentDeploymentInfo.js b/lib/services/websiteManagement2/lib/lib/models/hostingEnvironmentDeploymentInfo.js new file mode 100644 index 0000000000..08dd21c8d2 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/hostingEnvironmentDiagnostics.js b/lib/services/websiteManagement2/lib/lib/models/hostingEnvironmentDiagnostics.js new file mode 100644 index 0000000000..2ea639d385 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/hostingEnvironmentProfile.js b/lib/services/websiteManagement2/lib/lib/models/hostingEnvironmentProfile.js new file mode 100644 index 0000000000..e339a1cc17 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/httpLogsConfig.js b/lib/services/websiteManagement2/lib/lib/models/httpLogsConfig.js new file mode 100644 index 0000000000..2636ecd1ff --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/httpLogsConfig.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'; + +const models = require('./index'); + +/** + * 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/lib/models/hybridConnection.js b/lib/services/websiteManagement2/lib/lib/models/hybridConnection.js new file mode 100644 index 0000000000..8c40a4b549 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/hybridConnectionCollection.js b/lib/services/websiteManagement2/lib/lib/models/hybridConnectionCollection.js new file mode 100644 index 0000000000..ae824224f0 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/hybridConnectionKey.js b/lib/services/websiteManagement2/lib/lib/models/hybridConnectionKey.js new file mode 100644 index 0000000000..1f4ee6efc7 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/hybridConnectionLimits.js b/lib/services/websiteManagement2/lib/lib/models/hybridConnectionLimits.js new file mode 100644 index 0000000000..dcae3a5dc1 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/identifier.js b/lib/services/websiteManagement2/lib/lib/models/identifier.js new file mode 100644 index 0000000000..6f2bbdd90e --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/identifierCollection.js b/lib/services/websiteManagement2/lib/lib/models/identifierCollection.js new file mode 100644 index 0000000000..849810dc14 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/index.d.ts b/lib/services/websiteManagement2/lib/lib/models/index.d.ts new file mode 100644 index 0000000000..07caf5ba94 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/index.d.ts @@ -0,0 +1,7284 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * 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} [certificateOrderActionType] 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 { + certificateOrderActionType?: string; + 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} [vnetRouteName] The name of this route. This is only + * returned by the server and does not need to be set by the client. + * @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 { + vnetRouteName?: string; + 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} [userName] Username + * @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. + */ +export interface User extends ProxyOnlyResource { + userName?: string; + publishingUserName: string; + publishingPassword?: string; + publishingPasswordHash?: string; + publishingPasswordHashSalt?: string; +} + +/** + * @class + * Initializes a new instance of the SnapshotRecoveryTarget class. + * @constructor + * Specifies the web app that snapshot contents will be written to. + * + * @member {string} [location] Geographical location of the target web app, + * e.g. SouthEastAsia, SouthCentralUS + * @member {string} [id] ARM resource ID of the target 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 SnapshotRecoveryTarget { + location?: string; + id?: string; +} + +/** + * @class + * Initializes a new instance of the SnapshotRecoveryRequest class. + * @constructor + * Details about app recovery operation. + * + * @member {string} [snapshotTime] Point in time in which the app recovery + * should be attempted, formatted as a DateTime string. + * @member {object} [recoveryTarget] Specifies the web app that snapshot + * contents will be written to. + * @member {string} [recoveryTarget.location] Geographical location of the + * target web app, e.g. SouthEastAsia, SouthCentralUS + * @member {string} [recoveryTarget.id] ARM resource ID of the target 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 recovery 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 SnapshotRecoveryRequest extends ProxyOnlyResource { + snapshotTime?: string; + recoveryTarget?: SnapshotRecoveryTarget; + overwrite: boolean; + recoverConfiguration?: boolean; + ignoreConflictingHostNames?: boolean; +} + +/** + * @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 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 ResourceMetricDefinition class. + * @constructor + * Metadata for the metrics. + * + * @member {object} [resourceMetricDefinitionName] Name of the metric. + * @member {string} [resourceMetricDefinitionName.value] metric name value. + * @member {string} [resourceMetricDefinitionName.localizedValue] Localized + * metric name value. + * @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 {string} [resourceMetricDefinitionId] Resource ID. + * @member {object} [properties] Resource metric definition properties. + */ +export interface ResourceMetricDefinition extends ProxyOnlyResource { + readonly resourceMetricDefinitionName?: ResourceMetricName; + readonly unit?: string; + readonly primaryAggregationType?: string; + readonly metricAvailabilities?: ResourceMetricAvailability[]; + readonly resourceUri?: string; + readonly resourceMetricDefinitionId?: 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 ManagedServiceIdentity class. + * @constructor + * Managed service identity. + * + * @member {string} [type] Type of managed service identity. Possible values + * include: 'SystemAssigned' + * @member {string} [tenantId] Tenant of managed service identity. + * @member {string} [principalId] Principal Id of managed service identity. + */ +export interface ManagedServiceIdentity { + type?: string; + readonly tenantId?: string; + readonly principalId?: 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. + * @member {boolean} [ignoreQuotas] true if quotas should be + * ignored; otherwise, false. + */ +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; + ignoreQuotas?: boolean; +} + +/** + * @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. + * @member {string} [subnetMask] Subnet mask for the range of IP addresses the + * restriction is valid for. + */ +export interface IpSecurityRestriction { + ipAddress: string; + subnetMask?: 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 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 {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 {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 {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' + */ +export interface SiteConfig { + numberOfWorkers?: number; + defaultDocuments?: string[]; + netFrameworkVersion?: string; + phpVersion?: string; + pythonVersion?: string; + nodeVersion?: string; + linuxFxVersion?: string; + requestTracingEnabled?: boolean; + requestTracingExpirationTime?: Date; + remoteDebuggingEnabled?: boolean; + remoteDebuggingVersion?: string; + httpLoggingEnabled?: boolean; + logsDirectorySizeLimit?: number; + detailedErrorLoggingEnabled?: boolean; + publishingUsername?: string; + appSettings?: NameValuePair[]; + 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; + ipSecurityRestrictions?: IpSecurityRestriction[]; + http20Enabled?: boolean; + minTlsVersion?: string; +} + +/** + * @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 {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 {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 {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 {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 {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 {boolean} [cloningInfo.ignoreQuotas] true if quotas + * should be ignored; otherwise, false. + * @member {object} [snapshotInfo] If specified during app creation, the app is + * created from a previous snapshot. + * @member {string} [snapshotInfo.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * @member {object} [snapshotInfo.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * @member {string} [snapshotInfo.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @member {string} [snapshotInfo.recoveryTarget.id] ARM resource ID of the + * target 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} [snapshotInfo.overwrite] If true the recovery + * operation can overwrite source app; otherwise, false. + * @member {boolean} [snapshotInfo.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * @member {boolean} [snapshotInfo.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. + * @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' + * @member {string} [identity.tenantId] Tenant of managed service identity. + * @member {string} [identity.principalId] Principal Id of managed service + * identity. + */ +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; + 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; + snapshotInfo?: SnapshotRecoveryRequest; + 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} appServicePlanName Name for the App Service plan. + * @member {string} [workerTierName] Target worker tier assigned to the App + * Service plan. + * @member {string} [status] App Service plan status. Possible values include: + * 'Ready', 'Pending', 'Creating' + * @member {string} [subscription] App Service plan subscription. + * @member {string} [adminSiteName] App Service plan administration site. + * @member {object} [hostingEnvironmentProfile] Specification for the App + * Service Environment to use for the App Service plan. + * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App + * Service Environment. + * @member {string} [hostingEnvironmentProfile.name] Name of the App Service + * Environment. + * @member {string} [hostingEnvironmentProfile.type] Resource type of the App + * Service Environment. + * @member {number} [maximumNumberOfWorkers] Maximum number of instances that + * can be assigned to this App Service plan. + * @member {string} [geoRegion] Geographical location for the App Service plan. + * @member {boolean} [perSiteScaling] If true, apps assigned to + * this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. Default value: false . + * @member {number} [numberOfSites] Number of apps assigned to this App Service + * plan. + * @member {boolean} [isSpot] If true, this App Service Plan owns + * spot instances. + * @member {date} [spotExpirationTime] The time when the server farm expires. + * Valid only if it is a spot server farm. + * @member {string} [resourceGroup] Resource group of the App Service plan. + * @member {boolean} [reserved] If Linux 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 { + appServicePlanName: string; + workerTierName?: string; + readonly status?: string; + readonly subscription?: string; + adminSiteName?: string; + hostingEnvironmentProfile?: HostingEnvironmentProfile; + readonly maximumNumberOfWorkers?: number; + readonly geoRegion?: string; + perSiteScaling?: boolean; + readonly numberOfSites?: number; + isSpot?: boolean; + spotExpirationTime?: Date; + readonly resourceGroup?: string; + reserved?: boolean; + targetWorkerCount?: number; + targetWorkerSizeId?: number; + readonly provisioningState?: string; + sku?: SkuDescription; +} + +/** + * @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 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] + */ +export interface ServiceSpecification { + metricSpecifications?: MetricSpecification[]; +} + +/** + * @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] + */ +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] + */ +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 ErrorResponse class. + * @constructor + * Error Response. + * + * @member {string} [code] Error code. + * @member {string} [message] Error message indicating why the operation + * failed. + */ +export interface ErrorResponse { + code?: string; + message?: string; +} + +/** + * @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 {string} [domainName] Name of the top level domain. + * @member {boolean} [privacy] If true, then the top level domain + * supports domain privacy; otherwise, false. + */ +export interface TopLevelDomain extends ProxyOnlyResource { + readonly domainName?: string; + 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} [geoRegion] Region of the certificate. + * @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; + readonly geoRegion?: 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} [geoRegion] Region of the certificate. + * @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; + readonly geoRegion?: 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: + * 'Default', 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3' + * @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. + */ +export interface StampCapacity { + name?: string; + availableCapacity?: number; + totalCapacity?: number; + unit?: string; + computeMode?: string; + workerSize?: string; + workerSizeId?: number; + excludeFromCapacityAllocation?: boolean; + isApplicableForAllComputeModes?: boolean; + siteMode?: string; +} + +/** + * @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 + */ +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[]; +} + +/** + * @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 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 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 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 DeletedSite class. + * @constructor + * A deleted app. + * + * @member {number} [id] 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} [name] Name of the deleted site + * @member {string} [slot] Slot of the deleted site + */ +export interface DeletedSite { + id?: number; + readonly deletedTimestamp?: string; + readonly subscription?: string; + readonly resourceGroup?: string; + readonly name?: string; + readonly slot?: string; +} + +/** + * @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 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} [tags] The list of category tags that this recommendation + * belongs to. + * @member {string} [actionName] Name of action recommended by this object. + * @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; + tags?: string[]; + actionName?: 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} [recommendationRuleName] 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} [tags] An array of category tags that the rule contains. + * @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 { + recommendationRuleName?: string; + displayName?: string; + message?: string; + recommendationId?: string; + description?: string; + actionName?: string; + level?: string; + channels?: string; + tags?: string[]; + isDynamic?: boolean; + extensionName?: string; + bladeName?: string; + forwardLink?: string; +} + +/** + * @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 BillingMeter class. + * @constructor + * App Service billing entity that contains information about meter which the + * Azure billing system utilizes to charge users for services. + * + * @member {string} [meterId] Meter GUID onboarded in Commerce + * @member {string} [billingLocation] Azure Location of billable resource + * @member {string} [shortName] Short Name from App Service Azure pricing Page + * @member {string} [friendlyName] Friendly name of the meter + * @member {string} [resourceType] App Service resource type meter used for + */ +export interface BillingMeter extends ProxyOnlyResource { + meterId?: string; + billingLocation?: string; + shortName?: string; + friendlyName?: string; + resourceType?: string; +} + +/** + * @class + * Initializes a new instance of the CsmMoveResourceEnvelope class. + * @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} [geoRegionName] Region name. + * @member {string} [description] Region description. + * @member {string} [displayName] Display name for region. + */ +export interface GeoRegion extends ProxyOnlyResource { + readonly geoRegionName?: string; + 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 {string} [premierAddOnOfferName] Premier add on offer Name. + * @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; + premierAddOnOfferName?: 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} [sourceControlName] Name or source control type. + * @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 { + sourceControlName?: string; + 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. + */ +export interface ValidateRequest { + name: string; + type: string; + location: string; + serverFarmId?: string; + skuName?: string; + needLinuxWorkers?: boolean; + isSpot?: boolean; + capacity?: number; + hostingEnvironment?: string; +} + +/** + * @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 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} backupRequestName 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. + * @member {string} [backupRequestType] Type of the backup. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + */ +export interface BackupRequest extends ProxyOnlyResource { + backupRequestName: string; + enabled?: boolean; + storageAccountUrl: string; + backupSchedule?: BackupSchedule; + databases?: DatabaseBackupSetting[]; + backupRequestType?: string; +} + +/** + * @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} [continuousWebJobName] Job name. Used as job identifier in + * ARM resource URI. + * @member {string} [runCommand] Run command. + * @member {string} [url] Job URL. + * @member {string} [extraInfoUrl] Extra Info URL. + * @member {string} [jobType] 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; + readonly continuousWebJobName?: string; + runCommand?: string; + url?: string; + extraInfoUrl?: string; + jobType?: 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' + */ +export interface CsmPublishingProfileOptions { + format?: string; +} + +/** + * @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 Deployment class. + * @constructor + * User crendentials used for publishing activity. + * + * @member {string} [deploymentId] Identifier for 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. + */ +export interface Deployment extends ProxyOnlyResource { + deploymentId?: string; + 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} [functionEnvelopeName] Function name. + * @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 { + readonly functionEnvelopeName?: string; + readonly functionAppId?: string; + scriptRootPathHref?: string; + scriptHref?: string; + configHref?: string; + secretsFileHref?: string; + href?: string; + config?: any; + files?: { [propertyName: string]: string }; + testData?: string; +} + +/** + * @class + * Initializes a new instance of the FunctionSecrets class. + * @constructor + * Function secrets. + * + * @member {string} [key] Secret key. + * @member {string} [triggerUrl] Trigger URL. + */ +export interface FunctionSecrets extends ProxyOnlyResource { + key?: string; + triggerUrl?: string; +} + +/** + * @class + * Initializes a new instance of the HostNameBinding class. + * @constructor + * A hostname binding object. + * + * @member {string} [siteName] App Service app name. + * @member {string} [domainId] Fully qualified ARM domain resource URI. + * @member {string} [azureResourceName] Azure resource name. + * @member {string} [azureResourceType] Azure resource type. Possible values + * include: 'Website', 'TrafficManager' + * @member {string} [customHostNameDnsRecordType] Custom DNS record type. + * Possible values include: 'CName', 'A' + * @member {string} [hostNameType] Hostname type. Possible values include: + * 'Verified', 'Managed' + * @member {string} [sslState] SSL type. Possible values include: 'Disabled', + * 'SniEnabled', 'IpBasedEnabled' + * @member {string} [thumbprint] SSL certificate thumbprint + * @member {string} [virtualIP] Virtual IP address assigned to the hostname if + * IP based SSL is enabled. + */ +export interface HostNameBinding extends ProxyOnlyResource { + siteName?: string; + domainId?: string; + azureResourceName?: string; + azureResourceType?: string; + customHostNameDnsRecordType?: string; + hostNameType?: string; + sslState?: string; + thumbprint?: string; + readonly virtualIP?: string; +} + +/** + * @class + * Initializes a new instance of the HttpLogsConfig class. + * @constructor + * Http logs configuration. + * + * @member {object} [fileSystem] Http logs to file system configuration. + * @member {number} [fileSystem.retentionInMb] Maximum size in megabytes that + * http log files can use. + * When reached old log files will be removed to make space for new ones. + * Value can range between 25 and 100. + * @member {number} [fileSystem.retentionInDays] Retention in days. + * Remove files older than X days. + * 0 or lower means no retention. + * @member {boolean} [fileSystem.enabled] True if configuration is enabled, + * false if it is disabled and null if configuration is not set. + * @member {object} [azureBlobStorage] Http logs to azure blob storage + * configuration. + * @member {string} [azureBlobStorage.sasUrl] SAS url to a azure blob container + * with read/write/list/delete permissions. + * @member {number} [azureBlobStorage.retentionInDays] Retention in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * @member {boolean} [azureBlobStorage.enabled] True if configuration is + * enabled, false if it is disabled and null if configuration is not set. + */ +export interface HttpLogsConfig { + fileSystem?: FileSystemHttpLogsConfig; + azureBlobStorage?: AzureBlobStorageHttpLogsConfig; +} + +/** + * @class + * Initializes a new instance of the MSDeploy class. + * @constructor + * MSDeploy ARM PUT information + * + * @member {string} [packageUri] Package URI + * @member {string} [connectionString] SQL Connection String + * @member {string} [dbType] Database Type + * @member {string} [setParametersXmlFileUri] URI of MSDeploy Parameters file. + * Must not be set if SetParameters is used. + * @member {object} [setParameters] MSDeploy Parameters. Must not be set if + * SetParametersXmlFileUri is used. + * @member {boolean} [skipAppData] Controls whether the MSDeploy operation + * skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * @member {boolean} [appOffline] Sets the AppOffline rule while the MSDeploy + * operation executes. + * Setting is false by default. + */ +export interface MSDeploy extends ProxyOnlyResource { + packageUri?: string; + connectionString?: string; + dbType?: string; + setParametersXmlFileUri?: string; + setParameters?: { [propertyName: string]: string }; + skipAppData?: boolean; + appOffline?: boolean; +} + +/** + * @class + * Initializes a new instance of the MSDeployLogEntry class. + * @constructor + * MSDeploy log entry + * + * @member {date} [time] Timestamp of log entry + * @member {string} [type] Log entry type. Possible values include: 'Message', + * 'Warning', 'Error' + * @member {string} [message] Log entry message + */ +export interface MSDeployLogEntry { + readonly time?: Date; + readonly type?: string; + readonly message?: string; +} + +/** + * @class + * Initializes a new instance of the MSDeployLog class. + * @constructor + * MSDeploy log + * + * @member {array} [entries] List of log entry messages + */ +export interface MSDeployLog extends ProxyOnlyResource { + readonly entries?: MSDeployLogEntry[]; +} + +/** + * @class + * Initializes a new instance of the MSDeployStatus class. + * @constructor + * MSDeploy ARM response + * + * @member {string} [deployer] Username of deployer + * @member {string} [provisioningState] Provisioning state. Possible values + * include: 'accepted', 'running', 'succeeded', 'failed', 'canceled' + * @member {date} [startTime] Start time of deploy operation + * @member {date} [endTime] End time of deploy operation + * @member {boolean} [complete] Whether the deployment operation has completed + */ +export interface MSDeployStatus extends ProxyOnlyResource { + readonly deployer?: string; + readonly provisioningState?: string; + readonly startTime?: Date; + readonly endTime?: Date; + readonly complete?: boolean; +} + +/** + * @class + * Initializes a new instance of the MigrateMySqlRequest class. + * @constructor + * MySQL migration request. + * + * @member {string} connectionString Connection string to the remote MySQL + * database. + * @member {string} migrationType The type of migration operation to be done. + * Possible values include: 'LocalToRemote', 'RemoteToLocal' + */ +export interface MigrateMySqlRequest extends ProxyOnlyResource { + connectionString: string; + migrationType: string; +} + +/** + * @class + * Initializes a new instance of the MigrateMySqlStatus class. + * @constructor + * MySQL migration status. + * + * @member {string} [migrationOperationStatus] Status of the migration task. + * Possible values include: 'InProgress', 'Failed', 'Succeeded', 'TimedOut', + * 'Created' + * @member {string} [operationId] Operation ID for the migration task. + * @member {boolean} [localMySqlEnabled] True if the web app has in app MySql + * enabled + */ +export interface MigrateMySqlStatus extends ProxyOnlyResource { + readonly migrationOperationStatus?: string; + readonly operationId?: string; + readonly localMySqlEnabled?: boolean; +} + +/** + * @class + * Initializes a new instance of the RelayServiceConnectionEntity class. + * @constructor + * Hybrid Connection for an App Service app. + * + * @member {string} [entityName] + * @member {string} [entityConnectionString] + * @member {string} [resourceType] + * @member {string} [resourceConnectionString] + * @member {string} [hostname] + * @member {number} [port] + * @member {string} [biztalkUri] + */ +export interface RelayServiceConnectionEntity extends ProxyOnlyResource { + entityName?: string; + entityConnectionString?: string; + resourceType?: string; + resourceConnectionString?: string; + hostname?: string; + port?: number; + biztalkUri?: string; +} + +/** + * @class + * Initializes a new instance of the NetworkFeatures class. + * @constructor + * Full view of network features for an app (presently VNET integration and + * Hybrid Connections). + * + * @member {string} [virtualNetworkName] The Virtual Network name. + * @member {object} [virtualNetworkConnection] The Virtual Network summary + * view. + * @member {string} [virtualNetworkConnection.vnetResourceId] The Virtual + * Network's resource ID. + * @member {string} [virtualNetworkConnection.certThumbprint] The client + * certificate thumbprint. + * @member {buffer} [virtualNetworkConnection.certBlob] A certificate file + * (.cer) blob containing the public key of the private key used to + * authenticate a + * Point-To-Site VPN connection. + * @member {array} [virtualNetworkConnection.routes] The routes that this + * Virtual Network connection uses. + * @member {boolean} [virtualNetworkConnection.resyncRequired] + * true if a resync is required; otherwise, false. + * @member {string} [virtualNetworkConnection.dnsServers] DNS servers to be + * used by this Virtual Network. This should be a comma-separated list of IP + * addresses. + * @member {array} [hybridConnections] The Hybrid Connections summary view. + * @member {array} [hybridConnectionsV2] The Hybrid Connection V2 (Service Bus) + * view. + */ +export interface NetworkFeatures extends ProxyOnlyResource { + readonly virtualNetworkName?: string; + readonly virtualNetworkConnection?: VnetInfo; + readonly hybridConnections?: RelayServiceConnectionEntity[]; + readonly hybridConnectionsV2?: HybridConnection[]; +} + +/** + * @class + * Initializes a new instance of the PerfMonSample class. + * @constructor + * Performance monitor sample in a set. + * + * @member {date} [time] Point in time for which counter was measured. + * @member {string} [instanceName] Name of the server on which the measurement + * is made. + * @member {number} [value] Value of counter at a certain time. + * @member {number} [coreCount] Core Count of worker. Not a data member + */ +export interface PerfMonSample { + time?: Date; + instanceName?: string; + value?: number; + coreCount?: 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} [premierAddOnName] Premier add on Name. + * @member {string} [premierAddOnLocation] Premier add on Location. + * @member {object} [premierAddOnTags] Premier add on Tags. + * @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; + premierAddOnName?: string; + premierAddOnLocation?: string; + premierAddOnTags?: { [propertyName: string]: string }; + marketplacePublisher?: string; + marketplaceOffer?: string; +} + +/** + * @class + * Initializes a new instance of the ProcessThreadInfo class. + * @constructor + * Process Thread Information. + * + * @member {number} [processThreadInfoId] ARM Identifier for deployment. + * @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 { + processThreadInfoId?: 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} [processInfoId] ARM Identifier for deployment. + * @member {string} [processInfoName] 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} [totalProcessorTime] Total CPU time. + * @member {string} [userProcessorTime] User CPU time. + * @member {string} [privilegedProcessorTime] Privileged CPU time. + * @member {number} [workingSet64] Working set. + * @member {number} [peakWorkingSet64] Peak working set. + * @member {number} [privateMemorySize64] Private memory size. + * @member {number} [virtualMemorySize64] Virtual memory size. + * @member {number} [peakVirtualMemorySize64] Peak virtual memory usage. + * @member {number} [pagedSystemMemorySize64] Paged system memory. + * @member {number} [nonpagedSystemMemorySize64] Non-paged system memory. + * @member {number} [pagedMemorySize64] Paged memory. + * @member {number} [peakPagedMemorySize64] 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 { + processInfoId?: number; + processInfoName?: 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; + totalProcessorTime?: string; + userProcessorTime?: string; + privilegedProcessorTime?: string; + workingSet64?: number; + peakWorkingSet64?: number; + privateMemorySize64?: number; + virtualMemorySize64?: number; + peakVirtualMemorySize64?: number; + pagedSystemMemorySize64?: number; + nonpagedSystemMemorySize64?: number; + pagedMemorySize64?: number; + peakPagedMemorySize64?: 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'. 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 RestoreResponse class. + * @constructor + * Response for an app restore request. + * + * @member {string} [operationId] When server starts the restore process, it + * will return an operation ID identifying that particular restore operation. + */ +export interface RestoreResponse extends ProxyOnlyResource { + readonly operationId?: 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 {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; + 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 {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 {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 {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' + */ +export interface SiteConfigResource extends ProxyOnlyResource { + numberOfWorkers?: number; + defaultDocuments?: string[]; + netFrameworkVersion?: string; + phpVersion?: string; + pythonVersion?: string; + nodeVersion?: string; + linuxFxVersion?: string; + requestTracingEnabled?: boolean; + requestTracingExpirationTime?: Date; + remoteDebuggingEnabled?: boolean; + remoteDebuggingVersion?: string; + httpLoggingEnabled?: boolean; + logsDirectorySizeLimit?: number; + detailedErrorLoggingEnabled?: boolean; + publishingUsername?: string; + appSettings?: NameValuePair[]; + 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; + ipSecurityRestrictions?: IpSecurityRestriction[]; + http20Enabled?: boolean; + minTlsVersion?: string; +} + +/** + * @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} [siteConfigurationSnapshotInfoId] The id of the snapshot + */ +export interface SiteConfigurationSnapshotInfo extends ProxyOnlyResource { + readonly time?: Date; + readonly siteConfigurationSnapshotInfoId?: number; +} + +/** + * @class + * Initializes a new instance of the SiteExtensionInfo class. + * @constructor + * Site Extension Information. + * + * @member {string} [siteExtensionInfoId] Site extension ID. + * @member {string} [title] Site extension title. + * @member {string} [siteExtensionInfoType] 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} [installationArgs] 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 { + siteExtensionInfoId?: string; + title?: string; + siteExtensionInfoType?: string; + summary?: string; + description?: string; + version?: string; + extensionUrl?: string; + projectUrl?: string; + iconUrl?: string; + licenseUrl?: string; + feedUrl?: string; + authors?: string[]; + installationArgs?: 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 {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 {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 {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 {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 {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 {boolean} [cloningInfo.ignoreQuotas] true if quotas + * should be ignored; otherwise, false. + * @member {object} [snapshotInfo] If specified during app creation, the app is + * created from a previous snapshot. + * @member {string} [snapshotInfo.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * @member {object} [snapshotInfo.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * @member {string} [snapshotInfo.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @member {string} [snapshotInfo.recoveryTarget.id] ARM resource ID of the + * target 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} [snapshotInfo.overwrite] If true the recovery + * operation can overwrite source app; otherwise, false. + * @member {boolean} [snapshotInfo.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * @member {boolean} [snapshotInfo.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. + * @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; + 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; + snapshotInfo?: SnapshotRecoveryRequest; + 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. + */ +export interface SlotConfigNamesResource extends ProxyOnlyResource { + connectionStringNames?: string[]; + appSettingNames?: string[]; +} + +/** + * @class + * Initializes a new instance of the SlotDifference class. + * @constructor + * A setting difference between two deployment slots of an app. + * + * @member {string} [slotDifferenceType] Type 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 slotDifferenceType?: 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 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 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 TriggeredJobRun class. + * @constructor + * Triggered Web Job Run Information. + * + * @member {string} [triggeredJobRunId] Job ID. + * @member {string} [triggeredJobRunName] 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 { + triggeredJobRunId?: string; + readonly triggeredJobRunName?: 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} [triggeredJobRuns] List of triggered web job runs. + */ +export interface TriggeredJobHistory extends ProxyOnlyResource { + triggeredJobRuns?: 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.triggeredJobRunId] Job ID. + * @member {string} [latestRun.triggeredJobRunName] 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} [triggeredWebJobName] Job name. Used as job identifier in + * ARM resource URI. + * @member {string} [runCommand] Run command. + * @member {string} [url] Job URL. + * @member {string} [extraInfoUrl] Extra Info URL. + * @member {string} [jobType] 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; + readonly triggeredWebJobName?: string; + runCommand?: string; + url?: string; + extraInfoUrl?: string; + jobType?: string; + error?: string; + usingSdk?: boolean; + settings?: { [propertyName: string]: any }; +} + +/** + * @class + * Initializes a new instance of the WebJob class. + * @constructor + * Web Job Information. + * + * @member {string} [webJobName] Job name. Used as job identifier in ARM + * resource URI. + * @member {string} [runCommand] Run command. + * @member {string} [url] Job URL. + * @member {string} [extraInfoUrl] Extra Info URL. + * @member {string} [jobType] 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 { + readonly webJobName?: string; + runCommand?: string; + url?: string; + extraInfoUrl?: string; + jobType?: 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 + */ +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[]; +} + +/** + * @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 + */ +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[]; +} + +/** + * @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} [metricDefinitionName] Name of the 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 metricDefinitionName?: string; + 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} [usageName] Name of the quota. + * @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 usageName?: 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} appServicePlanPatchResourceName Name for the App Service + * plan. + * @member {string} [workerTierName] Target worker tier assigned to the App + * Service plan. + * @member {string} [status] App Service plan status. Possible values include: + * 'Ready', 'Pending', 'Creating' + * @member {string} [subscription] App Service plan subscription. + * @member {string} [adminSiteName] App Service plan administration site. + * @member {object} [hostingEnvironmentProfile] Specification for the App + * Service Environment to use for the App Service plan. + * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App + * Service Environment. + * @member {string} [hostingEnvironmentProfile.name] Name of the App Service + * Environment. + * @member {string} [hostingEnvironmentProfile.type] Resource type of the App + * Service Environment. + * @member {number} [maximumNumberOfWorkers] Maximum number of instances that + * can be assigned to this App Service plan. + * @member {string} [geoRegion] Geographical location for the App Service plan. + * @member {boolean} [perSiteScaling] If true, apps assigned to + * this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. Default value: false . + * @member {number} [numberOfSites] Number of apps assigned to this App Service + * plan. + * @member {boolean} [isSpot] If true, this App Service Plan owns + * spot instances. + * @member {date} [spotExpirationTime] The time when the server farm expires. + * Valid only if it is a spot server farm. + * @member {string} [resourceGroup] Resource group of the App Service plan. + * @member {boolean} [reserved] If Linux 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 { + appServicePlanPatchResourceName: string; + workerTierName?: string; + readonly status?: string; + readonly subscription?: string; + adminSiteName?: string; + hostingEnvironmentProfile?: HostingEnvironmentProfile; + readonly maximumNumberOfWorkers?: number; + readonly geoRegion?: string; + perSiteScaling?: boolean; + readonly numberOfSites?: number; + isSpot?: boolean; + spotExpirationTime?: Date; + readonly resourceGroup?: string; + reserved?: 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 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 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 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; +} + +/** + * @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 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 BillingMeterCollection class. + * @constructor + * Collection of Billing Meters + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface BillingMeterCollection extends Array { + readonly nextLink?: string; +} + +/** + * @class + * Initializes a new instance of the WebAppCollection class. + * @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 { + 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 { + 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; +} diff --git a/lib/services/websiteManagement2/lib/lib/models/index.js b/lib/services/websiteManagement2/lib/lib/models/index.js new file mode 100644 index 0000000000..af2e518523 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/index.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. + */ + +/* 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.SnapshotRecoveryTarget = require('./snapshotRecoveryTarget'); +exports.SnapshotRecoveryRequest = require('./snapshotRecoveryRequest'); +exports.ResourceMetricAvailability = require('./resourceMetricAvailability'); +exports.ResourceMetricName = require('./resourceMetricName'); +exports.ResourceMetricDefinition = require('./resourceMetricDefinition'); +exports.PushSettings = require('./pushSettings'); +exports.Identifier = require('./identifier'); +exports.HybridConnectionKey = require('./hybridConnectionKey'); +exports.HybridConnection = require('./hybridConnection'); +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.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.NameIdentifier = require('./nameIdentifier'); +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.ErrorResponse = require('./errorResponse'); +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.DefaultErrorResponseErrorDetailsItem = require('./defaultErrorResponseErrorDetailsItem'); +exports.DefaultErrorResponseError = require('./defaultErrorResponseError'); +exports.DefaultErrorResponse = require('./defaultErrorResponse'); +exports.Operation = require('./operation'); +exports.ResourceMetricProperty = require('./resourceMetricProperty'); +exports.ResourceMetricValue = require('./resourceMetricValue'); +exports.ResourceMetric = require('./resourceMetric'); +exports.DeletedSite = require('./deletedSite'); +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.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.ResourceHealthMetadata = require('./resourceHealthMetadata'); +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.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.Deployment = require('./deployment'); +exports.EnabledConfig = require('./enabledConfig'); +exports.FileSystemHttpLogsConfig = require('./fileSystemHttpLogsConfig'); +exports.FunctionEnvelope = require('./functionEnvelope'); +exports.FunctionSecrets = require('./functionSecrets'); +exports.HostNameBinding = require('./hostNameBinding'); +exports.HttpLogsConfig = require('./httpLogsConfig'); +exports.MSDeploy = require('./mSDeploy'); +exports.MSDeployLogEntry = require('./mSDeployLogEntry'); +exports.MSDeployLog = require('./mSDeployLog'); +exports.MSDeployStatus = require('./mSDeployStatus'); +exports.MigrateMySqlRequest = require('./migrateMySqlRequest'); +exports.MigrateMySqlStatus = require('./migrateMySqlStatus'); +exports.RelayServiceConnectionEntity = require('./relayServiceConnectionEntity'); +exports.NetworkFeatures = require('./networkFeatures'); +exports.PerfMonSample = require('./perfMonSample'); +exports.PerfMonSet = require('./perfMonSet'); +exports.PerfMonResponse = require('./perfMonResponse'); +exports.PremierAddOn = require('./premierAddOn'); +exports.ProcessThreadInfo = require('./processThreadInfo'); +exports.ProcessModuleInfo = require('./processModuleInfo'); +exports.ProcessInfo = require('./processInfo'); +exports.PublicCertificate = require('./publicCertificate'); +exports.RestoreRequest = require('./restoreRequest'); +exports.RestoreResponse = require('./restoreResponse'); +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.Snapshot = require('./snapshot'); +exports.StorageMigrationOptions = require('./storageMigrationOptions'); +exports.StorageMigrationResponse = require('./storageMigrationResponse'); +exports.StringDictionary = require('./stringDictionary'); +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.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.DiagnosticCategoryCollection = require('./diagnosticCategoryCollection'); +exports.DiagnosticAnalysisCollection = require('./diagnosticAnalysisCollection'); +exports.DiagnosticDetectorCollection = require('./diagnosticDetectorCollection'); +exports.ApplicationStackCollection = require('./applicationStackCollection'); +exports.RecommendationCollection = require('./recommendationCollection'); +exports.ResourceHealthMetadataCollection = require('./resourceHealthMetadataCollection'); +exports.SourceControlCollection = require('./sourceControlCollection'); +exports.GeoRegionCollection = require('./geoRegionCollection'); +exports.IdentifierCollection = require('./identifierCollection'); +exports.PremierAddOnOfferCollection = require('./premierAddOnOfferCollection'); +exports.BillingMeterCollection = require('./billingMeterCollection'); +exports.WebAppCollection = require('./webAppCollection'); +exports.BackupItemCollection = require('./backupItemCollection'); +exports.SiteConfigResourceCollection = require('./siteConfigResourceCollection'); +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'); diff --git a/lib/services/websiteManagement2/lib/lib/models/ipSecurityRestriction.js b/lib/services/websiteManagement2/lib/lib/models/ipSecurityRestriction.js new file mode 100644 index 0000000000..c9589edfc8 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/ipSecurityRestriction.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'; + +/** + * IP security restriction on an app. + * + */ +class IpSecurityRestriction { + /** + * Create a IpSecurityRestriction. + * @member {string} ipAddress IP address the security restriction is valid + * for. + * @member {string} [subnetMask] Subnet mask for the range of IP addresses + * the restriction is valid for. + */ + 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' + } + } + } + } + }; + } +} + +module.exports = IpSecurityRestriction; diff --git a/lib/services/websiteManagement2/lib/lib/models/localizableString.js b/lib/services/websiteManagement2/lib/lib/models/localizableString.js new file mode 100644 index 0000000000..0f464c7fe5 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/mSDeploy.js b/lib/services/websiteManagement2/lib/lib/models/mSDeploy.js new file mode 100644 index 0000000000..89bfbd351f --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/mSDeployLog.js b/lib/services/websiteManagement2/lib/lib/models/mSDeployLog.js new file mode 100644 index 0000000000..c4128e119d --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/mSDeployLogEntry.js b/lib/services/websiteManagement2/lib/lib/models/mSDeployLogEntry.js new file mode 100644 index 0000000000..dca0c93378 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/mSDeployStatus.js b/lib/services/websiteManagement2/lib/lib/models/mSDeployStatus.js new file mode 100644 index 0000000000..3fedbf49cf --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/managedServiceIdentity.js b/lib/services/websiteManagement2/lib/lib/models/managedServiceIdentity.js new file mode 100644 index 0000000000..1b38e8c693 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/managedServiceIdentity.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'; + +/** + * Managed service identity. + * + */ +class ManagedServiceIdentity { + /** + * Create a ManagedServiceIdentity. + * @member {string} [type] Type of managed service identity. Possible values + * include: 'SystemAssigned' + * @member {string} [tenantId] Tenant of managed service identity. + * @member {string} [principalId] Principal Id of managed service identity. + */ + 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' + } + } + } + } + }; + } +} + +module.exports = ManagedServiceIdentity; diff --git a/lib/services/websiteManagement2/lib/lib/models/metricAvailabilily.js b/lib/services/websiteManagement2/lib/lib/models/metricAvailabilily.js new file mode 100644 index 0000000000..7957ab3882 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/metricAvailability.js b/lib/services/websiteManagement2/lib/lib/models/metricAvailability.js new file mode 100644 index 0000000000..84a9285bd4 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/metricDefinition.js b/lib/services/websiteManagement2/lib/lib/models/metricDefinition.js new file mode 100644 index 0000000000..7ef23aa4c1 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/metricDefinition.js @@ -0,0 +1,133 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} [metricDefinitionName] Name of the 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. + */ + 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' + } + }, + metricDefinitionName: { + required: false, + readOnly: true, + serializedName: 'properties.name', + 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/lib/models/metricSpecification.js b/lib/services/websiteManagement2/lib/lib/models/metricSpecification.js new file mode 100644 index 0000000000..f181fc189b --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/metricSpecification.js @@ -0,0 +1,182 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 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/lib/models/migrateMySqlRequest.js b/lib/services/websiteManagement2/lib/lib/models/migrateMySqlRequest.js new file mode 100644 index 0000000000..3f5a50472d --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/migrateMySqlStatus.js b/lib/services/websiteManagement2/lib/lib/models/migrateMySqlStatus.js new file mode 100644 index 0000000000..614da5a007 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/nameIdentifier.js b/lib/services/websiteManagement2/lib/lib/models/nameIdentifier.js new file mode 100644 index 0000000000..2147dc71dc --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/nameIdentifierCollection.js b/lib/services/websiteManagement2/lib/lib/models/nameIdentifierCollection.js new file mode 100644 index 0000000000..ea628630e0 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/nameValuePair.js b/lib/services/websiteManagement2/lib/lib/models/nameValuePair.js new file mode 100644 index 0000000000..5e3cdf77c2 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/networkAccessControlEntry.js b/lib/services/websiteManagement2/lib/lib/models/networkAccessControlEntry.js new file mode 100644 index 0000000000..841e6205dd --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/networkFeatures.js b/lib/services/websiteManagement2/lib/lib/models/networkFeatures.js new file mode 100644 index 0000000000..8d3d2959a8 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/operation.js b/lib/services/websiteManagement2/lib/lib/models/operation.js new file mode 100644 index 0000000000..4a24b281f8 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/operation.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'); + +/** + * 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/lib/models/perfMonCounterCollection.js b/lib/services/websiteManagement2/lib/lib/models/perfMonCounterCollection.js new file mode 100644 index 0000000000..f14a13dbff --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/perfMonResponse.js b/lib/services/websiteManagement2/lib/lib/models/perfMonResponse.js new file mode 100644 index 0000000000..a4badd3919 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/perfMonResponse.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'); + +/** + * 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/lib/models/perfMonSample.js b/lib/services/websiteManagement2/lib/lib/models/perfMonSample.js new file mode 100644 index 0000000000..f7882a7d2e --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/perfMonSample.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'; + +/** + * 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. + * @member {number} [coreCount] Core Count of worker. Not a data member + */ + 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' + } + }, + coreCount: { + required: false, + serializedName: 'coreCount', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = PerfMonSample; diff --git a/lib/services/websiteManagement2/lib/lib/models/perfMonSet.js b/lib/services/websiteManagement2/lib/lib/models/perfMonSet.js new file mode 100644 index 0000000000..8a24e0d373 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/perfMonSet.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'); + +/** + * 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/lib/models/premierAddOn.js b/lib/services/websiteManagement2/lib/lib/models/premierAddOn.js new file mode 100644 index 0000000000..ac3d6c9e2f --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/premierAddOn.js @@ -0,0 +1,172 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} [premierAddOnName] Premier add on Name. + * @member {string} [premierAddOnLocation] Premier add on Location. + * @member {object} [premierAddOnTags] Premier add on Tags. + * @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' + } + }, + premierAddOnName: { + required: false, + serializedName: 'properties.name', + type: { + name: 'String' + } + }, + premierAddOnLocation: { + required: false, + serializedName: 'properties.location', + type: { + name: 'String' + } + }, + premierAddOnTags: { + required: false, + serializedName: 'properties.tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + 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/lib/models/premierAddOnOffer.js b/lib/services/websiteManagement2/lib/lib/models/premierAddOnOffer.js new file mode 100644 index 0000000000..2252e8969a --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/premierAddOnOffer.js @@ -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. + */ + +'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 {string} [premierAddOnOfferName] Premier add on offer Name. + * @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' + } + }, + premierAddOnOfferName: { + required: false, + serializedName: 'properties.name', + 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/lib/models/premierAddOnOfferCollection.js b/lib/services/websiteManagement2/lib/lib/models/premierAddOnOfferCollection.js new file mode 100644 index 0000000000..ceecaa63c2 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/processInfo.js b/lib/services/websiteManagement2/lib/lib/models/processInfo.js new file mode 100644 index 0000000000..094583fabf --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/processInfo.js @@ -0,0 +1,405 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} [processInfoId] ARM Identifier for deployment. + * @member {string} [processInfoName] 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} [totalProcessorTime] Total CPU time. + * @member {string} [userProcessorTime] User CPU time. + * @member {string} [privilegedProcessorTime] Privileged CPU time. + * @member {number} [workingSet64] Working set. + * @member {number} [peakWorkingSet64] Peak working set. + * @member {number} [privateMemorySize64] Private memory size. + * @member {number} [virtualMemorySize64] Virtual memory size. + * @member {number} [peakVirtualMemorySize64] Peak virtual memory usage. + * @member {number} [pagedSystemMemorySize64] Paged system memory. + * @member {number} [nonpagedSystemMemorySize64] Non-paged system memory. + * @member {number} [pagedMemorySize64] Paged memory. + * @member {number} [peakPagedMemorySize64] 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' + } + }, + processInfoId: { + required: false, + serializedName: 'properties.id', + type: { + name: 'Number' + } + }, + processInfoName: { + required: false, + serializedName: 'properties.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.isProfileRunning', + type: { + name: 'Boolean' + } + }, + isIisProfileRunning: { + required: false, + serializedName: 'properties.isIisProfileRunning', + type: { + name: 'Boolean' + } + }, + iisProfileTimeoutInSeconds: { + required: false, + serializedName: 'properties.iisProfileTimeoutInSeconds', + 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.openFileHandles', + 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.fileName', + type: { + name: 'String' + } + }, + commandLine: { + required: false, + serializedName: 'properties.commandLine', + type: { + name: 'String' + } + }, + userName: { + required: false, + serializedName: 'properties.userName', + type: { + name: 'String' + } + }, + handleCount: { + required: false, + serializedName: 'properties.handleCount', + type: { + name: 'Number' + } + }, + moduleCount: { + required: false, + serializedName: 'properties.moduleCount', + type: { + name: 'Number' + } + }, + threadCount: { + required: false, + serializedName: 'properties.threadCount', + type: { + name: 'Number' + } + }, + startTime: { + required: false, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + totalProcessorTime: { + required: false, + serializedName: 'properties.totalProcessorTime', + type: { + name: 'String' + } + }, + userProcessorTime: { + required: false, + serializedName: 'properties.userProcessorTime', + type: { + name: 'String' + } + }, + privilegedProcessorTime: { + required: false, + serializedName: 'properties.privilegedProcessorTime', + type: { + name: 'String' + } + }, + workingSet64: { + required: false, + serializedName: 'properties.workingSet64', + type: { + name: 'Number' + } + }, + peakWorkingSet64: { + required: false, + serializedName: 'properties.peakWorkingSet64', + type: { + name: 'Number' + } + }, + privateMemorySize64: { + required: false, + serializedName: 'properties.privateMemorySize64', + type: { + name: 'Number' + } + }, + virtualMemorySize64: { + required: false, + serializedName: 'properties.virtualMemorySize64', + type: { + name: 'Number' + } + }, + peakVirtualMemorySize64: { + required: false, + serializedName: 'properties.peakVirtualMemorySize64', + type: { + name: 'Number' + } + }, + pagedSystemMemorySize64: { + required: false, + serializedName: 'properties.pagedSystemMemorySize64', + type: { + name: 'Number' + } + }, + nonpagedSystemMemorySize64: { + required: false, + serializedName: 'properties.nonpagedSystemMemorySize64', + type: { + name: 'Number' + } + }, + pagedMemorySize64: { + required: false, + serializedName: 'properties.pagedMemorySize64', + type: { + name: 'Number' + } + }, + peakPagedMemorySize64: { + required: false, + serializedName: 'properties.peakPagedMemorySize64', + type: { + name: 'Number' + } + }, + timeStamp: { + required: false, + serializedName: 'properties.timeStamp', + type: { + name: 'DateTime' + } + }, + environmentVariables: { + required: false, + serializedName: 'properties.environmentVariables', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + isScmSite: { + required: false, + serializedName: 'properties.isScmSite', + type: { + name: 'Boolean' + } + }, + isWebJob: { + required: false, + serializedName: 'properties.isWebJob', + type: { + name: 'Boolean' + } + }, + description: { + required: false, + serializedName: 'properties.description', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ProcessInfo; diff --git a/lib/services/websiteManagement2/lib/lib/models/processInfoCollection.js b/lib/services/websiteManagement2/lib/lib/models/processInfoCollection.js new file mode 100644 index 0000000000..7ebd35ee09 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/processModuleInfo.js b/lib/services/websiteManagement2/lib/lib/models/processModuleInfo.js new file mode 100644 index 0000000000..54334a64cf --- /dev/null +++ b/lib/services/websiteManagement2/lib/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.baseAddress', + type: { + name: 'String' + } + }, + fileName: { + required: false, + serializedName: 'properties.fileName', + type: { + name: 'String' + } + }, + href: { + required: false, + serializedName: 'properties.href', + type: { + name: 'String' + } + }, + filePath: { + required: false, + serializedName: 'properties.filePath', + type: { + name: 'String' + } + }, + moduleMemorySize: { + required: false, + serializedName: 'properties.moduleMemorySize', + type: { + name: 'Number' + } + }, + fileVersion: { + required: false, + serializedName: 'properties.fileVersion', + type: { + name: 'String' + } + }, + fileDescription: { + required: false, + serializedName: 'properties.fileDescription', + type: { + name: 'String' + } + }, + product: { + required: false, + serializedName: 'properties.product', + type: { + name: 'String' + } + }, + productVersion: { + required: false, + serializedName: 'properties.productVersion', + type: { + name: 'String' + } + }, + isDebug: { + required: false, + serializedName: 'properties.isDebug', + type: { + name: 'Boolean' + } + }, + language: { + required: false, + serializedName: 'properties.language', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ProcessModuleInfo; diff --git a/lib/services/websiteManagement2/lib/lib/models/processModuleInfoCollection.js b/lib/services/websiteManagement2/lib/lib/models/processModuleInfoCollection.js new file mode 100644 index 0000000000..3ce4dec596 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/processThreadInfo.js b/lib/services/websiteManagement2/lib/lib/models/processThreadInfo.js new file mode 100644 index 0000000000..ec227556b0 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/processThreadInfo.js @@ -0,0 +1,183 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} [processThreadInfoId] ARM Identifier for deployment. + * @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' + } + }, + processThreadInfoId: { + required: false, + serializedName: 'properties.id', + 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.startAddress', + type: { + name: 'String' + } + }, + currentPriority: { + required: false, + serializedName: 'properties.currentPriority', + type: { + name: 'Number' + } + }, + priorityLevel: { + required: false, + serializedName: 'properties.priorityLevel', + type: { + name: 'String' + } + }, + basePriority: { + required: false, + serializedName: 'properties.basePriority', + type: { + name: 'Number' + } + }, + startTime: { + required: false, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + totalProcessorTime: { + required: false, + serializedName: 'properties.totalProcessorTime', + type: { + name: 'String' + } + }, + userProcessorTime: { + required: false, + serializedName: 'properties.userProcessorTime', + type: { + name: 'String' + } + }, + priviledgedProcessorTime: { + required: false, + serializedName: 'properties.priviledgedProcessorTime', + type: { + name: 'String' + } + }, + state: { + required: false, + serializedName: 'properties.state', + type: { + name: 'String' + } + }, + waitReason: { + required: false, + serializedName: 'properties.waitReason', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ProcessThreadInfo; diff --git a/lib/services/websiteManagement2/lib/lib/models/processThreadInfoCollection.js b/lib/services/websiteManagement2/lib/lib/models/processThreadInfoCollection.js new file mode 100644 index 0000000000..5b6c63e1c9 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/proxyOnlyResource.js b/lib/services/websiteManagement2/lib/lib/models/proxyOnlyResource.js new file mode 100644 index 0000000000..ce25dbcdd7 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/publicCertificate.js b/lib/services/websiteManagement2/lib/lib/models/publicCertificate.js new file mode 100644 index 0000000000..7d26d5e11a --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/publicCertificateCollection.js b/lib/services/websiteManagement2/lib/lib/models/publicCertificateCollection.js new file mode 100644 index 0000000000..39be88acc4 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/pushSettings.js b/lib/services/websiteManagement2/lib/lib/models/pushSettings.js new file mode 100644 index 0000000000..9c8bb1ec4e --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/rampUpRule.js b/lib/services/websiteManagement2/lib/lib/models/rampUpRule.js new file mode 100644 index 0000000000..97701d5a8a --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/recommendation.js b/lib/services/websiteManagement2/lib/lib/models/recommendation.js new file mode 100644 index 0000000000..665993eaba --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/recommendation.js @@ -0,0 +1,274 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} [tags] The list of category tags that this recommendation + * belongs to. + * @member {string} [actionName] Name of action recommended by this object. + * @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' ] + } + }, + tags: { + required: false, + serializedName: 'properties.tags', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + actionName: { + required: false, + serializedName: 'properties.actionName', + 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/lib/models/recommendationCollection.js b/lib/services/websiteManagement2/lib/lib/models/recommendationCollection.js new file mode 100644 index 0000000000..e85014b66e --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/recommendationRule.js b/lib/services/websiteManagement2/lib/lib/models/recommendationRule.js new file mode 100644 index 0000000000..6e35b0c290 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/recommendationRule.js @@ -0,0 +1,203 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} [recommendationRuleName] 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} [tags] An array of category tags that the rule contains. + * @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' + } + }, + recommendationRuleName: { + required: false, + serializedName: 'properties.name', + 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' ] + } + }, + tags: { + required: false, + serializedName: 'properties.tags', + 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/lib/models/reissueCertificateOrderRequest.js b/lib/services/websiteManagement2/lib/lib/models/reissueCertificateOrderRequest.js new file mode 100644 index 0000000000..b7a796250c --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/relayServiceConnectionEntity.js b/lib/services/websiteManagement2/lib/lib/models/relayServiceConnectionEntity.js new file mode 100644 index 0000000000..c54c71585a --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/renewCertificateOrderRequest.js b/lib/services/websiteManagement2/lib/lib/models/renewCertificateOrderRequest.js new file mode 100644 index 0000000000..b72c6763f4 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/requestsBasedTrigger.js b/lib/services/websiteManagement2/lib/lib/models/requestsBasedTrigger.js new file mode 100644 index 0000000000..60c548d329 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/resource.js b/lib/services/websiteManagement2/lib/lib/models/resource.js new file mode 100644 index 0000000000..ee72e3156a --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/resourceCollection.js b/lib/services/websiteManagement2/lib/lib/models/resourceCollection.js new file mode 100644 index 0000000000..d49a0d8fec --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/resourceHealthMetadata.js b/lib/services/websiteManagement2/lib/lib/models/resourceHealthMetadata.js new file mode 100644 index 0000000000..7c8d1c457d --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/resourceHealthMetadataCollection.js b/lib/services/websiteManagement2/lib/lib/models/resourceHealthMetadataCollection.js new file mode 100644 index 0000000000..b4be12e889 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/resourceMetric.js b/lib/services/websiteManagement2/lib/lib/models/resourceMetric.js new file mode 100644 index 0000000000..bc89c6dc3d --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/resourceMetric.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'; + +const models = require('./index'); + +/** + * 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/lib/models/resourceMetricAvailability.js b/lib/services/websiteManagement2/lib/lib/models/resourceMetricAvailability.js new file mode 100644 index 0000000000..477e5bb26c --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/resourceMetricCollection.js b/lib/services/websiteManagement2/lib/lib/models/resourceMetricCollection.js new file mode 100644 index 0000000000..579749b9a4 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/resourceMetricDefinition.js b/lib/services/websiteManagement2/lib/lib/models/resourceMetricDefinition.js new file mode 100644 index 0000000000..86464c5423 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/resourceMetricDefinition.js @@ -0,0 +1,162 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 {object} [resourceMetricDefinitionName] Name of the metric. + * @member {string} [resourceMetricDefinitionName.value] metric name value. + * @member {string} [resourceMetricDefinitionName.localizedValue] Localized + * metric name value. + * @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 {string} [resourceMetricDefinitionId] Resource ID. + * @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' + } + }, + resourceMetricDefinitionName: { + required: false, + readOnly: true, + serializedName: 'properties.name', + type: { + name: 'Composite', + className: 'ResourceMetricName' + } + }, + 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' + } + }, + resourceMetricDefinitionId: { + required: false, + readOnly: true, + serializedName: 'properties.id', + 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/lib/models/resourceMetricDefinitionCollection.js b/lib/services/websiteManagement2/lib/lib/models/resourceMetricDefinitionCollection.js new file mode 100644 index 0000000000..5de7ff20bf --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/resourceMetricName.js b/lib/services/websiteManagement2/lib/lib/models/resourceMetricName.js new file mode 100644 index 0000000000..8aea96ba4a --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/resourceMetricProperty.js b/lib/services/websiteManagement2/lib/lib/models/resourceMetricProperty.js new file mode 100644 index 0000000000..e1c189544b --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/resourceMetricValue.js b/lib/services/websiteManagement2/lib/lib/models/resourceMetricValue.js new file mode 100644 index 0000000000..6bc292af85 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/resourceMetricValue.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'); + +/** + * 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/lib/models/resourceNameAvailability.js b/lib/services/websiteManagement2/lib/lib/models/resourceNameAvailability.js new file mode 100644 index 0000000000..a733bc7a1e --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/resourceNameAvailabilityRequest.js b/lib/services/websiteManagement2/lib/lib/models/resourceNameAvailabilityRequest.js new file mode 100644 index 0000000000..fceb2c2a08 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/responseMetaData.js b/lib/services/websiteManagement2/lib/lib/models/responseMetaData.js new file mode 100644 index 0000000000..1887a5d84a --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/responseMetaData.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'; + +const models = require('./index'); + +/** + * 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/lib/models/restoreRequest.js b/lib/services/websiteManagement2/lib/lib/models/restoreRequest.js new file mode 100644 index 0000000000..ed24bafc6a --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/restoreRequest.js @@ -0,0 +1,193 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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'. 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' ] + } + }, + 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/lib/models/restoreResponse.js b/lib/services/websiteManagement2/lib/lib/models/restoreResponse.js new file mode 100644 index 0000000000..a3f06ae56a --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/restoreResponse.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'; + +const models = require('./index'); + +/** + * Response for an app restore request. + * + * @extends models['ProxyOnlyResource'] + */ +class RestoreResponse extends models['ProxyOnlyResource'] { + /** + * Create a RestoreResponse. + * @member {string} [operationId] When server starts the restore process, it + * will return an operation ID identifying that particular restore operation. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RestoreResponse + * + * @returns {object} metadata of RestoreResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'RestoreResponse', + type: { + name: 'Composite', + className: 'RestoreResponse', + 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 = RestoreResponse; diff --git a/lib/services/websiteManagement2/lib/lib/models/serviceSpecification.js b/lib/services/websiteManagement2/lib/lib/models/serviceSpecification.js new file mode 100644 index 0000000000..ebb2a7b9a3 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/serviceSpecification.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'; + +const models = require('./index'); + +/** + * Resource metrics service provided by Microsoft.Insights resource provider. + * + */ +class ServiceSpecification { + /** + * Create a ServiceSpecification. + * @member {array} [metricSpecifications] + */ + 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' + } + } + } + } + } + } + }; + } +} + +module.exports = ServiceSpecification; diff --git a/lib/services/websiteManagement2/lib/lib/models/site.js b/lib/services/websiteManagement2/lib/lib/models/site.js new file mode 100644 index 0000000000..daa121c8ae --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/site.js @@ -0,0 +1,671 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 {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 {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 {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 {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 {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 {boolean} [cloningInfo.ignoreQuotas] true if quotas + * should be ignored; otherwise, false. + * @member {object} [snapshotInfo] If specified during app creation, the app + * is created from a previous snapshot. + * @member {string} [snapshotInfo.snapshotTime] Point in time in which the + * app recovery should be attempted, formatted as a DateTime string. + * @member {object} [snapshotInfo.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * @member {string} [snapshotInfo.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @member {string} [snapshotInfo.recoveryTarget.id] ARM resource ID of the + * target 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} [snapshotInfo.overwrite] If true the + * recovery operation can overwrite source app; otherwise, + * false. + * @member {boolean} [snapshotInfo.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * @member {boolean} [snapshotInfo.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. + * @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' + * @member {string} [identity.tenantId] Tenant of managed service identity. + * @member {string} [identity.principalId] Principal Id of managed service + * identity. + */ + 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' + } + }, + 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' + } + }, + snapshotInfo: { + required: false, + serializedName: 'properties.snapshotInfo', + type: { + name: 'Composite', + className: 'SnapshotRecoveryRequest' + } + }, + 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/lib/models/siteAuthSettings.js b/lib/services/websiteManagement2/lib/lib/models/siteAuthSettings.js new file mode 100644 index 0000000000..977f86f4dc --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/siteAuthSettings.js @@ -0,0 +1,401 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 {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' + } + }, + 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/lib/models/siteCloneability.js b/lib/services/websiteManagement2/lib/lib/models/siteCloneability.js new file mode 100644 index 0000000000..8e5728a618 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/siteCloneability.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'); + +/** + * 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/lib/models/siteCloneabilityCriterion.js b/lib/services/websiteManagement2/lib/lib/models/siteCloneabilityCriterion.js new file mode 100644 index 0000000000..7d5d208e54 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/siteConfig.js b/lib/services/websiteManagement2/lib/lib/models/siteConfig.js new file mode 100644 index 0000000000..6dd3a24a75 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/siteConfig.js @@ -0,0 +1,548 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 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 {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 {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 {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' + */ + 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' + } + }, + 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' + } + } + } + }, + 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' + } + }, + 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' + } + } + } + } + }; + } +} + +module.exports = SiteConfig; diff --git a/lib/services/websiteManagement2/lib/lib/models/siteConfigResource.js b/lib/services/websiteManagement2/lib/lib/models/siteConfigResource.js new file mode 100644 index 0000000000..247ba84dc6 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/siteConfigResource.js @@ -0,0 +1,581 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 {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 {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 {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' + */ + 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' + } + }, + 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' + } + } + } + }, + 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' + } + }, + 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' + } + } + } + } + }; + } +} + +module.exports = SiteConfigResource; diff --git a/lib/services/websiteManagement2/lib/lib/models/siteConfigResourceCollection.js b/lib/services/websiteManagement2/lib/lib/models/siteConfigResourceCollection.js new file mode 100644 index 0000000000..e1668edee7 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/siteConfigurationSnapshotInfo.js b/lib/services/websiteManagement2/lib/lib/models/siteConfigurationSnapshotInfo.js new file mode 100644 index 0000000000..ab201777eb --- /dev/null +++ b/lib/services/websiteManagement2/lib/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} [siteConfigurationSnapshotInfoId] 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' + } + }, + siteConfigurationSnapshotInfoId: { + required: false, + readOnly: true, + serializedName: 'properties.id', + type: { + name: 'Number' + } + } + } + } + }; + } +} + +module.exports = SiteConfigurationSnapshotInfo; diff --git a/lib/services/websiteManagement2/lib/lib/models/siteConfigurationSnapshotInfoCollection.js b/lib/services/websiteManagement2/lib/lib/models/siteConfigurationSnapshotInfoCollection.js new file mode 100644 index 0000000000..6bdb27ef62 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/siteExtensionInfo.js b/lib/services/websiteManagement2/lib/lib/models/siteExtensionInfo.js new file mode 100644 index 0000000000..8cd1cf009f --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/siteExtensionInfo.js @@ -0,0 +1,249 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} [siteExtensionInfoId] Site extension ID. + * @member {string} [title] Site extension title. + * @member {string} [siteExtensionInfoType] 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} [installationArgs] 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' + } + }, + siteExtensionInfoId: { + required: false, + serializedName: 'properties.id', + type: { + name: 'String' + } + }, + title: { + required: false, + serializedName: 'properties.title', + type: { + name: 'String' + } + }, + siteExtensionInfoType: { + required: false, + serializedName: 'properties.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.extensionUrl', + type: { + name: 'String' + } + }, + projectUrl: { + required: false, + serializedName: 'properties.projectUrl', + type: { + name: 'String' + } + }, + iconUrl: { + required: false, + serializedName: 'properties.iconUrl', + type: { + name: 'String' + } + }, + licenseUrl: { + required: false, + serializedName: 'properties.licenseUrl', + type: { + name: 'String' + } + }, + feedUrl: { + required: false, + serializedName: 'properties.feedUrl', + type: { + name: 'String' + } + }, + authors: { + required: false, + serializedName: 'properties.authors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + installationArgs: { + required: false, + serializedName: 'properties.installationArgs', + type: { + name: 'String' + } + }, + publishedDateTime: { + required: false, + serializedName: 'properties.publishedDateTime', + type: { + name: 'DateTime' + } + }, + downloadCount: { + required: false, + serializedName: 'properties.downloadCount', + type: { + name: 'Number' + } + }, + localIsLatestVersion: { + required: false, + serializedName: 'properties.localIsLatestVersion', + type: { + name: 'Boolean' + } + }, + localPath: { + required: false, + serializedName: 'properties.localPath', + type: { + name: 'String' + } + }, + installedDateTime: { + required: false, + serializedName: 'properties.installedDateTime', + 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/lib/models/siteExtensionInfoCollection.js b/lib/services/websiteManagement2/lib/lib/models/siteExtensionInfoCollection.js new file mode 100644 index 0000000000..be20a01f06 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/siteInstance.js b/lib/services/websiteManagement2/lib/lib/models/siteInstance.js new file mode 100644 index 0000000000..850f9772ca --- /dev/null +++ b/lib/services/websiteManagement2/lib/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.name', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SiteInstance; diff --git a/lib/services/websiteManagement2/lib/lib/models/siteLimits.js b/lib/services/websiteManagement2/lib/lib/models/siteLimits.js new file mode 100644 index 0000000000..48f8562cea --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/siteLogsConfig.js b/lib/services/websiteManagement2/lib/lib/models/siteLogsConfig.js new file mode 100644 index 0000000000..04f1df34a8 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/siteMachineKey.js b/lib/services/websiteManagement2/lib/lib/models/siteMachineKey.js new file mode 100644 index 0000000000..e60a1445f6 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/sitePatchResource.js b/lib/services/websiteManagement2/lib/lib/models/sitePatchResource.js new file mode 100644 index 0000000000..91322a206d --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/sitePatchResource.js @@ -0,0 +1,636 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 {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 {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 {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 {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 {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 {boolean} [cloningInfo.ignoreQuotas] true if quotas + * should be ignored; otherwise, false. + * @member {object} [snapshotInfo] If specified during app creation, the app + * is created from a previous snapshot. + * @member {string} [snapshotInfo.snapshotTime] Point in time in which the + * app recovery should be attempted, formatted as a DateTime string. + * @member {object} [snapshotInfo.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * @member {string} [snapshotInfo.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @member {string} [snapshotInfo.recoveryTarget.id] ARM resource ID of the + * target 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} [snapshotInfo.overwrite] If true the + * recovery operation can overwrite source app; otherwise, + * false. + * @member {boolean} [snapshotInfo.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * @member {boolean} [snapshotInfo.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. + * @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' + } + }, + 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' + } + }, + snapshotInfo: { + required: false, + serializedName: 'properties.snapshotInfo', + type: { + name: 'Composite', + className: 'SnapshotRecoveryRequest' + } + }, + 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/lib/models/sitePhpErrorLogFlag.js b/lib/services/websiteManagement2/lib/lib/models/sitePhpErrorLogFlag.js new file mode 100644 index 0000000000..bdd71e4e43 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/siteSeal.js b/lib/services/websiteManagement2/lib/lib/models/siteSeal.js new file mode 100644 index 0000000000..42e247d6c4 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/siteSealRequest.js b/lib/services/websiteManagement2/lib/lib/models/siteSealRequest.js new file mode 100644 index 0000000000..1745db2223 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/siteSourceControl.js b/lib/services/websiteManagement2/lib/lib/models/siteSourceControl.js new file mode 100644 index 0000000000..492efb717f --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/skuCapacity.js b/lib/services/websiteManagement2/lib/lib/models/skuCapacity.js new file mode 100644 index 0000000000..975b91bfd9 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/skuDescription.js b/lib/services/websiteManagement2/lib/lib/models/skuDescription.js new file mode 100644 index 0000000000..25c3b62002 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/skuDescription.js @@ -0,0 +1,137 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 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/lib/models/skuInfo.js b/lib/services/websiteManagement2/lib/lib/models/skuInfo.js new file mode 100644 index 0000000000..ccf4d0de83 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/skuInfo.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'); + +/** + * 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/lib/models/skuInfoCollection.js b/lib/services/websiteManagement2/lib/lib/models/skuInfoCollection.js new file mode 100644 index 0000000000..d82ba762bd --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/skuInfos.js b/lib/services/websiteManagement2/lib/lib/models/skuInfos.js new file mode 100644 index 0000000000..229a953e50 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/skuInfos.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'; + +const models = require('./index'); + +/** + * 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/lib/models/slotConfigNamesResource.js b/lib/services/websiteManagement2/lib/lib/models/slotConfigNamesResource.js new file mode 100644 index 0000000000..e64eb91f19 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/slotConfigNamesResource.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'); + +/** + * 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. + */ + 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' + } + } + } + } + } + } + }; + } +} + +module.exports = SlotConfigNamesResource; diff --git a/lib/services/websiteManagement2/lib/lib/models/slotDifference.js b/lib/services/websiteManagement2/lib/lib/models/slotDifference.js new file mode 100644 index 0000000000..f20bdff1da --- /dev/null +++ b/lib/services/websiteManagement2/lib/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} [slotDifferenceType] Type 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' + } + }, + slotDifferenceType: { + required: false, + readOnly: true, + serializedName: 'properties.type', + 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/lib/models/slotDifferenceCollection.js b/lib/services/websiteManagement2/lib/lib/models/slotDifferenceCollection.js new file mode 100644 index 0000000000..ff836aff95 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/slotSwapStatus.js b/lib/services/websiteManagement2/lib/lib/models/slotSwapStatus.js new file mode 100644 index 0000000000..6d399a5285 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/slowRequestsBasedTrigger.js b/lib/services/websiteManagement2/lib/lib/models/slowRequestsBasedTrigger.js new file mode 100644 index 0000000000..30602cb26d --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/snapshot.js b/lib/services/websiteManagement2/lib/lib/models/snapshot.js new file mode 100644 index 0000000000..9420d3e70c --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/snapshotCollection.js b/lib/services/websiteManagement2/lib/lib/models/snapshotCollection.js new file mode 100644 index 0000000000..b6729f556f --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/snapshotRecoveryRequest.js b/lib/services/websiteManagement2/lib/lib/models/snapshotRecoveryRequest.js new file mode 100644 index 0000000000..e59a088c7c --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/snapshotRecoveryRequest.js @@ -0,0 +1,133 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 SnapshotRecoveryRequest extends models['ProxyOnlyResource'] { + /** + * Create a SnapshotRecoveryRequest. + * @member {string} [snapshotTime] Point in time in which the app recovery + * should be attempted, formatted as a DateTime string. + * @member {object} [recoveryTarget] Specifies the web app that snapshot + * contents will be written to. + * @member {string} [recoveryTarget.location] Geographical location of the + * target web app, e.g. SouthEastAsia, SouthCentralUS + * @member {string} [recoveryTarget.id] ARM resource ID of the target 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 recovery 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 SnapshotRecoveryRequest + * + * @returns {object} metadata of SnapshotRecoveryRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'SnapshotRecoveryRequest', + type: { + name: 'Composite', + className: 'SnapshotRecoveryRequest', + 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' + } + }, + recoveryTarget: { + required: false, + serializedName: 'properties.recoveryTarget', + type: { + name: 'Composite', + className: 'SnapshotRecoveryTarget' + } + }, + 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 = SnapshotRecoveryRequest; diff --git a/lib/services/websiteManagement2/lib/lib/models/snapshotRecoveryTarget.js b/lib/services/websiteManagement2/lib/lib/models/snapshotRecoveryTarget.js new file mode 100644 index 0000000000..9770a44e27 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/snapshotRecoveryTarget.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 written to. + * + */ +class SnapshotRecoveryTarget { + /** + * Create a SnapshotRecoveryTarget. + * @member {string} [location] Geographical location of the target web app, + * e.g. SouthEastAsia, SouthCentralUS + * @member {string} [id] ARM resource ID of the target 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 SnapshotRecoveryTarget + * + * @returns {object} metadata of SnapshotRecoveryTarget + * + */ + mapper() { + return { + required: false, + serializedName: 'SnapshotRecoveryTarget', + type: { + name: 'Composite', + className: 'SnapshotRecoveryTarget', + modelProperties: { + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SnapshotRecoveryTarget; diff --git a/lib/services/websiteManagement2/lib/lib/models/solution.js b/lib/services/websiteManagement2/lib/lib/models/solution.js new file mode 100644 index 0000000000..1b42d6409a --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/solution.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'); + +/** + * 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/lib/models/sourceControl.js b/lib/services/websiteManagement2/lib/lib/models/sourceControl.js new file mode 100644 index 0000000000..0c0d72a318 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/sourceControl.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'); + +/** + * The source control OAuth token. + * + * @extends models['ProxyOnlyResource'] + */ +class SourceControl extends models['ProxyOnlyResource'] { + /** + * Create a SourceControl. + * @member {string} [sourceControlName] Name or source control type. + * @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' + } + }, + sourceControlName: { + required: false, + serializedName: 'properties.name', + 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/lib/models/sourceControlCollection.js b/lib/services/websiteManagement2/lib/lib/models/sourceControlCollection.js new file mode 100644 index 0000000000..9fd89247ed --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/stackMajorVersion.js b/lib/services/websiteManagement2/lib/lib/models/stackMajorVersion.js new file mode 100644 index 0000000000..f8a3e54984 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/stackMajorVersion.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'); + +/** + * 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/lib/models/stackMinorVersion.js b/lib/services/websiteManagement2/lib/lib/models/stackMinorVersion.js new file mode 100644 index 0000000000..2154f681e0 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/stampCapacity.js b/lib/services/websiteManagement2/lib/lib/models/stampCapacity.js new file mode 100644 index 0000000000..8cb844d445 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/stampCapacity.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'; + +/** + * 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: 'Default', 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3' + * @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. + */ + 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: [ 'Default', 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3' ] + } + }, + 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' + } + } + } + } + }; + } +} + +module.exports = StampCapacity; diff --git a/lib/services/websiteManagement2/lib/lib/models/stampCapacityCollection.js b/lib/services/websiteManagement2/lib/lib/models/stampCapacityCollection.js new file mode 100644 index 0000000000..0d06935381 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/statusCodesBasedTrigger.js b/lib/services/websiteManagement2/lib/lib/models/statusCodesBasedTrigger.js new file mode 100644 index 0000000000..dbbf1ac65e --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/storageMigrationOptions.js b/lib/services/websiteManagement2/lib/lib/models/storageMigrationOptions.js new file mode 100644 index 0000000000..de8a5cd59a --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/storageMigrationResponse.js b/lib/services/websiteManagement2/lib/lib/models/storageMigrationResponse.js new file mode 100644 index 0000000000..06af20fad8 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/stringDictionary.js b/lib/services/websiteManagement2/lib/lib/models/stringDictionary.js new file mode 100644 index 0000000000..38f97b7edb --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/tldLegalAgreement.js b/lib/services/websiteManagement2/lib/lib/models/tldLegalAgreement.js new file mode 100644 index 0000000000..55671d5cb5 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/tldLegalAgreementCollection.js b/lib/services/websiteManagement2/lib/lib/models/tldLegalAgreementCollection.js new file mode 100644 index 0000000000..78ce4ed7f2 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/topLevelDomain.js b/lib/services/websiteManagement2/lib/lib/models/topLevelDomain.js new file mode 100644 index 0000000000..76d8577eaf --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/topLevelDomain.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 top level domain object. + * + * @extends models['ProxyOnlyResource'] + */ +class TopLevelDomain extends models['ProxyOnlyResource'] { + /** + * Create a TopLevelDomain. + * @member {string} [domainName] Name of the top level domain. + * @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' + } + }, + domainName: { + required: false, + readOnly: true, + serializedName: 'properties.name', + type: { + name: 'String' + } + }, + privacy: { + required: false, + serializedName: 'properties.privacy', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +module.exports = TopLevelDomain; diff --git a/lib/services/websiteManagement2/lib/lib/models/topLevelDomainAgreementOption.js b/lib/services/websiteManagement2/lib/lib/models/topLevelDomainAgreementOption.js new file mode 100644 index 0000000000..f444781f37 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/topLevelDomainCollection.js b/lib/services/websiteManagement2/lib/lib/models/topLevelDomainCollection.js new file mode 100644 index 0000000000..aa7c32fbb3 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/triggeredJobHistory.js b/lib/services/websiteManagement2/lib/lib/models/triggeredJobHistory.js new file mode 100644 index 0000000000..dda09c1cae --- /dev/null +++ b/lib/services/websiteManagement2/lib/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} [triggeredJobRuns] 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' + } + }, + triggeredJobRuns: { + required: false, + serializedName: 'properties.triggeredJobRuns', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'TriggeredJobRunElementType', + type: { + name: 'Composite', + className: 'TriggeredJobRun' + } + } + } + } + } + } + }; + } +} + +module.exports = TriggeredJobHistory; diff --git a/lib/services/websiteManagement2/lib/lib/models/triggeredJobHistoryCollection.js b/lib/services/websiteManagement2/lib/lib/models/triggeredJobHistoryCollection.js new file mode 100644 index 0000000000..37516f3fba --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/triggeredJobRun.js b/lib/services/websiteManagement2/lib/lib/models/triggeredJobRun.js new file mode 100644 index 0000000000..dafb649e30 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/triggeredJobRun.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'); + +/** + * Triggered Web Job Run Information. + * + * @extends models['ProxyOnlyResource'] + */ +class TriggeredJobRun extends models['ProxyOnlyResource'] { + /** + * Create a TriggeredJobRun. + * @member {string} [triggeredJobRunId] Job ID. + * @member {string} [triggeredJobRunName] 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' + } + }, + triggeredJobRunId: { + required: false, + serializedName: 'properties.id', + type: { + name: 'String' + } + }, + triggeredJobRunName: { + required: false, + readOnly: true, + serializedName: 'properties.name', + type: { + name: 'String' + } + }, + status: { + required: false, + serializedName: 'properties.status', + type: { + name: 'Enum', + allowedValues: [ 'Success', 'Failed', 'Error' ] + } + }, + startTime: { + required: false, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + serializedName: 'properties.endTime', + type: { + name: 'DateTime' + } + }, + duration: { + required: false, + serializedName: 'properties.duration', + type: { + name: 'String' + } + }, + outputUrl: { + required: false, + serializedName: 'properties.outputUrl', + type: { + name: 'String' + } + }, + errorUrl: { + required: false, + serializedName: 'properties.errorUrl', + type: { + name: 'String' + } + }, + url: { + required: false, + serializedName: 'properties.url', + type: { + name: 'String' + } + }, + jobName: { + required: false, + serializedName: 'properties.jobName', + type: { + name: 'String' + } + }, + trigger: { + required: false, + serializedName: 'properties.trigger', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = TriggeredJobRun; diff --git a/lib/services/websiteManagement2/lib/lib/models/triggeredWebJob.js b/lib/services/websiteManagement2/lib/lib/models/triggeredWebJob.js new file mode 100644 index 0000000000..076ffffe05 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/triggeredWebJob.js @@ -0,0 +1,191 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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.triggeredJobRunId] Job ID. + * @member {string} [latestRun.triggeredJobRunName] 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} [triggeredWebJobName] Job name. Used as job identifier in + * ARM resource URI. + * @member {string} [runCommand] Run command. + * @member {string} [url] Job URL. + * @member {string} [extraInfoUrl] Extra Info URL. + * @member {string} [jobType] 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.latestRun', + type: { + name: 'Composite', + className: 'TriggeredJobRun' + } + }, + historyUrl: { + required: false, + serializedName: 'properties.historyUrl', + type: { + name: 'String' + } + }, + schedulerLogsUrl: { + required: false, + serializedName: 'properties.schedulerLogsUrl', + type: { + name: 'String' + } + }, + triggeredWebJobName: { + required: false, + readOnly: true, + serializedName: 'properties.name', + type: { + name: 'String' + } + }, + runCommand: { + required: false, + serializedName: 'properties.runCommand', + type: { + name: 'String' + } + }, + url: { + required: false, + serializedName: 'properties.url', + type: { + name: 'String' + } + }, + extraInfoUrl: { + required: false, + serializedName: 'properties.extraInfoUrl', + type: { + name: 'String' + } + }, + jobType: { + required: false, + serializedName: 'properties.jobType', + type: { + name: 'Enum', + allowedValues: [ 'Continuous', 'Triggered' ] + } + }, + error: { + required: false, + serializedName: 'properties.error', + type: { + name: 'String' + } + }, + usingSdk: { + required: false, + serializedName: 'properties.usingSdk', + 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/lib/models/triggeredWebJobCollection.js b/lib/services/websiteManagement2/lib/lib/models/triggeredWebJobCollection.js new file mode 100644 index 0000000000..4affcd2633 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/usage.js b/lib/services/websiteManagement2/lib/lib/models/usage.js new file mode 100644 index 0000000000..a8bb508dd5 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/usage.js @@ -0,0 +1,162 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} [usageName] Name of the quota. + * @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' + } + }, + usageName: { + required: false, + readOnly: true, + serializedName: 'properties.name', + 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/lib/models/usageCollection.js b/lib/services/websiteManagement2/lib/lib/models/usageCollection.js new file mode 100644 index 0000000000..566e79b52b --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/user.js b/lib/services/websiteManagement2/lib/lib/models/user.js new file mode 100644 index 0000000000..8f3d0fbad6 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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} [userName] Username + * @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. + */ + 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' + } + }, + userName: { + required: false, + serializedName: 'properties.name', + 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' + } + } + } + } + }; + } +} + +module.exports = User; diff --git a/lib/services/websiteManagement2/lib/lib/models/validateRequest.js b/lib/services/websiteManagement2/lib/lib/models/validateRequest.js new file mode 100644 index 0000000000..479983a00f --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/validateRequest.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'; + +/** + * 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. + */ + 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' + } + } + } + } + }; + } +} + +module.exports = ValidateRequest; diff --git a/lib/services/websiteManagement2/lib/lib/models/validateResponse.js b/lib/services/websiteManagement2/lib/lib/models/validateResponse.js new file mode 100644 index 0000000000..e36d4735e4 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/validateResponse.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'); + +/** + * 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/lib/models/validateResponseError.js b/lib/services/websiteManagement2/lib/lib/models/validateResponseError.js new file mode 100644 index 0000000000..3fecb30d68 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/virtualApplication.js b/lib/services/websiteManagement2/lib/lib/models/virtualApplication.js new file mode 100644 index 0000000000..c85bbd6402 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/virtualApplication.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'); + +/** + * 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/lib/models/virtualDirectory.js b/lib/services/websiteManagement2/lib/lib/models/virtualDirectory.js new file mode 100644 index 0000000000..6950d3d013 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/virtualIPMapping.js b/lib/services/websiteManagement2/lib/lib/models/virtualIPMapping.js new file mode 100644 index 0000000000..34ac5296e9 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/virtualNetworkProfile.js b/lib/services/websiteManagement2/lib/lib/models/virtualNetworkProfile.js new file mode 100644 index 0000000000..c1f1b1b162 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/vnetGateway.js b/lib/services/websiteManagement2/lib/lib/models/vnetGateway.js new file mode 100644 index 0000000000..1019567d6e --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/vnetInfo.js b/lib/services/websiteManagement2/lib/lib/models/vnetInfo.js new file mode 100644 index 0000000000..6340d209a5 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/vnetParameters.js b/lib/services/websiteManagement2/lib/lib/models/vnetParameters.js new file mode 100644 index 0000000000..a3a8a850f0 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/vnetRoute.js b/lib/services/websiteManagement2/lib/lib/models/vnetRoute.js new file mode 100644 index 0000000000..5df4cf5959 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/vnetRoute.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'); + +/** + * 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} [vnetRouteName] The name of this route. This is only + * returned by the server and does not need to be set by the client. + * @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' + } + }, + vnetRouteName: { + required: false, + serializedName: 'properties.name', + 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/lib/models/vnetValidationFailureDetails.js b/lib/services/websiteManagement2/lib/lib/models/vnetValidationFailureDetails.js new file mode 100644 index 0000000000..f8b35f16b6 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/vnetValidationTestFailure.js b/lib/services/websiteManagement2/lib/lib/models/vnetValidationTestFailure.js new file mode 100644 index 0000000000..bc2219df3a --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/webAppCollection.js b/lib/services/websiteManagement2/lib/lib/models/webAppCollection.js new file mode 100644 index 0000000000..48876fe2b2 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/webAppInstanceCollection.js b/lib/services/websiteManagement2/lib/lib/models/webAppInstanceCollection.js new file mode 100644 index 0000000000..326dc57d43 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/webJob.js b/lib/services/websiteManagement2/lib/lib/models/webJob.js new file mode 100644 index 0000000000..8f2ed44730 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/models/webJob.js @@ -0,0 +1,154 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} [webJobName] Job name. Used as job identifier in ARM + * resource URI. + * @member {string} [runCommand] Run command. + * @member {string} [url] Job URL. + * @member {string} [extraInfoUrl] Extra Info URL. + * @member {string} [jobType] 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' + } + }, + webJobName: { + required: false, + readOnly: true, + serializedName: 'properties.name', + type: { + name: 'String' + } + }, + runCommand: { + required: false, + serializedName: 'properties.runCommand', + type: { + name: 'String' + } + }, + url: { + required: false, + serializedName: 'properties.url', + type: { + name: 'String' + } + }, + extraInfoUrl: { + required: false, + serializedName: 'properties.extraInfoUrl', + type: { + name: 'String' + } + }, + jobType: { + required: false, + serializedName: 'properties.jobType', + type: { + name: 'Enum', + allowedValues: [ 'Continuous', 'Triggered' ] + } + }, + error: { + required: false, + serializedName: 'properties.error', + type: { + name: 'String' + } + }, + usingSdk: { + required: false, + serializedName: 'properties.usingSdk', + 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/lib/models/webJobCollection.js b/lib/services/websiteManagement2/lib/lib/models/webJobCollection.js new file mode 100644 index 0000000000..6e3f47cb45 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/workerPool.js b/lib/services/websiteManagement2/lib/lib/models/workerPool.js new file mode 100644 index 0000000000..b7896d3594 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/workerPoolCollection.js b/lib/services/websiteManagement2/lib/lib/models/workerPoolCollection.js new file mode 100644 index 0000000000..a2595a2197 --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/models/workerPoolResource.js b/lib/services/websiteManagement2/lib/lib/models/workerPoolResource.js new file mode 100644 index 0000000000..b8da1fe66f --- /dev/null +++ b/lib/services/websiteManagement2/lib/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/lib/operations/appServiceCertificateOrders.js b/lib/services/websiteManagement2/lib/lib/operations/appServiceCertificateOrders.js new file mode 100644 index 0000000000..66ac67f507 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/operations/appServiceCertificateOrders.js @@ -0,0 +1,6774 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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.'); + } + let apiVersion = '2015-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.CertificateRegistration/certificateOrders'; + 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['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.'); + } + let apiVersion = '2015-08-01'; + // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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; + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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 (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 = { + 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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 = { + 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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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/lib/operations/appServiceEnvironments.js b/lib/services/websiteManagement2/lib/lib/operations/appServiceEnvironments.js new file mode 100644 index 0000000000..77b8ecdb35 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/operations/appServiceEnvironments.js @@ -0,0 +1,18725 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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.'); + } + let apiVersion = '2016-09-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.Web/hostingEnvironments'; + 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['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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 {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 {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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 {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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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; + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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 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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 _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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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._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._beginCreateOrUpdateMultiRolePool = _beginCreateOrUpdateMultiRolePool; + this._beginResume = _beginResume; + this._beginSuspend = _beginSuspend; + this._beginCreateOrUpdateWorkerPool = _beginCreateOrUpdateWorkerPool; + this._listNext = _listNext; + this._listByResourceGroupNext = _listByResourceGroupNext; + this._listCapacitiesNext = _listCapacitiesNext; + 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._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 {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 {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 {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 {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 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 {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 {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 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 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 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/lib/operations/appServicePlans.js b/lib/services/websiteManagement2/lib/lib/operations/appServicePlans.js new file mode 100644 index 0000000000..418daf0d0c --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/operations/appServicePlans.js @@ -0,0 +1,10483 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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; + let apiVersion = '2016-09-01'; + // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.appServicePlanName Name for the App Service + * plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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.appServicePlanPatchResourceName Name for the + * App Service plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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; + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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; + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.vnetRouteName] The name of this route. This is only + * returned by the server and does not need to be set by the client. + * + * @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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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.vnetRouteName] The name of this route. This is only + * returned by the server and does not need to be set by the client. + * + * @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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.appServicePlanName Name for the App Service + * plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.appServicePlanName Name for the App Service + * plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.appServicePlanName Name for the App Service + * plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.appServicePlanPatchResourceName Name for the + * App Service plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.appServicePlanPatchResourceName Name for the + * App Service plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.vnetRouteName] The name of this route. This is only + * returned by the server and does not need to be set by the client. + * + * @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.vnetRouteName] The name of this route. This is only + * returned by the server and does not need to be set by the client. + * + * @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.vnetRouteName] The name of this route. This is only + * returned by the server and does not need to be set by the client. + * + * @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.vnetRouteName] The name of this route. This is only + * returned by the server and does not need to be set by the client. + * + * @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.appServicePlanName Name for the App Service + * plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.appServicePlanName Name for the App Service + * plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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/lib/operations/billingMeters.js b/lib/services/websiteManagement2/lib/lib/operations/billingMeters.js new file mode 100644 index 0000000000..19ed4bd40c --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/operations/billingMeters.js @@ -0,0 +1,483 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.billingLocation] Azure Location of billable + * resource + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BillingMeterCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let billingLocation = (options && options.billingLocation !== undefined) ? options.billingLocation : undefined; + let apiVersion = '2016-03-01'; + // Validate + try { + if (billingLocation !== null && billingLocation !== undefined && typeof billingLocation.valueOf() !== 'string') { + throw new Error('billingLocation must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/billingMeters'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (billingLocation !== null && billingLocation !== undefined) { + queryParameters.push('billingLocation=' + encodeURIComponent(billingLocation)); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['BillingMeterCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BillingMeterCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['BillingMeterCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a BillingMeters. */ +class BillingMeters { + /** + * Create a BillingMeters. + * @param {WebSiteManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listNext = _listNext; + } + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.billingLocation] Azure Location of billable + * resource + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.billingLocation] Azure Location of billable + * resource + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {BillingMeterCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BillingMeterCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {BillingMeterCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BillingMeterCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = BillingMeters; diff --git a/lib/services/websiteManagement2/lib/lib/operations/certificateRegistrationProvider.js b/lib/services/websiteManagement2/lib/lib/operations/certificateRegistrationProvider.js new file mode 100644 index 0000000000..d46700b376 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/operations/certificateRegistrationProvider.js @@ -0,0 +1,475 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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.'); + } + let apiVersion = '2015-08-01'; + // Validate + try { + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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/lib/operations/certificates.js b/lib/services/websiteManagement2/lib/lib/operations/certificates.js new file mode 100644 index 0000000000..601943e575 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/operations/certificates.js @@ -0,0 +1,2089 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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.'); + } + let apiVersion = '2016-03-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.Web/certificates'; + 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['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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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/lib/operations/deletedWebApps.js b/lib/services/websiteManagement2/lib/lib/operations/deletedWebApps.js new file mode 100644 index 0000000000..50d8c1e457 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/operations/deletedWebApps.js @@ -0,0 +1,467 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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.'); + } + let apiVersion = '2016-03-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.Web/deletedSites'; + 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['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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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/lib/operations/diagnostics.js b/lib/services/websiteManagement2/lib/lib/operations/diagnostics.js new file mode 100644 index 0000000000..9eb79eb3f3 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/operations/diagnostics.js @@ -0,0 +1,6345 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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 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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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._listSiteDiagnosticCategories = _listSiteDiagnosticCategories; + this._getSiteDiagnosticCategory = _getSiteDiagnosticCategory; + this._listSiteAnalyses = _listSiteAnalyses; + this._getSiteAnalysis = _getSiteAnalysis; + this._executeSiteAnalysis = _executeSiteAnalysis; + this._listSiteDetectors = _listSiteDetectors; + this._getSiteDetector = _getSiteDetector; + this._executeSiteDetector = _executeSiteDetector; + 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._listSiteDiagnosticCategoriesNext = _listSiteDiagnosticCategoriesNext; + this._listSiteAnalysesNext = _listSiteAnalysesNext; + this._listSiteDetectorsNext = _listSiteDetectorsNext; + this._getSiteDetectorNext = _getSiteDetectorNext; + this._listSiteDiagnosticCategoriesSlotNext = _listSiteDiagnosticCategoriesSlotNext; + this._listSiteAnalysesSlotNext = _listSiteAnalysesSlotNext; + this._listSiteDetectorsSlotNext = _listSiteDetectorsSlotNext; + this._getSiteDetectorSlotNext = _getSiteDetectorSlotNext; + } + + /** + * @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 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 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 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/lib/operations/domainRegistrationProvider.js b/lib/services/websiteManagement2/lib/lib/operations/domainRegistrationProvider.js new file mode 100644 index 0000000000..6de060c6f0 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/operations/domainRegistrationProvider.js @@ -0,0 +1,475 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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.'); + } + let apiVersion = '2015-04-01'; + // Validate + try { + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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/lib/operations/domains.js b/lib/services/websiteManagement2/lib/lib/operations/domains.js new file mode 100644 index 0000000000..87984bef5e --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/operations/domains.js @@ -0,0 +1,5682 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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; + let apiVersion = '2015-04-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 (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-04-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.DomainRegistration/domains'; + 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['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.'); + } + let apiVersion = '2015-04-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.DomainRegistration/generateSsoRequest'; + 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) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-04-01'; + // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(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.'); + } + let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(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.'); + } + let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + 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); + }); +} + +/** + * @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.'); + } + let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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/lib/operations/index.d.ts b/lib/services/websiteManagement2/lib/lib/operations/index.d.ts new file mode 100644 index 0000000000..7ca9bd6da2 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/operations/index.d.ts @@ -0,0 +1,56146 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * 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 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 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 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 Get Diagnostics Categories + * + * Get Diagnostics Categories + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listSiteDiagnosticCategoriesSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get Diagnostics Categories + * + * Get Diagnostics Categories + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DiagnosticCategoryCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DiagnosticCategoryCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticCategoryCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listSiteDiagnosticCategoriesSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSiteDiagnosticCategoriesSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listSiteDiagnosticCategoriesSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get Site Analyses + * + * Get Site Analyses + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listSiteAnalysesSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get Site Analyses + * + * Get Site Analyses + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DiagnosticAnalysisCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DiagnosticAnalysisCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticAnalysisCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listSiteAnalysesSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSiteAnalysesSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listSiteAnalysesSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get Detectors + * + * Get Detectors + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listSiteDetectorsSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get Detectors + * + * Get Detectors + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DiagnosticDetectorCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DiagnosticDetectorCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticDetectorCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listSiteDetectorsSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSiteDetectorsSlotNext(nextPageLink: string, callback: ServiceCallback): void; + listSiteDetectorsSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get Detector + * + * Get Detector + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getSiteDetectorSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get Detector + * + * Get Detector + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {DiagnosticDetectorCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {DiagnosticDetectorCollection} [result] - The deserialized result object if an error did not occur. + * See {@link DiagnosticDetectorCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getSiteDetectorSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSiteDetectorSlotNext(nextPageLink: string, callback: ServiceCallback): void; + getSiteDetectorSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Provider + * __NOTE__: An instance of this class is automatically created for an + * instance of the WebSiteManagementClient. + */ +export interface Provider { + + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getAvailableStacksWithHttpOperationResponse(options?: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplicationStackCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ApplicationStackCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationStackCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getAvailableStacks(options?: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + getAvailableStacks(callback: ServiceCallback): void; + getAvailableStacks(options: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listOperationsWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {CsmOperationCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CsmOperationCollection} [result] - The deserialized result object if an error did not occur. + * See {@link CsmOperationCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listOperations(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listOperations(callback: ServiceCallback): void; + listOperations(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getAvailableStacksOnPremWithHttpOperationResponse(options?: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplicationStackCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ApplicationStackCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationStackCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getAvailableStacksOnPrem(options?: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + getAvailableStacksOnPrem(callback: ServiceCallback): void; + getAvailableStacksOnPrem(options: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getAvailableStacksNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplicationStackCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ApplicationStackCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationStackCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getAvailableStacksNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getAvailableStacksNext(nextPageLink: string, callback: ServiceCallback): void; + getAvailableStacksNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listOperationsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {CsmOperationCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CsmOperationCollection} [result] - The deserialized result object if an error did not occur. + * See {@link CsmOperationCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listOperationsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listOperationsNext(nextPageLink: string, callback: ServiceCallback): void; + listOperationsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getAvailableStacksOnPremNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplicationStackCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ApplicationStackCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationStackCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getAvailableStacksOnPremNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getAvailableStacksOnPremNext(nextPageLink: string, callback: ServiceCallback): void; + getAvailableStacksOnPremNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Recommendations + * __NOTE__: An instance of this class is automatically created for an + * instance of the WebSiteManagementClient. + */ +export interface Recommendations { + + + /** + * @summary List all recommendations for a subscription. + * + * List all recommendations for a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.featured] Specify true to return only + * the most critical recommendations. The default is false, which + * returns all recommendations. + * + * @param {string} [options.filter] Filter is specified by using OData syntax. + * Example: $filter=channels 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=channels 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 {string} [options.filter] Filter is specified by using OData syntax. + * Example: $filter=channels 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?: { 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 {string} [options.filter] Filter is specified by using OData syntax. + * Example: $filter=channels 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?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listHistoryForWebApp(resourceGroupName: string, siteName: string, callback: ServiceCallback): void; + listHistoryForWebApp(resourceGroupName: string, siteName: string, options: { 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=channels + * 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=channels + * 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 + * 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; +} + +/** + * @class + * BillingMeters + * __NOTE__: An instance of this class is automatically created for an + * instance of the WebSiteManagementClient. + */ +export interface BillingMeters { + + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.billingLocation] Azure Location of billable + * resource + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { billingLocation? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.billingLocation] Azure Location of billable + * resource + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {BillingMeterCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {BillingMeterCollection} [result] - The deserialized result object if an error did not occur. + * See {@link BillingMeterCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { billingLocation? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { billingLocation? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {BillingMeterCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {BillingMeterCollection} [result] - The deserialized result object if an error did not occur. + * See {@link BillingMeterCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * WebApps + * __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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @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 {boolean} [options.skipDnsRegistration] If true, DNS registration is + * skipped. + * + * @param {object} [options.customHeaders] Headers that 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, skipDnsRegistration? : 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is + * skipped. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [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, skipDnsRegistration? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, name: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, name: string, options: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, skipDnsRegistration? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, callback: ServiceCallback): void; + update(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, options: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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 Discovers an existing app backup that can be restored from a blob + * in Azure storage. + * + * Discovers an existing app backup that can be restored from a 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 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' + * + * @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. + */ + discoverRestoreWithHttpOperationResponse(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. + * + * Discovers an existing app backup that can be restored from a 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 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' + * + * @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. + */ + discoverRestore(resourceGroupName: string, name: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + discoverRestore(resourceGroupName: string, name: string, request: models.RestoreRequest, callback: ServiceCallback): void; + discoverRestore(resourceGroupName: string, name: string, request: models.RestoreRequest, 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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' + * + * @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' + * + * @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 {RestoreResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RestoreResponse} [result] - The deserialized result object if an error did not occur. + * See {@link RestoreResponse} for more information. + * + * {WebResource} [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 {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 {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 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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 {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 {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 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 {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 {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 {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.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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 {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 {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 {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.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 {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 {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 {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.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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 {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 {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 {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.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. + */ + getWebSiteContainerLogsZipWithHttpOperationResponse(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. + */ + getWebSiteContainerLogsZip(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getWebSiteContainerLogsZip(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getWebSiteContainerLogsZip(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 {string} [deployment.deploymentId] Identifier for deployment. + * + * @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 {string} [deployment.deploymentId] Identifier for deployment. + * + * @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 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.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.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {FunctionEnvelope} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FunctionEnvelope} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionEnvelope} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createFunction(resourceGroupName: string, name: string, functionName: string, functionEnvelope: models.FunctionEnvelope, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createFunction(resourceGroupName: string, name: string, functionName: string, functionEnvelope: models.FunctionEnvelope, callback: ServiceCallback): void; + createFunction(resourceGroupName: string, name: string, functionName: string, functionEnvelope: models.FunctionEnvelope, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteFunctionWithHttpOperationResponse(resourceGroupName: string, name: string, functionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteFunction(resourceGroupName: string, name: string, functionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteFunction(resourceGroupName: string, name: string, functionName: string, callback: ServiceCallback): void; + deleteFunction(resourceGroupName: string, name: string, functionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listFunctionSecretsWithHttpOperationResponse(resourceGroupName: string, name: string, functionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {FunctionSecrets} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FunctionSecrets} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionSecrets} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listFunctionSecrets(resourceGroupName: string, name: string, functionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listFunctionSecrets(resourceGroupName: string, name: string, functionName: string, callback: ServiceCallback): void; + listFunctionSecrets(resourceGroupName: string, name: string, functionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listHostNameBindingsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HostNameBindingCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HostNameBindingCollection} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBindingCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listHostNameBindings(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHostNameBindings(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listHostNameBindings(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getHostNameBindingWithHttpOperationResponse(resourceGroupName: string, name: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HostNameBinding} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HostNameBinding} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBinding} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getHostNameBinding(resourceGroupName: string, name: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getHostNameBinding(resourceGroupName: string, name: string, hostName: string, callback: ServiceCallback): void; + getHostNameBinding(resourceGroupName: string, name: string, hostName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateHostNameBindingWithHttpOperationResponse(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HostNameBinding} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HostNameBinding} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBinding} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateHostNameBinding(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateHostNameBinding(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, callback: ServiceCallback): void; + createOrUpdateHostNameBinding(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteHostNameBindingWithHttpOperationResponse(resourceGroupName: string, name: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteHostNameBinding(resourceGroupName: string, name: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteHostNameBinding(resourceGroupName: string, name: string, hostName: string, callback: ServiceCallback): void; + deleteHostNameBinding(resourceGroupName: string, name: string, hostName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getHybridConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HybridConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, callback: ServiceCallback): void; + getHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateHybridConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HybridConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, callback: ServiceCallback): void; + createOrUpdateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteHybridConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, callback: ServiceCallback): void; + deleteHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateHybridConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HybridConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + updateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, callback: ServiceCallback): void; + updateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listHybridConnectionKeysWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HybridConnectionKey} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HybridConnectionKey} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnectionKey} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listHybridConnectionKeys(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHybridConnectionKeys(resourceGroupName: string, name: string, namespaceName: string, relayName: string, callback: ServiceCallback): void; + listHybridConnectionKeys(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listHybridConnectionsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HybridConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listHybridConnections(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHybridConnections(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listHybridConnections(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listRelayServiceConnectionsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listRelayServiceConnections(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listRelayServiceConnections(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listRelayServiceConnections(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getRelayServiceConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, callback: ServiceCallback): void; + getRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateRelayServiceConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, callback: ServiceCallback): void; + createOrUpdateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteRelayServiceConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, callback: ServiceCallback): void; + deleteRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateRelayServiceConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + updateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, callback: ServiceCallback): void; + updateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listInstanceIdentifiersWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {WebAppInstanceCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {WebAppInstanceCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppInstanceCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceIdentifiers(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceIdentifiers(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listInstanceIdentifiers(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getInstanceMsDeployStatusWithHttpOperationResponse(resourceGroupName: string, name: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MSDeployStatus} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MSDeployStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceMsDeployStatus(resourceGroupName: string, name: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceMsDeployStatus(resourceGroupName: string, name: string, instanceId: string, callback: ServiceCallback): void; + getInstanceMsDeployStatus(resourceGroupName: string, name: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createInstanceMSDeployOperationWithHttpOperationResponse(resourceGroupName: string, name: string, instanceId: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MSDeployStatus} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MSDeployStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createInstanceMSDeployOperation(resourceGroupName: string, name: string, instanceId: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createInstanceMSDeployOperation(resourceGroupName: string, name: string, instanceId: string, mSDeploy: models.MSDeploy, callback: ServiceCallback): void; + createInstanceMSDeployOperation(resourceGroupName: string, name: string, instanceId: string, mSDeploy: models.MSDeploy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getInstanceMSDeployLogWithHttpOperationResponse(resourceGroupName: string, name: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MSDeployLog} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MSDeployLog} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployLog} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceMSDeployLog(resourceGroupName: string, name: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceMSDeployLog(resourceGroupName: string, name: string, instanceId: string, callback: ServiceCallback): void; + getInstanceMSDeployLog(resourceGroupName: string, name: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listInstanceProcessesWithHttpOperationResponse(resourceGroupName: string, name: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProcessInfoCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProcessInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfoCollection} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceProcesses(resourceGroupName: string, name: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceProcesses(resourceGroupName: string, name: string, instanceId: string, callback: ServiceCallback): void; + listInstanceProcesses(resourceGroupName: string, name: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getInstanceProcessWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProcessInfo} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProcessInfo} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfo} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, callback: ServiceCallback): void; + getInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteInstanceProcessWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, callback: ServiceCallback): void; + deleteInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getInstanceProcessDumpWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Object} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Object} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessDump(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceProcessDump(resourceGroupName: string, name: string, processId: string, instanceId: string, callback: ServiceCallback): void; + getInstanceProcessDump(resourceGroupName: string, name: string, processId: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listInstanceProcessModulesWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProcessModuleInfoCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProcessModuleInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfoCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceProcessModules(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceProcessModules(resourceGroupName: string, name: string, processId: string, instanceId: string, callback: ServiceCallback): void; + listInstanceProcessModules(resourceGroupName: string, name: string, processId: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getInstanceProcessModuleWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, baseAddress: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProcessModuleInfo} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProcessModuleInfo} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfo} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessModule(resourceGroupName: string, name: string, processId: string, baseAddress: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceProcessModule(resourceGroupName: string, name: string, processId: string, baseAddress: string, instanceId: string, callback: ServiceCallback): void; + getInstanceProcessModule(resourceGroupName: string, name: string, processId: string, baseAddress: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listInstanceProcessThreadsWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProcessThreadInfoCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProcessThreadInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfoCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceProcessThreads(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceProcessThreads(resourceGroupName: string, name: string, processId: string, instanceId: string, callback: ServiceCallback): void; + listInstanceProcessThreads(resourceGroupName: string, name: string, processId: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getInstanceProcessThreadWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, threadId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProcessThreadInfo} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProcessThreadInfo} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfo} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessThread(resourceGroupName: string, name: string, processId: string, threadId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceProcessThread(resourceGroupName: string, name: string, processId: string, threadId: string, instanceId: string, callback: ServiceCallback): void; + getInstanceProcessThread(resourceGroupName: string, name: string, processId: string, threadId: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + isCloneableWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SiteCloneability} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SiteCloneability} [result] - The deserialized result object if an error did not occur. + * See {@link SiteCloneability} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + isCloneable(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + isCloneable(resourceGroupName: string, name: string, callback: ServiceCallback): void; + isCloneable(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listSyncFunctionTriggersWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {FunctionSecrets} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FunctionSecrets} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionSecrets} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listSyncFunctionTriggers(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSyncFunctionTriggers(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listSyncFunctionTriggers(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listMetricDefinitionsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ResourceMetricDefinitionCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ResourceMetricDefinitionCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricDefinitionCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listMetricDefinitions(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetricDefinitions(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listMetricDefinitions(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime + * eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listMetricsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime + * eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ResourceMetricCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ResourceMetricCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listMetrics(resourceGroupName: string, name: string, options?: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listMetrics(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listMetrics(resourceGroupName: string, name: string, options: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores a web app. + * + * Restores a web app. + * + * @param {string} subscriptionName Azure subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationOptions Migration migrationOptions. + * + * @param {string} migrationOptions.azurefilesConnectionString AzureFiles + * connection string. + * + * @param {string} migrationOptions.azurefilesShare AzureFiles share. + * + * @param {boolean} [migrationOptions.switchSiteAfterMigration] + * trueif the app should be switched over; otherwise, + * false. + * + * @param {boolean} [migrationOptions.blockWriteAccessToSite] true + * if the app should be read only during copy operation; otherwise, + * false. + * + * @param {string} [migrationOptions.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + migrateStorageWithHttpOperationResponse(subscriptionName: string, resourceGroupName: string, name: string, migrationOptions: models.StorageMigrationOptions, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores a web app. + * + * Restores a web app. + * + * @param {string} subscriptionName Azure subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationOptions Migration migrationOptions. + * + * @param {string} migrationOptions.azurefilesConnectionString AzureFiles + * connection string. + * + * @param {string} migrationOptions.azurefilesShare AzureFiles share. + * + * @param {boolean} [migrationOptions.switchSiteAfterMigration] + * trueif the app should be switched over; otherwise, + * false. + * + * @param {boolean} [migrationOptions.blockWriteAccessToSite] true + * if the app should be read only during copy operation; otherwise, + * false. + * + * @param {string} [migrationOptions.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {StorageMigrationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {StorageMigrationResponse} [result] - The deserialized result object if an error did not occur. + * See {@link StorageMigrationResponse} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + migrateStorage(subscriptionName: string, resourceGroupName: string, name: string, migrationOptions: models.StorageMigrationOptions, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + migrateStorage(subscriptionName: string, resourceGroupName: string, name: string, migrationOptions: models.StorageMigrationOptions, callback: ServiceCallback): void; + migrateStorage(subscriptionName: string, resourceGroupName: string, name: string, migrationOptions: models.StorageMigrationOptions, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Migrates a local (in-app) MySql database to a remote MySql + * database. + * + * Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationRequestEnvelope MySql migration options. + * + * @param {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. + * + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' + * + * @param {string} [migrationRequestEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + migrateMySqlWithHttpOperationResponse(resourceGroupName: string, name: string, migrationRequestEnvelope: models.MigrateMySqlRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Migrates a local (in-app) MySql database to a remote MySql + * database. + * + * Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationRequestEnvelope MySql migration options. + * + * @param {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. + * + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' + * + * @param {string} [migrationRequestEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Operation} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Operation} [result] - The deserialized result object if an error did not occur. + * See {@link Operation} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + migrateMySql(resourceGroupName: string, name: string, migrationRequestEnvelope: models.MigrateMySqlRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + migrateMySql(resourceGroupName: string, name: string, migrationRequestEnvelope: models.MigrateMySqlRequest, callback: ServiceCallback): void; + migrateMySql(resourceGroupName: string, name: string, migrationRequestEnvelope: models.MigrateMySqlRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getMigrateMySqlStatusWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MigrateMySqlStatus} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MigrateMySqlStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MigrateMySqlStatus} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getMigrateMySqlStatus(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getMigrateMySqlStatus(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getMigrateMySqlStatus(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNetworkFeaturesWithHttpOperationResponse(resourceGroupName: string, name: string, view: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkFeatures} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {NetworkFeatures} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkFeatures} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNetworkFeatures(resourceGroupName: string, name: string, view: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNetworkFeatures(resourceGroupName: string, name: string, view: string, callback: ServiceCallback): void; + listNetworkFeatures(resourceGroupName: string, name: string, view: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + startWebSiteNetworkTraceWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {String} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {String} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + startWebSiteNetworkTrace(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + startWebSiteNetworkTrace(resourceGroupName: string, name: string, callback: ServiceCallback): void; + startWebSiteNetworkTrace(resourceGroupName: string, name: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + stopWebSiteNetworkTraceWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {String} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {String} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + stopWebSiteNetworkTrace(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + stopWebSiteNetworkTrace(resourceGroupName: string, name: string, callback: ServiceCallback): void; + stopWebSiteNetworkTrace(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + generateNewSitePublishingPasswordWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + generateNewSitePublishingPassword(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + generateNewSitePublishingPassword(resourceGroupName: string, name: string, callback: ServiceCallback): void; + generateNewSitePublishingPassword(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain + * eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listPerfMonCountersWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain + * eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PerfMonCounterCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {PerfMonCounterCollection} [result] - The deserialized result object if an error did not occur. + * See {@link PerfMonCounterCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listPerfMonCounters(resourceGroupName: string, name: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listPerfMonCounters(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listPerfMonCounters(resourceGroupName: string, name: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getSitePhpErrorLogFlagWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SitePhpErrorLogFlag} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SitePhpErrorLogFlag} [result] - The deserialized result object if an error did not occur. + * See {@link SitePhpErrorLogFlag} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getSitePhpErrorLogFlag(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSitePhpErrorLogFlag(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getSitePhpErrorLogFlag(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listPremierAddOnsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PremierAddOn} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {PremierAddOn} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listPremierAddOns(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listPremierAddOns(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listPremierAddOns(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getPremierAddOnWithHttpOperationResponse(resourceGroupName: string, name: string, premierAddOnName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PremierAddOn} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {PremierAddOn} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getPremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getPremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, callback: ServiceCallback): void; + getPremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. + * + * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. + * + * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. + * + * @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.premierAddOnName] Premier add on Name. + * + * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. + * + * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. + * + * @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 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} [options] Optional Parameters. + * + * @param {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {object} [options.customHeaders] Headers that 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, options?: { format? : string, 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} [options] Optional Parameters. + * + * @param {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, options?: { format? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, options: { format? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + recoverWithHttpOperationResponse(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. + */ + recover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + recover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, callback: ServiceCallback): void; + recover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, 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 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is + * skipped. + * + * @param {object} [options.customHeaders] Headers that 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, skipDnsRegistration? : 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is + * skipped. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [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, skipDnsRegistration? : 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, skipDnsRegistration? : 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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 Discovers an existing app backup that can be restored from a blob + * in Azure storage. + * + * Discovers an existing app backup that can be restored from a 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 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' + * + * @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. + */ + discoverRestoreSlotWithHttpOperationResponse(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. + * + * Discovers an existing app backup that can be restored from a 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 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' + * + * @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. + */ + discoverRestoreSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + discoverRestoreSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, callback: ServiceCallback): void; + discoverRestoreSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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' + * + * @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' + * + * @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 {RestoreResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RestoreResponse} [result] - The deserialized result object if an error did not occur. + * See {@link RestoreResponse} for more information. + * + * {WebResource} [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 {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 {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 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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 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 {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 {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 {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.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 {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 {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 {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.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 {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 {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 {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.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 {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 {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 {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.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. + */ + getWebSiteContainerLogsZipSlotWithHttpOperationResponse(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. + */ + getWebSiteContainerLogsZipSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getWebSiteContainerLogsZipSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + getWebSiteContainerLogsZipSlot(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 {string} [deployment.deploymentId] Identifier for deployment. + * + * @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 {string} [deployment.deploymentId] Identifier for deployment. + * + * @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 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.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.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {FunctionEnvelope} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FunctionEnvelope} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionEnvelope} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, functionEnvelope: models.FunctionEnvelope, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, functionEnvelope: models.FunctionEnvelope, callback: ServiceCallback): void; + createInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, functionEnvelope: models.FunctionEnvelope, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteInstanceFunctionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, functionName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, callback: ServiceCallback): void; + deleteInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listFunctionSecretsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, functionName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {FunctionSecrets} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FunctionSecrets} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionSecrets} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listFunctionSecretsSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listFunctionSecretsSlot(resourceGroupName: string, name: string, functionName: string, slot: string, callback: ServiceCallback): void; + listFunctionSecretsSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets hostname bindings for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listHostNameBindingsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets hostname bindings for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HostNameBindingCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HostNameBindingCollection} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBindingCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listHostNameBindingsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHostNameBindingsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listHostNameBindingsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API the named binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getHostNameBindingSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API the named binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HostNameBinding} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HostNameBinding} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBinding} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, callback: ServiceCallback): void; + getHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create a binding for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateHostNameBindingSlotWithHttpOperationResponse(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create a binding for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HostNameBinding} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HostNameBinding} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBinding} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateHostNameBindingSlot(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateHostNameBindingSlot(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, slot: string, callback: ServiceCallback): void; + createOrUpdateHostNameBindingSlot(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteHostNameBindingSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, callback: ServiceCallback): void; + deleteHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getHybridConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HybridConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, callback: ServiceCallback): void; + getHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateHybridConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HybridConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, callback: ServiceCallback): void; + createOrUpdateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteHybridConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, callback: ServiceCallback): void; + deleteHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateHybridConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HybridConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + updateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, callback: ServiceCallback): void; + updateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listHybridConnectionKeysSlotWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HybridConnectionKey} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HybridConnectionKey} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnectionKey} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listHybridConnectionKeysSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHybridConnectionKeysSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, callback: ServiceCallback): void; + listHybridConnectionKeysSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listHybridConnectionsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HybridConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listHybridConnectionsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHybridConnectionsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listHybridConnectionsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get hybrid connections for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listRelayServiceConnectionsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get hybrid connections for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listRelayServiceConnectionsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listRelayServiceConnectionsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listRelayServiceConnectionsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a hybrid connection for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a hybrid connection for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, callback: ServiceCallback): void; + getRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, callback: ServiceCallback): void; + createOrUpdateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete a hybrid connection for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete a hybrid connection for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, callback: ServiceCallback): void; + deleteRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + updateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, callback: ServiceCallback): void; + updateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets the production slot instances. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listInstanceIdentifiersSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets the production slot instances. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {WebAppInstanceCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {WebAppInstanceCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppInstanceCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceIdentifiersSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceIdentifiersSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listInstanceIdentifiersSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getInstanceMsDeployStatusSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MSDeployStatus} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MSDeployStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceMsDeployStatusSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceMsDeployStatusSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, callback: ServiceCallback): void; + getInstanceMsDeployStatusSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createInstanceMSDeployOperationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, instanceId: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MSDeployStatus} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MSDeployStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createInstanceMSDeployOperationSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createInstanceMSDeployOperationSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, mSDeploy: models.MSDeploy, callback: ServiceCallback): void; + createInstanceMSDeployOperationSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, mSDeploy: models.MSDeploy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getInstanceMSDeployLogSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MSDeployLog} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MSDeployLog} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployLog} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceMSDeployLogSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceMSDeployLogSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, callback: ServiceCallback): void; + getInstanceMSDeployLogSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listInstanceProcessesSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProcessInfoCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProcessInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfoCollection} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceProcessesSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceProcessesSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, callback: ServiceCallback): void; + listInstanceProcessesSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getInstanceProcessSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProcessInfo} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProcessInfo} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfo} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, callback: ServiceCallback): void; + getInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteInstanceProcessSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, callback: ServiceCallback): void; + deleteInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getInstanceProcessDumpSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Object} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Object} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessDumpSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceProcessDumpSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, callback: ServiceCallback): void; + getInstanceProcessDumpSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listInstanceProcessModulesSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProcessModuleInfoCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProcessModuleInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfoCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceProcessModulesSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceProcessModulesSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, callback: ServiceCallback): void; + listInstanceProcessModulesSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getInstanceProcessModuleSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProcessModuleInfo} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProcessModuleInfo} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfo} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessModuleSlot(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceProcessModuleSlot(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, instanceId: string, callback: ServiceCallback): void; + getInstanceProcessModuleSlot(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listInstanceProcessThreadsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProcessThreadInfoCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProcessThreadInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfoCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceProcessThreadsSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceProcessThreadsSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, callback: ServiceCallback): void; + listInstanceProcessThreadsSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getInstanceProcessThreadSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProcessThreadInfo} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProcessThreadInfo} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfo} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessThreadSlot(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceProcessThreadSlot(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, instanceId: string, callback: ServiceCallback): void; + getInstanceProcessThreadSlot(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. By default, this API + * returns information on the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + isCloneableSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. By default, this API + * returns information on the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SiteCloneability} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SiteCloneability} [result] - The deserialized result object if an error did not occur. + * See {@link SiteCloneability} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + isCloneableSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + isCloneableSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + isCloneableSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listSyncFunctionTriggersSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {FunctionSecrets} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FunctionSecrets} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionSecrets} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listSyncFunctionTriggersSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSyncFunctionTriggersSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listSyncFunctionTriggersSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metric definitions of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listMetricDefinitionsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metric definitions of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ResourceMetricDefinitionCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ResourceMetricDefinitionCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricDefinitionCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listMetricDefinitionsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetricDefinitionsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listMetricDefinitionsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metrics of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime + * eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listMetricsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metrics of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime + * eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ResourceMetricCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ResourceMetricCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listMetricsSlot(resourceGroupName: string, name: string, slot: string, options?: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listMetricsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listMetricsSlot(resourceGroupName: string, name: string, slot: string, options: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of the deployment slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getMigrateMySqlStatusSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of the deployment slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MigrateMySqlStatus} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MigrateMySqlStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MigrateMySqlStatus} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getMigrateMySqlStatusSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getMigrateMySqlStatusSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + getMigrateMySqlStatusSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get network features for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNetworkFeaturesSlotWithHttpOperationResponse(resourceGroupName: string, name: string, view: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get network features for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkFeatures} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {NetworkFeatures} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkFeatures} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNetworkFeaturesSlot(resourceGroupName: string, name: string, view: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNetworkFeaturesSlot(resourceGroupName: string, name: string, view: string, slot: string, callback: ServiceCallback): void; + listNetworkFeaturesSlot(resourceGroupName: string, name: string, view: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + startWebSiteNetworkTraceSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {String} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {String} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + startWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + startWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + startWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + stopWebSiteNetworkTraceSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {String} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {String} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + stopWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + stopWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + stopWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API generate a new publishing password for the production + * slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + generateNewSitePublishingPasswordSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API generate a new publishing password for the production + * slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + generateNewSitePublishingPasswordSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + generateNewSitePublishingPasswordSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + generateNewSitePublishingPasswordSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain + * eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listPerfMonCountersSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain + * eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PerfMonCounterCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {PerfMonCounterCollection} [result] - The deserialized result object if an error did not occur. + * See {@link PerfMonCounterCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listPerfMonCountersSlot(resourceGroupName: string, name: string, slot: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listPerfMonCountersSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listPerfMonCountersSlot(resourceGroupName: string, name: string, slot: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getSitePhpErrorLogFlagSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SitePhpErrorLogFlag} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SitePhpErrorLogFlag} [result] - The deserialized result object if an error did not occur. + * See {@link SitePhpErrorLogFlag} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getSitePhpErrorLogFlagSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSitePhpErrorLogFlagSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + getSitePhpErrorLogFlagSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the premier add-ons for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listPremierAddOnsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the premier add-ons for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PremierAddOn} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {PremierAddOn} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listPremierAddOnsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listPremierAddOnsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listPremierAddOnsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the named add-on for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getPremierAddOnSlotWithHttpOperationResponse(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the named add-on for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PremierAddOn} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {PremierAddOn} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, callback: ServiceCallback): void; + getPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. + * + * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. + * + * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. + * + * @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.premierAddOnName] Premier add on Name. + * + * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. + * + * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. + * + * @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 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 {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 {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {object} [options.customHeaders] Headers that 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, slot: string, options?: { format? : string, 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 {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 {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, slot: string, options?: { format? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listPublishingProfileXmlWithSecretsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listPublishingProfileXmlWithSecretsSlot(resourceGroupName: string, name: string, slot: string, options: { format? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. + */ + recoverSlotWithHttpOperationResponse(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. + */ + recoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + recoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, callback: ServiceCallback): void; + recoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, 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 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @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' + * + * @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' + * + * @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 {RestoreResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RestoreResponse} [result] - The deserialized result object if an error did not occur. + * See {@link RestoreResponse} for more information. + * + * {WebResource} [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.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.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 Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginRecoverWithHttpOperationResponse(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. + */ + beginRecover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRecover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, callback: ServiceCallback): void; + beginRecover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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' + * + * @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' + * + * @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 {RestoreResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RestoreResponse} [result] - The deserialized result object if an error did not occur. + * See {@link RestoreResponse} for more information. + * + * {WebResource} [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.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.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 Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. + */ + beginRecoverSlotWithHttpOperationResponse(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. + */ + beginRecoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRecoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, callback: ServiceCallback): void; + beginRecoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, 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 {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 {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 {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 {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 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 {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 {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 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 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 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.appServicePlanName Name for the App Service + * plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.appServicePlanName Name for the App Service + * plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.appServicePlanPatchResourceName Name for the + * App Service plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.appServicePlanPatchResourceName Name for the + * App Service plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.vnetRouteName] The name of this route. This is only + * returned by the server and does not need to be set by the client. + * + * @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.vnetRouteName] The name of this route. This is only + * returned by the server and does not need to be set by the client. + * + * @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.vnetRouteName] The name of this route. This is only + * returned by the server and does not need to be set by the client. + * + * @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.vnetRouteName] The name of this route. This is only + * returned by the server and does not need to be set by the client. + * + * @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.appServicePlanName Name for the App Service + * plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.appServicePlanName Name for the App Service + * plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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; +} diff --git a/lib/services/websiteManagement2/lib/lib/operations/index.js b/lib/services/websiteManagement2/lib/lib/operations/index.js new file mode 100644 index 0000000000..3a92dd8e10 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/operations/index.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * 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.ResourceHealthMetadataOperations = require('./resourceHealthMetadataOperations'); +exports.BillingMeters = require('./billingMeters'); +exports.WebApps = require('./webApps'); +exports.AppServiceEnvironments = require('./appServiceEnvironments'); +exports.AppServicePlans = require('./appServicePlans'); diff --git a/lib/services/websiteManagement2/lib/lib/operations/provider.js b/lib/services/websiteManagement2/lib/lib/operations/provider.js new file mode 100644 index 0000000000..e65baac626 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/operations/provider.js @@ -0,0 +1,1379 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationStackCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getAvailableStacks(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let osTypeSelected = (options && options.osTypeSelected !== undefined) ? options.osTypeSelected : undefined; + let apiVersion = '2016-03-01'; + // Validate + try { + if (osTypeSelected !== null && osTypeSelected !== undefined && typeof osTypeSelected.valueOf() !== 'string') { + throw new Error('osTypeSelected must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-01'; + // Validate + try { + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CsmOperationCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationStackCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getAvailableStacksOnPrem(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let osTypeSelected = (options && options.osTypeSelected !== undefined) ? options.osTypeSelected : undefined; + let apiVersion = '2016-03-01'; + // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplicationStackCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a Provider. */ +class Provider { + /** + * Create a Provider. + * @param {WebSiteManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._getAvailableStacks = _getAvailableStacks; + this._listOperations = _listOperations; + this._getAvailableStacksOnPrem = _getAvailableStacksOnPrem; + this._getAvailableStacksNext = _getAvailableStacksNext; + this._listOperationsNext = _listOperationsNext; + this._getAvailableStacksOnPremNext = _getAvailableStacksOnPremNext; + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getAvailableStacksWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getAvailableStacks(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ApplicationStackCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationStackCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getAvailableStacks(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getAvailableStacks(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getAvailableStacks(options, optionalCallback); + } + } + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listOperationsWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listOperations(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {CsmOperationCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CsmOperationCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listOperations(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listOperations(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listOperations(options, optionalCallback); + } + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getAvailableStacksOnPremWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getAvailableStacksOnPrem(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ApplicationStackCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationStackCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getAvailableStacksOnPrem(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getAvailableStacksOnPrem(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getAvailableStacksOnPrem(options, optionalCallback); + } + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getAvailableStacksNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getAvailableStacksNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ApplicationStackCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationStackCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getAvailableStacksNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getAvailableStacksNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getAvailableStacksNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listOperationsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listOperationsNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {CsmOperationCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CsmOperationCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listOperationsNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listOperationsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listOperationsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getAvailableStacksOnPremNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getAvailableStacksOnPremNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ApplicationStackCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationStackCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getAvailableStacksOnPremNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getAvailableStacksOnPremNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getAvailableStacksOnPremNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Provider; diff --git a/lib/services/websiteManagement2/lib/lib/operations/recommendations.js b/lib/services/websiteManagement2/lib/lib/operations/recommendations.js new file mode 100644 index 0000000000..66adb54b6a --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/operations/recommendations.js @@ -0,0 +1,2944 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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=channels 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; + let apiVersion = '2016-03-01'; + // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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.Web/recommendations/reset'; + 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 !== 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.'); + } + let apiVersion = '2016-03-01'; + // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 {string} [options.filter] Filter is specified by using OData syntax. + * Example: $filter=channels 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 filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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 (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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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 (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + 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['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=channels + * 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; + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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; + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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=channels 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=channels 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 {string} [options.filter] Filter is specified by using OData syntax. + * Example: $filter=channels 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 {string} [options.filter] Filter is specified by using OData syntax. + * Example: $filter=channels 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=channels + * 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=channels + * 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/lib/operations/resourceHealthMetadataOperations.js b/lib/services/websiteManagement2/lib/lib/operations/resourceHealthMetadataOperations.js new file mode 100644 index 0000000000..22c45328e6 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/operations/resourceHealthMetadataOperations.js @@ -0,0 +1,2470 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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.'); + } + let apiVersion = '2016-03-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.Web/resourceHealthMetadata'; + 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['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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/lib/operations/topLevelDomains.js b/lib/services/websiteManagement2/lib/lib/operations/topLevelDomains.js new file mode 100644 index 0000000000..ed6c81ea55 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/operations/topLevelDomains.js @@ -0,0 +1,1200 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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.'); + } + let apiVersion = '2015-04-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.DomainRegistration/topLevelDomains'; + 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['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.'); + } + let apiVersion = '2015-04-01'; + // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-04-01'; + // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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/lib/operations/webApps.js b/lib/services/websiteManagement2/lib/lib/operations/webApps.js new file mode 100644 index 0000000000..5512ecb8d8 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/operations/webApps.js @@ -0,0 +1,116459 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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.'); + } + let apiVersion = '2016-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.Web/sites'; + 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['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; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is + * skipped. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [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; + let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { + throw new Error('skipDnsRegistration must be of type boolean.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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())); + } + if (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { + queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); + } + 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 && 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} 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.'); + } + let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; + let skipCustomDomainVerification = (options && options.skipCustomDomainVerification !== undefined) ? options.skipCustomDomainVerification : undefined; + let forceDnsRegistration = (options && options.forceDnsRegistration !== undefined) ? options.forceDnsRegistration : undefined; + let ttlInSeconds = (options && options.ttlInSeconds !== undefined) ? options.ttlInSeconds : undefined; + let apiVersion = '2016-08-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { + throw new Error('skipDnsRegistration must be of type boolean.'); + } + if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined && typeof skipCustomDomainVerification !== 'boolean') { + throw new Error('skipCustomDomainVerification must be of type boolean.'); + } + if (forceDnsRegistration !== null && forceDnsRegistration !== undefined && typeof forceDnsRegistration !== 'boolean') { + throw new Error('forceDnsRegistration must be of type boolean.'); + } + if (ttlInSeconds !== null && ttlInSeconds !== undefined && typeof ttlInSeconds.valueOf() !== 'string') { + throw new Error('ttlInSeconds must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { + queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); + } + if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined) { + queryParameters.push('skipCustomDomainVerification=' + encodeURIComponent(skipCustomDomainVerification.toString())); + } + if (forceDnsRegistration !== null && forceDnsRegistration !== undefined) { + queryParameters.push('forceDnsRegistration=' + encodeURIComponent(forceDnsRegistration.toString())); + } + if (ttlInSeconds !== null && ttlInSeconds !== undefined) { + queryParameters.push('ttlInSeconds=' + encodeURIComponent(ttlInSeconds)); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Discovers an existing app backup that can be restored from a blob + * in Azure storage. + * + * Discovers an existing app backup that can be restored from a 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 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' + * + * @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 _discoverRestore(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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/discover'; + 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(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['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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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' + * + * @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 RestoreResponse} for more information. + * + * {object} [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 + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RestoreResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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 {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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 {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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 {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 {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 {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.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 {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 {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 {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.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 _getWebSiteContainerLogsZip(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 apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 {string} [deployment.deploymentId] Identifier for deployment. + * + * @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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['NetworkFeatures']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let durationInSeconds = (options && options.durationInSeconds !== undefined) ? options.durationInSeconds : undefined; + let maxFrameLength = (options && options.maxFrameLength !== undefined) ? options.maxFrameLength : undefined; + let sasUrl = (options && options.sasUrl !== undefined) ? options.sasUrl : undefined; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _generateNewSitePublishingPassword(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.premierAddOnName] Premier add on Name. + * + * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. + * + * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. + * + * @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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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} [options] Optional Parameters. + * + * @param {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, 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, options, callback) { + /* jshint 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 format = (options && options.format !== undefined) ? options.format : undefined; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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 (format !== null && format !== undefined && typeof format.valueOf() !== 'string') { + throw new Error('format must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.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 publishingProfileOptions; + if (format !== null && format !== undefined) { + publishingProfileOptions = new client.models['CsmPublishingProfileOptions'](); + publishingProfileOptions.format = format; + } + + // 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.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 Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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 _recover(resourceGroupName, name, recoveryEntity, options, callback) { + /* jshint 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.beginRecover(resourceGroupName, name, recoveryEntity, 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 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is + * skipped. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [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; + let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { + throw new Error('skipDnsRegistration must be of type boolean.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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())); + } + if (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { + queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); + } + 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 && 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} 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.'); + } + let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; + let skipCustomDomainVerification = (options && options.skipCustomDomainVerification !== undefined) ? options.skipCustomDomainVerification : undefined; + let forceDnsRegistration = (options && options.forceDnsRegistration !== undefined) ? options.forceDnsRegistration : undefined; + let ttlInSeconds = (options && options.ttlInSeconds !== undefined) ? options.ttlInSeconds : undefined; + let apiVersion = '2016-08-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { + throw new Error('skipDnsRegistration must be of type boolean.'); + } + if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined && typeof skipCustomDomainVerification !== 'boolean') { + throw new Error('skipCustomDomainVerification must be of type boolean.'); + } + if (forceDnsRegistration !== null && forceDnsRegistration !== undefined && typeof forceDnsRegistration !== 'boolean') { + throw new Error('forceDnsRegistration must be of type boolean.'); + } + if (ttlInSeconds !== null && ttlInSeconds !== undefined && typeof ttlInSeconds.valueOf() !== 'string') { + throw new Error('ttlInSeconds must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { + queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); + } + if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined) { + queryParameters.push('skipCustomDomainVerification=' + encodeURIComponent(skipCustomDomainVerification.toString())); + } + if (forceDnsRegistration !== null && forceDnsRegistration !== undefined) { + queryParameters.push('forceDnsRegistration=' + encodeURIComponent(forceDnsRegistration.toString())); + } + if (ttlInSeconds !== null && ttlInSeconds !== undefined) { + queryParameters.push('ttlInSeconds=' + encodeURIComponent(ttlInSeconds)); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Discovers an existing app backup that can be restored from a blob + * in Azure storage. + * + * Discovers an existing app backup that can be restored from a 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 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' + * + * @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 _discoverRestoreSlot(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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/discover'; + 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(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['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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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' + * + * @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. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestoreResponse} for more information. + * + * {object} [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 + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RestoreResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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 {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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 {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 {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 {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.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 {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 {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 {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.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 _getWebSiteContainerLogsZipSlot(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 apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 {string} [deployment.deploymentId] Identifier for deployment. + * + * @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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['NetworkFeatures']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let durationInSeconds = (options && options.durationInSeconds !== undefined) ? options.durationInSeconds : undefined; + let maxFrameLength = (options && options.maxFrameLength !== undefined) ? options.maxFrameLength : undefined; + let sasUrl = (options && options.sasUrl !== undefined) ? options.sasUrl : undefined; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API generate a new publishing password for the production + * slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.premierAddOnName] Premier add on Name. + * + * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. + * + * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. + * + * @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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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 {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 {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, 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, slot, options, callback) { + /* jshint 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 format = (options && options.format !== undefined) ? options.format : undefined; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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 (format !== null && format !== undefined && typeof format.valueOf() !== 'string') { + throw new Error('format must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.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 publishingProfileOptions; + if (format !== null && format !== undefined) { + publishingProfileOptions = new client.models['CsmPublishingProfileOptions'](); + publishingProfileOptions.format = format; + } + + // 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.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 Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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 _recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, callback) { + /* jshint 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.beginRecoverSlot(resourceGroupName, name, recoveryEntity, 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 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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); + } + } + + 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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); + } + } + + 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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); + } + } + + 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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); + } + } + + 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} 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.'); + } + let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; + let skipCustomDomainVerification = (options && options.skipCustomDomainVerification !== undefined) ? options.skipCustomDomainVerification : undefined; + let forceDnsRegistration = (options && options.forceDnsRegistration !== undefined) ? options.forceDnsRegistration : undefined; + let ttlInSeconds = (options && options.ttlInSeconds !== undefined) ? options.ttlInSeconds : undefined; + let apiVersion = '2016-08-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { + throw new Error('skipDnsRegistration must be of type boolean.'); + } + if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined && typeof skipCustomDomainVerification !== 'boolean') { + throw new Error('skipCustomDomainVerification must be of type boolean.'); + } + if (forceDnsRegistration !== null && forceDnsRegistration !== undefined && typeof forceDnsRegistration !== 'boolean') { + throw new Error('forceDnsRegistration must be of type boolean.'); + } + if (ttlInSeconds !== null && ttlInSeconds !== undefined && typeof ttlInSeconds.valueOf() !== 'string') { + throw new Error('ttlInSeconds must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { + queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); + } + if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined) { + queryParameters.push('skipCustomDomainVerification=' + encodeURIComponent(skipCustomDomainVerification.toString())); + } + if (forceDnsRegistration !== null && forceDnsRegistration !== undefined) { + queryParameters.push('forceDnsRegistration=' + encodeURIComponent(forceDnsRegistration.toString())); + } + if (ttlInSeconds !== null && ttlInSeconds !== undefined) { + queryParameters.push('ttlInSeconds=' + encodeURIComponent(ttlInSeconds)); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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' + * + * @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 RestoreResponse} for more information. + * + * {object} [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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RestoreResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 _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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-08-01'; + // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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 _beginRecover(resourceGroupName, name, recoveryEntity, options, callback) { + /* jshint 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 = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (recoveryEntity === null || recoveryEntity === undefined) { + throw new Error('recoveryEntity 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/recover'; + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 (recoveryEntity !== null && recoveryEntity !== undefined) { + let requestModelMapper = new client.models['SnapshotRecoveryRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, recoveryEntity, 'recoveryEntity'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(recoveryEntity, null, 2)}.`); + return callback(serializationError); + } + 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} 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.'); + } + let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; + let skipCustomDomainVerification = (options && options.skipCustomDomainVerification !== undefined) ? options.skipCustomDomainVerification : undefined; + let forceDnsRegistration = (options && options.forceDnsRegistration !== undefined) ? options.forceDnsRegistration : undefined; + let ttlInSeconds = (options && options.ttlInSeconds !== undefined) ? options.ttlInSeconds : undefined; + let apiVersion = '2016-08-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { + throw new Error('skipDnsRegistration must be of type boolean.'); + } + if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined && typeof skipCustomDomainVerification !== 'boolean') { + throw new Error('skipCustomDomainVerification must be of type boolean.'); + } + if (forceDnsRegistration !== null && forceDnsRegistration !== undefined && typeof forceDnsRegistration !== 'boolean') { + throw new Error('forceDnsRegistration must be of type boolean.'); + } + if (ttlInSeconds !== null && ttlInSeconds !== undefined && typeof ttlInSeconds.valueOf() !== 'string') { + throw new Error('ttlInSeconds must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { + queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); + } + if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined) { + queryParameters.push('skipCustomDomainVerification=' + encodeURIComponent(skipCustomDomainVerification.toString())); + } + if (forceDnsRegistration !== null && forceDnsRegistration !== undefined) { + queryParameters.push('forceDnsRegistration=' + encodeURIComponent(forceDnsRegistration.toString())); + } + if (ttlInSeconds !== null && ttlInSeconds !== undefined) { + queryParameters.push('ttlInSeconds=' + encodeURIComponent(ttlInSeconds)); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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' + * + * @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. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestoreResponse} for more information. + * + * {object} [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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RestoreResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 _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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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 Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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 _beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, callback) { + /* jshint 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 = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (recoveryEntity === null || recoveryEntity === undefined) { + throw new Error('recoveryEntity 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/recover'; + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 (recoveryEntity !== null && recoveryEntity !== undefined) { + let requestModelMapper = new client.models['SnapshotRecoveryRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, recoveryEntity, 'recoveryEntity'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(recoveryEntity, null, 2)}.`); + return callback(serializationError); + } + 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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); + } + } + + 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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); + } + } + + 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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._discoverRestore = _discoverRestore; + 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._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._getConfiguration = _getConfiguration; + this._createOrUpdateConfiguration = _createOrUpdateConfiguration; + this._updateConfiguration = _updateConfiguration; + this._listConfigurationSnapshotInfo = _listConfigurationSnapshotInfo; + this._getConfigurationSnapshot = _getConfigurationSnapshot; + this._recoverSiteConfigurationSnapshot = _recoverSiteConfigurationSnapshot; + this._getWebSiteContainerLogs = _getWebSiteContainerLogs; + this._getWebSiteContainerLogsZip = _getWebSiteContainerLogsZip; + 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._listDomainOwnershipIdentifiers = _listDomainOwnershipIdentifiers; + this._getDomainOwnershipIdentifier = _getDomainOwnershipIdentifier; + this._createOrUpdateDomainOwnershipIdentifier = _createOrUpdateDomainOwnershipIdentifier; + this._deleteDomainOwnershipIdentifier = _deleteDomainOwnershipIdentifier; + this._updateDomainOwnershipIdentifier = _updateDomainOwnershipIdentifier; + this._getMSDeployStatus = _getMSDeployStatus; + this._createMSDeployOperation = _createMSDeployOperation; + this._getMSDeployLog = _getMSDeployLog; + this._listFunctions = _listFunctions; + this._getFunctionsAdminToken = _getFunctionsAdminToken; + this._getFunction = _getFunction; + this._createFunction = _createFunction; + this._deleteFunction = _deleteFunction; + this._listFunctionSecrets = _listFunctionSecrets; + this._listHostNameBindings = _listHostNameBindings; + this._getHostNameBinding = _getHostNameBinding; + this._createOrUpdateHostNameBinding = _createOrUpdateHostNameBinding; + this._deleteHostNameBinding = _deleteHostNameBinding; + this._getHybridConnection = _getHybridConnection; + this._createOrUpdateHybridConnection = _createOrUpdateHybridConnection; + this._deleteHybridConnection = _deleteHybridConnection; + this._updateHybridConnection = _updateHybridConnection; + this._listHybridConnectionKeys = _listHybridConnectionKeys; + this._listHybridConnections = _listHybridConnections; + this._listRelayServiceConnections = _listRelayServiceConnections; + this._getRelayServiceConnection = _getRelayServiceConnection; + this._createOrUpdateRelayServiceConnection = _createOrUpdateRelayServiceConnection; + this._deleteRelayServiceConnection = _deleteRelayServiceConnection; + this._updateRelayServiceConnection = _updateRelayServiceConnection; + this._listInstanceIdentifiers = _listInstanceIdentifiers; + this._getInstanceMsDeployStatus = _getInstanceMsDeployStatus; + this._createInstanceMSDeployOperation = _createInstanceMSDeployOperation; + this._getInstanceMSDeployLog = _getInstanceMSDeployLog; + this._listInstanceProcesses = _listInstanceProcesses; + this._getInstanceProcess = _getInstanceProcess; + this._deleteInstanceProcess = _deleteInstanceProcess; + this._getInstanceProcessDump = _getInstanceProcessDump; + this._listInstanceProcessModules = _listInstanceProcessModules; + this._getInstanceProcessModule = _getInstanceProcessModule; + this._listInstanceProcessThreads = _listInstanceProcessThreads; + this._getInstanceProcessThread = _getInstanceProcessThread; + this._isCloneable = _isCloneable; + this._listSyncFunctionTriggers = _listSyncFunctionTriggers; + this._listMetricDefinitions = _listMetricDefinitions; + this._listMetrics = _listMetrics; + this._migrateStorage = _migrateStorage; + this._migrateMySql = _migrateMySql; + this._getMigrateMySqlStatus = _getMigrateMySqlStatus; + this._listNetworkFeatures = _listNetworkFeatures; + this._startWebSiteNetworkTrace = _startWebSiteNetworkTrace; + this._stopWebSiteNetworkTrace = _stopWebSiteNetworkTrace; + this._generateNewSitePublishingPassword = _generateNewSitePublishingPassword; + this._listPerfMonCounters = _listPerfMonCounters; + this._getSitePhpErrorLogFlag = _getSitePhpErrorLogFlag; + this._listPremierAddOns = _listPremierAddOns; + this._getPremierAddOn = _getPremierAddOn; + this._addPremierAddOn = _addPremierAddOn; + this._deletePremierAddOn = _deletePremierAddOn; + this._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._recover = _recover; + this._resetProductionSlotConfig = _resetProductionSlotConfig; + this._restart = _restart; + 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._discoverRestoreSlot = _discoverRestoreSlot; + 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._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._getConfigurationSlot = _getConfigurationSlot; + this._createOrUpdateConfigurationSlot = _createOrUpdateConfigurationSlot; + this._updateConfigurationSlot = _updateConfigurationSlot; + this._listConfigurationSnapshotInfoSlot = _listConfigurationSnapshotInfoSlot; + this._getConfigurationSnapshotSlot = _getConfigurationSnapshotSlot; + this._recoverSiteConfigurationSnapshotSlot = _recoverSiteConfigurationSnapshotSlot; + this._getWebSiteContainerLogsSlot = _getWebSiteContainerLogsSlot; + this._getWebSiteContainerLogsZipSlot = _getWebSiteContainerLogsZipSlot; + 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._listDomainOwnershipIdentifiersSlot = _listDomainOwnershipIdentifiersSlot; + this._getDomainOwnershipIdentifierSlot = _getDomainOwnershipIdentifierSlot; + this._createOrUpdateDomainOwnershipIdentifierSlot = _createOrUpdateDomainOwnershipIdentifierSlot; + this._deleteDomainOwnershipIdentifierSlot = _deleteDomainOwnershipIdentifierSlot; + this._updateDomainOwnershipIdentifierSlot = _updateDomainOwnershipIdentifierSlot; + this._getMSDeployStatusSlot = _getMSDeployStatusSlot; + this._createMSDeployOperationSlot = _createMSDeployOperationSlot; + this._getMSDeployLogSlot = _getMSDeployLogSlot; + this._listInstanceFunctionsSlot = _listInstanceFunctionsSlot; + this._getFunctionsAdminTokenSlot = _getFunctionsAdminTokenSlot; + this._getInstanceFunctionSlot = _getInstanceFunctionSlot; + this._createInstanceFunctionSlot = _createInstanceFunctionSlot; + this._deleteInstanceFunctionSlot = _deleteInstanceFunctionSlot; + this._listFunctionSecretsSlot = _listFunctionSecretsSlot; + this._listHostNameBindingsSlot = _listHostNameBindingsSlot; + this._getHostNameBindingSlot = _getHostNameBindingSlot; + this._createOrUpdateHostNameBindingSlot = _createOrUpdateHostNameBindingSlot; + this._deleteHostNameBindingSlot = _deleteHostNameBindingSlot; + this._getHybridConnectionSlot = _getHybridConnectionSlot; + this._createOrUpdateHybridConnectionSlot = _createOrUpdateHybridConnectionSlot; + this._deleteHybridConnectionSlot = _deleteHybridConnectionSlot; + this._updateHybridConnectionSlot = _updateHybridConnectionSlot; + this._listHybridConnectionKeysSlot = _listHybridConnectionKeysSlot; + this._listHybridConnectionsSlot = _listHybridConnectionsSlot; + this._listRelayServiceConnectionsSlot = _listRelayServiceConnectionsSlot; + this._getRelayServiceConnectionSlot = _getRelayServiceConnectionSlot; + this._createOrUpdateRelayServiceConnectionSlot = _createOrUpdateRelayServiceConnectionSlot; + this._deleteRelayServiceConnectionSlot = _deleteRelayServiceConnectionSlot; + this._updateRelayServiceConnectionSlot = _updateRelayServiceConnectionSlot; + this._listInstanceIdentifiersSlot = _listInstanceIdentifiersSlot; + this._getInstanceMsDeployStatusSlot = _getInstanceMsDeployStatusSlot; + this._createInstanceMSDeployOperationSlot = _createInstanceMSDeployOperationSlot; + this._getInstanceMSDeployLogSlot = _getInstanceMSDeployLogSlot; + this._listInstanceProcessesSlot = _listInstanceProcessesSlot; + this._getInstanceProcessSlot = _getInstanceProcessSlot; + this._deleteInstanceProcessSlot = _deleteInstanceProcessSlot; + this._getInstanceProcessDumpSlot = _getInstanceProcessDumpSlot; + this._listInstanceProcessModulesSlot = _listInstanceProcessModulesSlot; + this._getInstanceProcessModuleSlot = _getInstanceProcessModuleSlot; + this._listInstanceProcessThreadsSlot = _listInstanceProcessThreadsSlot; + this._getInstanceProcessThreadSlot = _getInstanceProcessThreadSlot; + this._isCloneableSlot = _isCloneableSlot; + this._listSyncFunctionTriggersSlot = _listSyncFunctionTriggersSlot; + this._listMetricDefinitionsSlot = _listMetricDefinitionsSlot; + this._listMetricsSlot = _listMetricsSlot; + this._getMigrateMySqlStatusSlot = _getMigrateMySqlStatusSlot; + this._listNetworkFeaturesSlot = _listNetworkFeaturesSlot; + this._startWebSiteNetworkTraceSlot = _startWebSiteNetworkTraceSlot; + this._stopWebSiteNetworkTraceSlot = _stopWebSiteNetworkTraceSlot; + this._generateNewSitePublishingPasswordSlot = _generateNewSitePublishingPasswordSlot; + this._listPerfMonCountersSlot = _listPerfMonCountersSlot; + this._getSitePhpErrorLogFlagSlot = _getSitePhpErrorLogFlagSlot; + this._listPremierAddOnsSlot = _listPremierAddOnsSlot; + this._getPremierAddOnSlot = _getPremierAddOnSlot; + this._addPremierAddOnSlot = _addPremierAddOnSlot; + this._deletePremierAddOnSlot = _deletePremierAddOnSlot; + this._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._recoverSlot = _recoverSlot; + this._resetSlotConfigurationSlot = _resetSlotConfigurationSlot; + this._restartSlot = _restartSlot; + 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._beginRecover = _beginRecover; + this._beginInstallSiteExtension = _beginInstallSiteExtension; + this._beginCreateOrUpdateSlot = _beginCreateOrUpdateSlot; + this._beginRestoreSlot = _beginRestoreSlot; + this._beginListPublishingCredentialsSlot = _beginListPublishingCredentialsSlot; + this._beginCreateMSDeployOperationSlot = _beginCreateMSDeployOperationSlot; + this._beginCreateInstanceFunctionSlot = _beginCreateInstanceFunctionSlot; + this._beginCreateInstanceMSDeployOperationSlot = _beginCreateInstanceMSDeployOperationSlot; + this._beginRecoverSlot = _beginRecoverSlot; + 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is + * skipped. + * + * @param {object} [options.customHeaders] Headers 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is + * skipped. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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 Discovers an existing app backup that can be restored from a blob + * in Azure storage. + * + * Discovers an existing app backup that can be restored from a 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 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' + * + * @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. + */ + discoverRestoreWithHttpOperationResponse(resourceGroupName, name, request, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._discoverRestore(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. + * + * Discovers an existing app backup that can be restored from a 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 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' + * + * @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. + */ + discoverRestore(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._discoverRestore(resourceGroupName, name, request, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._discoverRestore(resourceGroupName, name, request, 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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' + * + * @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' + * + * @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 {RestoreResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestoreResponse} for more information. + * + * {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 {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 {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 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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 {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 {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 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 {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 {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 {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.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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 {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 {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 {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.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 {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 {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 {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.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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 {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 {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 {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.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. + */ + getWebSiteContainerLogsZipWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getWebSiteContainerLogsZip(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. + */ + getWebSiteContainerLogsZip(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._getWebSiteContainerLogsZip(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getWebSiteContainerLogsZip(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 {string} [deployment.deploymentId] Identifier for deployment. + * + * @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 {string} [deployment.deploymentId] Identifier for deployment. + * + * @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 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.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.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {FunctionEnvelope} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionEnvelope} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createFunction(resourceGroupName, name, functionName, functionEnvelope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createFunction(resourceGroupName, name, functionName, functionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createFunction(resourceGroupName, name, functionName, functionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteFunctionWithHttpOperationResponse(resourceGroupName, name, functionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteFunction(resourceGroupName, name, functionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteFunction(resourceGroupName, name, functionName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteFunction(resourceGroupName, name, functionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteFunction(resourceGroupName, name, functionName, options, optionalCallback); + } + } + + /** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listFunctionSecretsWithHttpOperationResponse(resourceGroupName, name, functionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listFunctionSecrets(resourceGroupName, name, functionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {FunctionSecrets} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionSecrets} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listFunctionSecrets(resourceGroupName, name, functionName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listFunctionSecrets(resourceGroupName, name, functionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listFunctionSecrets(resourceGroupName, name, functionName, options, optionalCallback); + } + } + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listHostNameBindingsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHostNameBindings(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HostNameBindingCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBindingCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listHostNameBindings(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listHostNameBindings(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHostNameBindings(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getHostNameBindingWithHttpOperationResponse(resourceGroupName, name, hostName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getHostNameBinding(resourceGroupName, name, hostName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HostNameBinding} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBinding} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getHostNameBinding(resourceGroupName, name, hostName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getHostNameBinding(resourceGroupName, name, hostName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getHostNameBinding(resourceGroupName, name, hostName, options, optionalCallback); + } + } + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateHostNameBindingWithHttpOperationResponse(resourceGroupName, name, hostName, hostNameBinding, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostNameBinding, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HostNameBinding} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBinding} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostNameBinding, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostNameBinding, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostNameBinding, options, optionalCallback); + } + } + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteHostNameBindingWithHttpOperationResponse(resourceGroupName, name, hostName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteHostNameBinding(resourceGroupName, name, hostName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteHostNameBinding(resourceGroupName, name, hostName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteHostNameBinding(resourceGroupName, name, hostName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteHostNameBinding(resourceGroupName, name, hostName, options, optionalCallback); + } + } + + /** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getHybridConnectionWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, optionalCallback); + } + } + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateHybridConnectionWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteHybridConnectionWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, optionalCallback); + } + } + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateHybridConnectionWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._updateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Gets the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listHybridConnectionKeysWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HybridConnectionKey} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnectionKey} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, optionalCallback); + } + } + + /** + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listHybridConnectionsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHybridConnections(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listHybridConnections(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listHybridConnections(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHybridConnections(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listRelayServiceConnectionsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listRelayServiceConnections(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listRelayServiceConnections(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listRelayServiceConnections(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listRelayServiceConnections(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets a hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getRelayServiceConnectionWithHttpOperationResponse(resourceGroupName, name, entityName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getRelayServiceConnection(resourceGroupName, name, entityName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getRelayServiceConnection(resourceGroupName, name, entityName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getRelayServiceConnection(resourceGroupName, name, entityName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getRelayServiceConnection(resourceGroupName, name, entityName, options, optionalCallback); + } + } + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateRelayServiceConnectionWithHttpOperationResponse(resourceGroupName, name, entityName, connectionEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteRelayServiceConnectionWithHttpOperationResponse(resourceGroupName, name, entityName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteRelayServiceConnection(resourceGroupName, name, entityName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteRelayServiceConnection(resourceGroupName, name, entityName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteRelayServiceConnection(resourceGroupName, name, entityName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteRelayServiceConnection(resourceGroupName, name, entityName, options, optionalCallback); + } + } + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateRelayServiceConnectionWithHttpOperationResponse(resourceGroupName, name, entityName, connectionEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._updateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listInstanceIdentifiersWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceIdentifiers(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {WebAppInstanceCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppInstanceCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceIdentifiers(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listInstanceIdentifiers(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceIdentifiers(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceMsDeployStatusWithHttpOperationResponse(resourceGroupName, name, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MSDeployStatus} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options, optionalCallback); + } + } + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createInstanceMSDeployOperationWithHttpOperationResponse(resourceGroupName, name, instanceId, mSDeploy, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MSDeployStatus} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, optionalCallback); + } + } + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceMSDeployLogWithHttpOperationResponse(resourceGroupName, name, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MSDeployLog} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployLog} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listInstanceProcessesWithHttpOperationResponse(resourceGroupName, name, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceProcesses(resourceGroupName, name, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProcessInfoCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfoCollection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceProcesses(resourceGroupName, name, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listInstanceProcesses(resourceGroupName, name, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcesses(resourceGroupName, name, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceProcessWithHttpOperationResponse(resourceGroupName, name, processId, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcess(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProcessInfo} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfo} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcess(resourceGroupName, name, processId, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getInstanceProcess(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcess(resourceGroupName, name, processId, instanceId, options, optionalCallback); + } + } + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteInstanceProcessWithHttpOperationResponse(resourceGroupName, name, processId, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteInstanceProcess(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteInstanceProcess(resourceGroupName, name, processId, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteInstanceProcess(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteInstanceProcess(resourceGroupName, name, processId, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceProcessDumpWithHttpOperationResponse(resourceGroupName, name, processId, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcessDump(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Object} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessDump(resourceGroupName, name, processId, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getInstanceProcessDump(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcessDump(resourceGroupName, name, processId, instanceId, options, optionalCallback); + } + } + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listInstanceProcessModulesWithHttpOperationResponse(resourceGroupName, name, processId, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceProcessModules(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProcessModuleInfoCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfoCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceProcessModules(resourceGroupName, name, processId, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listInstanceProcessModules(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcessModules(resourceGroupName, name, processId, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceProcessModuleWithHttpOperationResponse(resourceGroupName, name, processId, baseAddress, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcessModule(resourceGroupName, name, processId, baseAddress, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProcessModuleInfo} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfo} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessModule(resourceGroupName, name, processId, baseAddress, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getInstanceProcessModule(resourceGroupName, name, processId, baseAddress, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcessModule(resourceGroupName, name, processId, baseAddress, instanceId, options, optionalCallback); + } + } + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listInstanceProcessThreadsWithHttpOperationResponse(resourceGroupName, name, processId, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceProcessThreads(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProcessThreadInfoCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfoCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceProcessThreads(resourceGroupName, name, processId, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listInstanceProcessThreads(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcessThreads(resourceGroupName, name, processId, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceProcessThreadWithHttpOperationResponse(resourceGroupName, name, processId, threadId, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcessThread(resourceGroupName, name, processId, threadId, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProcessThreadInfo} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfo} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessThread(resourceGroupName, name, processId, threadId, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getInstanceProcessThread(resourceGroupName, name, processId, threadId, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcessThread(resourceGroupName, name, processId, threadId, instanceId, options, optionalCallback); + } + } + + /** + * @summary Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + isCloneableWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._isCloneable(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SiteCloneability} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SiteCloneability} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + isCloneable(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._isCloneable(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._isCloneable(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listSyncFunctionTriggersWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSyncFunctionTriggers(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {FunctionSecrets} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionSecrets} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listSyncFunctionTriggers(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listSyncFunctionTriggers(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSyncFunctionTriggers(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listMetricDefinitionsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetricDefinitions(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ResourceMetricDefinitionCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricDefinitionCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listMetricDefinitions(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listMetricDefinitions(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetricDefinitions(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime + * eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listMetricsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetrics(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime + * eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ResourceMetricCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listMetrics(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listMetrics(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetrics(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Restores a web app. + * + * Restores a web app. + * + * @param {string} subscriptionName Azure subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationOptions Migration migrationOptions. + * + * @param {string} migrationOptions.azurefilesConnectionString AzureFiles + * connection string. + * + * @param {string} migrationOptions.azurefilesShare AzureFiles share. + * + * @param {boolean} [migrationOptions.switchSiteAfterMigration] + * trueif the app should be switched over; otherwise, + * false. + * + * @param {boolean} [migrationOptions.blockWriteAccessToSite] true + * if the app should be read only during copy operation; otherwise, + * false. + * + * @param {string} [migrationOptions.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + migrateStorageWithHttpOperationResponse(subscriptionName, resourceGroupName, name, migrationOptions, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._migrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Restores a web app. + * + * Restores a web app. + * + * @param {string} subscriptionName Azure subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationOptions Migration migrationOptions. + * + * @param {string} migrationOptions.azurefilesConnectionString AzureFiles + * connection string. + * + * @param {string} migrationOptions.azurefilesShare AzureFiles share. + * + * @param {boolean} [migrationOptions.switchSiteAfterMigration] + * trueif the app should be switched over; otherwise, + * false. + * + * @param {boolean} [migrationOptions.blockWriteAccessToSite] true + * if the app should be read only during copy operation; otherwise, + * false. + * + * @param {string} [migrationOptions.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {StorageMigrationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link StorageMigrationResponse} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + migrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._migrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._migrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, optionalCallback); + } + } + + /** + * @summary Migrates a local (in-app) MySql database to a remote MySql + * database. + * + * Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationRequestEnvelope MySql migration options. + * + * @param {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. + * + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' + * + * @param {string} [migrationRequestEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + migrateMySqlWithHttpOperationResponse(resourceGroupName, name, migrationRequestEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._migrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Migrates a local (in-app) MySql database to a remote MySql + * database. + * + * Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationRequestEnvelope MySql migration options. + * + * @param {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. + * + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' + * + * @param {string} [migrationRequestEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Operation} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Operation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + migrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._migrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._migrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, optionalCallback); + } + } + + /** + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getMigrateMySqlStatusWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getMigrateMySqlStatus(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MigrateMySqlStatus} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MigrateMySqlStatus} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getMigrateMySqlStatus(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getMigrateMySqlStatus(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getMigrateMySqlStatus(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNetworkFeaturesWithHttpOperationResponse(resourceGroupName, name, view, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNetworkFeatures(resourceGroupName, name, view, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {NetworkFeatures} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkFeatures} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNetworkFeatures(resourceGroupName, name, view, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNetworkFeatures(resourceGroupName, name, view, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNetworkFeatures(resourceGroupName, name, view, options, optionalCallback); + } + } + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + startWebSiteNetworkTraceWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._startWebSiteNetworkTrace(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {String} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + startWebSiteNetworkTrace(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._startWebSiteNetworkTrace(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._startWebSiteNetworkTrace(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + stopWebSiteNetworkTraceWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._stopWebSiteNetworkTrace(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {String} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + stopWebSiteNetworkTrace(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._stopWebSiteNetworkTrace(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._stopWebSiteNetworkTrace(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + generateNewSitePublishingPasswordWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._generateNewSitePublishingPassword(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + generateNewSitePublishingPassword(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._generateNewSitePublishingPassword(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._generateNewSitePublishingPassword(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain + * eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listPerfMonCountersWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPerfMonCounters(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain + * eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PerfMonCounterCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PerfMonCounterCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listPerfMonCounters(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listPerfMonCounters(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPerfMonCounters(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getSitePhpErrorLogFlagWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSitePhpErrorLogFlag(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SitePhpErrorLogFlag} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SitePhpErrorLogFlag} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getSitePhpErrorLogFlag(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getSitePhpErrorLogFlag(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSitePhpErrorLogFlag(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listPremierAddOnsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPremierAddOns(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PremierAddOn} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listPremierAddOns(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listPremierAddOns(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPremierAddOns(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets a named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getPremierAddOnWithHttpOperationResponse(resourceGroupName, name, premierAddOnName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getPremierAddOn(resourceGroupName, name, premierAddOnName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PremierAddOn} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getPremierAddOn(resourceGroupName, name, premierAddOnName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getPremierAddOn(resourceGroupName, name, premierAddOnName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getPremierAddOn(resourceGroupName, name, premierAddOnName, options, optionalCallback); + } + } + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. + * + * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. + * + * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. + * + * @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.premierAddOnName] Premier add on Name. + * + * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. + * + * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. + * + * @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 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} [options] Optional Parameters. + * + * @param {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {object} [options.customHeaders] Headers 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, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPublishingProfileXmlWithSecrets(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 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} [options] Optional Parameters. + * + * @param {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, options, optionalCallback) { + 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, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPublishingProfileXmlWithSecrets(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + recoverWithHttpOperationResponse(resourceGroupName, name, recoveryEntity, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._recover(resourceGroupName, name, recoveryEntity, 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 a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. + */ + recover(resourceGroupName, name, recoveryEntity, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._recover(resourceGroupName, name, recoveryEntity, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._recover(resourceGroupName, name, recoveryEntity, 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 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is + * skipped. + * + * @param {object} [options.customHeaders] Headers 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is + * skipped. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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 Discovers an existing app backup that can be restored from a blob + * in Azure storage. + * + * Discovers an existing app backup that can be restored from a 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 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' + * + * @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. + */ + discoverRestoreSlotWithHttpOperationResponse(resourceGroupName, name, request, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._discoverRestoreSlot(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. + * + * Discovers an existing app backup that can be restored from a 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 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' + * + * @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. + */ + discoverRestoreSlot(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._discoverRestoreSlot(resourceGroupName, name, request, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._discoverRestoreSlot(resourceGroupName, name, request, 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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' + * + * @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' + * + * @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 {RestoreResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestoreResponse} for more information. + * + * {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 {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 {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 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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 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 {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 {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 {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.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 {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 {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 {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.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 {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 {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 {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.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 {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 {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 {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.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. + */ + getWebSiteContainerLogsZipSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getWebSiteContainerLogsZipSlot(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. + */ + getWebSiteContainerLogsZipSlot(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._getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getWebSiteContainerLogsZipSlot(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 {string} [deployment.deploymentId] Identifier for deployment. + * + * @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 {string} [deployment.deploymentId] Identifier for deployment. + * + * @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 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.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.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {FunctionEnvelope} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionEnvelope} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createInstanceFunctionSlot(resourceGroupName, name, functionName, slot, functionEnvelope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createInstanceFunctionSlot(resourceGroupName, name, functionName, slot, functionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createInstanceFunctionSlot(resourceGroupName, name, functionName, slot, functionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteInstanceFunctionSlotWithHttpOperationResponse(resourceGroupName, name, functionName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, optionalCallback); + } + } + + /** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listFunctionSecretsSlotWithHttpOperationResponse(resourceGroupName, name, functionName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {FunctionSecrets} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionSecrets} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, options, optionalCallback); + } + } + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets hostname bindings for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listHostNameBindingsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHostNameBindingsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets hostname bindings for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HostNameBindingCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBindingCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listHostNameBindingsSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listHostNameBindingsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHostNameBindingsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API the named binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getHostNameBindingSlotWithHttpOperationResponse(resourceGroupName, name, slot, hostName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API the named binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HostNameBinding} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBinding} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, optionalCallback); + } + } + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create a binding for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateHostNameBindingSlotWithHttpOperationResponse(resourceGroupName, name, hostName, hostNameBinding, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, hostNameBinding, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create a binding for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HostNameBinding} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBinding} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, hostNameBinding, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, hostNameBinding, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, hostNameBinding, slot, options, optionalCallback); + } + } + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteHostNameBindingSlotWithHttpOperationResponse(resourceGroupName, name, slot, hostName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, optionalCallback); + } + } + + /** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getHybridConnectionSlotWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, optionalCallback); + } + } + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateHybridConnectionSlotWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, optionalCallback); + } + } + + /** + * @summary Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteHybridConnectionSlotWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, optionalCallback); + } + } + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateHybridConnectionSlotWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._updateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, optionalCallback); + } + } + + /** + * @summary Gets the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listHybridConnectionKeysSlotWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, relayName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HybridConnectionKey} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnectionKey} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, relayName, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, relayName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, relayName, slot, options, optionalCallback); + } + } + + /** + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listHybridConnectionsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHybridConnectionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listHybridConnectionsSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listHybridConnectionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHybridConnectionsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get hybrid connections for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listRelayServiceConnectionsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get hybrid connections for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets a hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a hybrid connection for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName, name, entityName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a hybrid connection for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, optionalCallback); + } + } + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName, name, entityName, connectionEnvelope, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, optionalCallback); + } + } + + /** + * @summary Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete a hybrid connection for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName, name, entityName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete a hybrid connection for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, optionalCallback); + } + } + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName, name, entityName, connectionEnvelope, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, optionalCallback); + } + } + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets the production slot instances. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listInstanceIdentifiersSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets the production slot instances. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {WebAppInstanceCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppInstanceCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceMsDeployStatusSlotWithHttpOperationResponse(resourceGroupName, name, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MSDeployStatus} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createInstanceMSDeployOperationSlotWithHttpOperationResponse(resourceGroupName, name, slot, instanceId, mSDeploy, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MSDeployStatus} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, options, optionalCallback); + } + } + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceMSDeployLogSlotWithHttpOperationResponse(resourceGroupName, name, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MSDeployLog} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployLog} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listInstanceProcessesSlotWithHttpOperationResponse(resourceGroupName, name, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProcessInfoCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfoCollection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceProcessSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProcessInfo} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfo} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteInstanceProcessSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceProcessDumpSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Object} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listInstanceProcessModulesSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProcessModuleInfoCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfoCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceProcessModuleSlotWithHttpOperationResponse(resourceGroupName, name, processId, baseAddress, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProcessModuleInfo} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfo} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listInstanceProcessThreadsSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProcessThreadInfoCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfoCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceProcessThreadSlotWithHttpOperationResponse(resourceGroupName, name, processId, threadId, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProcessThreadInfo} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfo} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. By default, this API + * returns information on the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + isCloneableSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._isCloneableSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. By default, this API + * returns information on the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SiteCloneability} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SiteCloneability} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + isCloneableSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._isCloneableSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._isCloneableSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listSyncFunctionTriggersSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {FunctionSecrets} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionSecrets} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metric definitions of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listMetricDefinitionsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetricDefinitionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metric definitions of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ResourceMetricDefinitionCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricDefinitionCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listMetricDefinitionsSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listMetricDefinitionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetricDefinitionsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metrics of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime + * eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listMetricsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetricsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metrics of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime + * eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ResourceMetricCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listMetricsSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listMetricsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetricsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of the deployment slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getMigrateMySqlStatusSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of the deployment slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MigrateMySqlStatus} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MigrateMySqlStatus} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get network features for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNetworkFeaturesSlotWithHttpOperationResponse(resourceGroupName, name, view, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get network features for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {NetworkFeatures} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkFeatures} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, optionalCallback); + } + } + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + startWebSiteNetworkTraceSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {String} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + stopWebSiteNetworkTraceSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {String} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API generate a new publishing password for the production + * slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + generateNewSitePublishingPasswordSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API generate a new publishing password for the production + * slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain + * eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listPerfMonCountersSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPerfMonCountersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain + * eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PerfMonCounterCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PerfMonCounterCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listPerfMonCountersSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listPerfMonCountersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPerfMonCountersSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getSitePhpErrorLogFlagSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SitePhpErrorLogFlag} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SitePhpErrorLogFlag} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the premier add-ons for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listPremierAddOnsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPremierAddOnsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the premier add-ons for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PremierAddOn} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listPremierAddOnsSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listPremierAddOnsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPremierAddOnsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets a named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the named add-on for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getPremierAddOnSlotWithHttpOperationResponse(resourceGroupName, name, premierAddOnName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the named add-on for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PremierAddOn} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, optionalCallback); + } + } + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. + * + * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. + * + * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. + * + * @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.premierAddOnName] Premier add on Name. + * + * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. + * + * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. + * + * @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 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 {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 {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {object} [options.customHeaders] Headers 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, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPublishingProfileXmlWithSecretsSlot(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 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 {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 {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, slot, options, optionalCallback) { + 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, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. + */ + recoverSlotWithHttpOperationResponse(resourceGroupName, name, recoveryEntity, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._recoverSlot(resourceGroupName, name, recoveryEntity, slot, 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 a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. + */ + recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._recoverSlot(resourceGroupName, name, recoveryEntity, 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 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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' + * + * @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' + * + * @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 {RestoreResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestoreResponse} for more information. + * + * {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.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.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 Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginRecoverWithHttpOperationResponse(resourceGroupName, name, recoveryEntity, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRecover(resourceGroupName, name, recoveryEntity, 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 a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. + */ + beginRecover(resourceGroupName, name, recoveryEntity, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginRecover(resourceGroupName, name, recoveryEntity, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRecover(resourceGroupName, name, recoveryEntity, 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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' + * + * @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' + * + * @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 {RestoreResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestoreResponse} for more information. + * + * {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.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.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 Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. + */ + beginRecoverSlotWithHttpOperationResponse(resourceGroupName, name, recoveryEntity, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, 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 a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. + */ + beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRecoverSlot(resourceGroupName, name, recoveryEntity, 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/lib/webSiteManagementClient.d.ts b/lib/services/websiteManagement2/lib/lib/webSiteManagementClient.d.ts new file mode 100644 index 0000000000..0016cb7d6d --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/webSiteManagementClient.d.ts @@ -0,0 +1,1381 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * 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] - 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. + * + */ + constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); + + credentials: ServiceClientCredentials; + + subscriptionId: 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; + resourceHealthMetadataOperations: operations.ResourceHealthMetadataOperations; + billingMeters: operations.BillingMeters; + webApps: operations.WebApps; + appServiceEnvironments: operations.AppServiceEnvironments; + appServicePlans: operations.AppServicePlans; + + + /** + * @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.userName] Username + * + * @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.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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.userName] Username + * + * @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.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.sourceControlName] Name or source control + * type. + * + * @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.sourceControlName] Name or source control + * type. + * + * @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 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', + * 'PremiumV2', 'Dynamic', 'Isolated' + * + * @param {boolean} [options.linuxWorkersEnabled] Specify true if + * you want to filter to only regions that support Linux 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, 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', + * 'PremiumV2', 'Dynamic', 'Isolated' + * + * @param {boolean} [options.linuxWorkersEnabled] Specify true if + * you want to filter to only regions that support Linux 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, customHeaders? : { [headerName: string]: string; } }): Promise; + listGeoRegions(callback: ServiceCallback): void; + listGeoRegions(options: { sku? : string, linuxWorkersEnabled? : 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 {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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 {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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 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/lib/webSiteManagementClient.js b/lib/services/websiteManagement2/lib/lib/webSiteManagementClient.js new file mode 100644 index 0000000000..beb4798477 --- /dev/null +++ b/lib/services/websiteManagement2/lib/lib/webSiteManagementClient.js @@ -0,0 +1,4748 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * 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.'); + } + let apiVersion = '2016-03-01'; + // Validate + try { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.userName] Username + * + * @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.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.'); + } + let apiVersion = '2016-03-01'; + // Validate + try { + if (userDetails === null || userDetails === undefined) { + throw new Error('userDetails 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.Web/publishingUsers/web'; + 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.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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-01'; + // Validate + try { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-03-01'; + // 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.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.sourceControlName] Name or source control + * type. + * + * @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.'); + } + let apiVersion = '2016-03-01'; + // 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.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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 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; + let apiVersion = '2016-03-01'; + // 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 (name === 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-01'; + // 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.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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', + * 'PremiumV2', 'Dynamic', 'Isolated' + * + * @param {boolean} [options.linuxWorkersEnabled] Specify true if + * you want to filter to only regions that support Linux 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 apiVersion = '2016-03-01'; + // 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 (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.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())); + } + 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.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['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; + let apiVersion = '2016-03-01'; + // 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 (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-01'; + // 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.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-03-01'; + // 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.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-03-01'; + // 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.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} 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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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] - 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. + */ + 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.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.resourceHealthMetadataOperations = new operations.ResourceHealthMetadataOperations(this); + this.billingMeters = new operations.BillingMeters(this); + this.webApps = new operations.WebApps(this); + this.appServiceEnvironments = new operations.AppServiceEnvironments(this); + this.appServicePlans = new operations.AppServicePlans(this); + this.models = models; + this._getPublishingUser = _getPublishingUser; + this._updatePublishingUser = _updatePublishingUser; + this._listSourceControls = _listSourceControls; + this._getSourceControl = _getSourceControl; + this._updateSourceControl = _updateSourceControl; + 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._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.userName] Username + * + * @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.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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.userName] Username + * + * @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.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.sourceControlName] Name or source control + * type. + * + * @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.sourceControlName] Name or source control + * type. + * + * @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 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', + * 'PremiumV2', 'Dynamic', 'Isolated' + * + * @param {boolean} [options.linuxWorkersEnabled] Specify true if + * you want to filter to only regions that support Linux 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', + * 'PremiumV2', 'Dynamic', 'Isolated' + * + * @param {boolean} [options.linuxWorkersEnabled] Specify true if + * you want to filter to only regions that support Linux 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 {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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 {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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 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/lib/models/abnormalTimePeriod.js b/lib/services/websiteManagement2/lib/models/abnormalTimePeriod.js new file mode 100644 index 0000000000..2a371f061c --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/abnormalTimePeriod.js @@ -0,0 +1,94 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const models = require('./index'); + +/** + * Class representing 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..e8d64bc744 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/addressResponse.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'); + +/** + * 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..244cbfcee4 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/analysisData.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'); + +/** + * 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..af47066e3f --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/appServiceEnvironment.js @@ -0,0 +1,444 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 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 + */ + 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' + } + } + } + } + } + } + }; + } +} + +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..990549c0b2 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/appServiceEnvironmentPatchResource.js @@ -0,0 +1,478 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 + */ + 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' + } + } + } + } + } + } + }; + } +} + +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..458a7a0309 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/appServiceEnvironmentResource.js @@ -0,0 +1,499 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 + */ + 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' + } + } + } + } + } + } + }; + } +} + +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..b8ecc0f0b9 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/appServicePlan.js @@ -0,0 +1,296 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} appServicePlanName Name for the App Service plan. + * @member {string} [workerTierName] Target worker tier assigned to the App + * Service plan. + * @member {string} [status] App Service plan status. Possible values + * include: 'Ready', 'Pending', 'Creating' + * @member {string} [subscription] App Service plan subscription. + * @member {string} [adminSiteName] App Service plan administration site. + * @member {object} [hostingEnvironmentProfile] Specification for the App + * Service Environment to use for the App Service plan. + * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App + * Service Environment. + * @member {string} [hostingEnvironmentProfile.name] Name of the App Service + * Environment. + * @member {string} [hostingEnvironmentProfile.type] Resource type of the App + * Service Environment. + * @member {number} [maximumNumberOfWorkers] Maximum number of instances that + * can be assigned to this App Service plan. + * @member {string} [geoRegion] Geographical location for the App Service + * plan. + * @member {boolean} [perSiteScaling] If true, apps assigned to + * this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale + * to all instances of the plan. Default value: false . + * @member {number} [numberOfSites] Number of apps assigned to this App + * Service plan. + * @member {boolean} [isSpot] If true, this App Service Plan + * owns spot instances. + * @member {date} [spotExpirationTime] The time when the server farm expires. + * Valid only if it is a spot server farm. + * @member {string} [resourceGroup] Resource group of the App Service plan. + * @member {boolean} [reserved] If Linux 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' + } + } + } + }, + appServicePlanName: { + required: true, + serializedName: 'properties.name', + type: { + name: 'String' + } + }, + workerTierName: { + required: false, + serializedName: 'properties.workerTierName', + type: { + name: 'String' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'properties.status', + type: { + name: 'Enum', + allowedValues: [ 'Ready', 'Pending', 'Creating' ] + } + }, + subscription: { + required: false, + readOnly: true, + serializedName: 'properties.subscription', + type: { + name: 'String' + } + }, + adminSiteName: { + required: false, + serializedName: 'properties.adminSiteName', + type: { + name: 'String' + } + }, + hostingEnvironmentProfile: { + required: false, + serializedName: 'properties.hostingEnvironmentProfile', + type: { + name: 'Composite', + className: 'HostingEnvironmentProfile' + } + }, + maximumNumberOfWorkers: { + required: false, + readOnly: true, + serializedName: 'properties.maximumNumberOfWorkers', + type: { + name: 'Number' + } + }, + geoRegion: { + required: false, + readOnly: true, + serializedName: 'properties.geoRegion', + type: { + name: 'String' + } + }, + perSiteScaling: { + required: false, + serializedName: 'properties.perSiteScaling', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + numberOfSites: { + required: false, + readOnly: true, + serializedName: 'properties.numberOfSites', + type: { + name: 'Number' + } + }, + isSpot: { + required: false, + serializedName: 'properties.isSpot', + type: { + name: 'Boolean' + } + }, + spotExpirationTime: { + required: false, + serializedName: 'properties.spotExpirationTime', + type: { + name: 'DateTime' + } + }, + resourceGroup: { + required: false, + readOnly: true, + serializedName: 'properties.resourceGroup', + type: { + name: 'String' + } + }, + reserved: { + required: false, + serializedName: 'properties.reserved', + 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..620bda3ea5 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/appServicePlanCollection.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 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, + 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..e08905aeec --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/appServicePlanPatchResource.js @@ -0,0 +1,248 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} appServicePlanPatchResourceName Name for the App Service + * plan. + * @member {string} [workerTierName] Target worker tier assigned to the App + * Service plan. + * @member {string} [status] App Service plan status. Possible values + * include: 'Ready', 'Pending', 'Creating' + * @member {string} [subscription] App Service plan subscription. + * @member {string} [adminSiteName] App Service plan administration site. + * @member {object} [hostingEnvironmentProfile] Specification for the App + * Service Environment to use for the App Service plan. + * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App + * Service Environment. + * @member {string} [hostingEnvironmentProfile.name] Name of the App Service + * Environment. + * @member {string} [hostingEnvironmentProfile.type] Resource type of the App + * Service Environment. + * @member {number} [maximumNumberOfWorkers] Maximum number of instances that + * can be assigned to this App Service plan. + * @member {string} [geoRegion] Geographical location for the App Service + * plan. + * @member {boolean} [perSiteScaling] If true, apps assigned to + * this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale + * to all instances of the plan. Default value: false . + * @member {number} [numberOfSites] Number of apps assigned to this App + * Service plan. + * @member {boolean} [isSpot] If true, this App Service Plan + * owns spot instances. + * @member {date} [spotExpirationTime] The time when the server farm expires. + * Valid only if it is a spot server farm. + * @member {string} [resourceGroup] Resource group of the App Service plan. + * @member {boolean} [reserved] If Linux 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' + } + }, + appServicePlanPatchResourceName: { + required: true, + serializedName: 'properties.name', + type: { + name: 'String' + } + }, + workerTierName: { + required: false, + serializedName: 'properties.workerTierName', + type: { + name: 'String' + } + }, + status: { + required: false, + readOnly: true, + serializedName: 'properties.status', + type: { + name: 'Enum', + allowedValues: [ 'Ready', 'Pending', 'Creating' ] + } + }, + subscription: { + required: false, + readOnly: true, + serializedName: 'properties.subscription', + type: { + name: 'String' + } + }, + adminSiteName: { + required: false, + serializedName: 'properties.adminSiteName', + type: { + name: 'String' + } + }, + hostingEnvironmentProfile: { + required: false, + serializedName: 'properties.hostingEnvironmentProfile', + type: { + name: 'Composite', + className: 'HostingEnvironmentProfile' + } + }, + maximumNumberOfWorkers: { + required: false, + readOnly: true, + serializedName: 'properties.maximumNumberOfWorkers', + type: { + name: 'Number' + } + }, + geoRegion: { + required: false, + readOnly: true, + serializedName: 'properties.geoRegion', + type: { + name: 'String' + } + }, + perSiteScaling: { + required: false, + serializedName: 'properties.perSiteScaling', + defaultValue: false, + type: { + name: 'Boolean' + } + }, + numberOfSites: { + required: false, + readOnly: true, + serializedName: 'properties.numberOfSites', + type: { + name: 'Number' + } + }, + isSpot: { + required: false, + serializedName: 'properties.isSpot', + type: { + name: 'Boolean' + } + }, + spotExpirationTime: { + required: false, + serializedName: 'properties.spotExpirationTime', + type: { + name: 'DateTime' + } + }, + resourceGroup: { + required: false, + readOnly: true, + serializedName: 'properties.resourceGroup', + type: { + name: 'String' + } + }, + reserved: { + required: false, + serializedName: 'properties.reserved', + 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..f807ba5142 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/applicationLogsConfig.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'; + +const models = require('./index'); + +/** + * 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..0a52694422 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/applicationStack.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'; + +const models = require('./index'); + +/** + * 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..c88cabffef --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/autoHealActions.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'); + +/** + * 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..345b953e39 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/autoHealRules.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'; + +const models = require('./index'); + +/** + * 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..7d60dca06e --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/autoHealTriggers.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'; + +const models = require('./index'); + +/** + * 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/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..dba65bf110 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/backupRequest.js @@ -0,0 +1,157 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} backupRequestName 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. + * @member {string} [backupRequestType] Type of the backup. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + */ + 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' + } + }, + backupRequestName: { + required: true, + serializedName: 'properties.name', + 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' + } + } + } + }, + backupRequestType: { + required: false, + serializedName: 'properties.type', + type: { + name: 'Enum', + allowedValues: [ 'Default', 'Clone', 'Relocation', 'Snapshot' ] + } + } + } + } + }; + } +} + +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..0a4e321786 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/billingMeter.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'; + +/** + * Billing meter. + * + */ +class BillingMeter { + /** + * Create a BillingMeter. + * @member {string} [meterId] Meter GUID onboarded in Commerce + * @member {string} [billingLocation] CSM Location + * @member {string} [shortName] Short Name from Azure pricing Page + * @member {string} [friendlyName] Meter Resource Name + * @member {string} [resourceType] ResourceType meter used for + */ + constructor() { + } + + /** + * Defines the metadata of BillingMeter + * + * @returns {object} metadata of BillingMeter + * + */ + mapper() { + return { + required: false, + serializedName: 'BillingMeter', + type: { + name: 'Composite', + className: 'BillingMeter', + modelProperties: { + meterId: { + required: false, + serializedName: 'meterId', + type: { + name: 'String' + } + }, + billingLocation: { + required: false, + serializedName: 'billingLocation', + type: { + name: 'String' + } + }, + shortName: { + required: false, + serializedName: 'shortName', + type: { + name: 'String' + } + }, + friendlyName: { + required: false, + serializedName: 'friendlyName', + type: { + name: 'String' + } + }, + resourceType: { + required: false, + serializedName: 'resourceType', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BillingMeter; 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..200bd1eaf4 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/certificate.js @@ -0,0 +1,297 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} [geoRegion] Region of the certificate. + * @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' ] + } + }, + geoRegion: { + required: false, + readOnly: true, + serializedName: 'properties.geoRegion', + type: { + name: 'String' + } + }, + 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..fc3635e0c7 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/certificateOrderAction.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'; + +const models = require('./index'); + +/** + * Certificate order action. + * + * @extends models['ProxyOnlyResource'] + */ +class CertificateOrderAction extends models['ProxyOnlyResource'] { + /** + * Create a CertificateOrderAction. + * @member {string} [certificateOrderActionType] 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' + } + }, + certificateOrderActionType: { + required: false, + serializedName: 'properties.type', + type: { + name: 'Enum', + allowedValues: [ 'CertificateIssued', 'CertificateOrderCanceled', 'CertificateOrderCreated', 'CertificateRevoked', 'DomainValidationComplete', 'FraudDetected', 'OrgNameChange', 'OrgValidationComplete', 'SanDrop', 'FraudCleared', 'CertificateExpired', 'CertificateExpirationWarning', 'FraudDocumentationRequired', 'Unknown' ] + } + }, + createdAt: { + required: false, + 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..e68d49ee1a --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/certificatePatchResource.js @@ -0,0 +1,276 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} [geoRegion] Region of the certificate. + * @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' ] + } + }, + geoRegion: { + required: false, + readOnly: true, + serializedName: 'properties.geoRegion', + type: { + name: 'String' + } + }, + 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..868a356c16 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/cloningInfo.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'; + +/** + * 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. + * @member {boolean} [ignoreQuotas] true if quotas should be + * ignored; otherwise, false. + */ + 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' + } + }, + ignoreQuotas: { + required: false, + serializedName: 'ignoreQuotas', + type: { + name: 'Boolean' + } + } + } + } + }; + } +} + +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..c2d29b5130 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/contact.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'); + +/** + * 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..ffba08bca7 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/continuousWebJob.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'; + +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} [continuousWebJobName] Job name. Used as job identifier + * in ARM resource URI. + * @member {string} [runCommand] Run command. + * @member {string} [url] Job URL. + * @member {string} [extraInfoUrl] Extra Info URL. + * @member {string} [jobType] 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.detailedStatus', + type: { + name: 'String' + } + }, + logUrl: { + required: false, + serializedName: 'properties.logUrl', + type: { + name: 'String' + } + }, + continuousWebJobName: { + required: false, + readOnly: true, + serializedName: 'properties.name', + type: { + name: 'String' + } + }, + runCommand: { + required: false, + serializedName: 'properties.runCommand', + type: { + name: 'String' + } + }, + url: { + required: false, + serializedName: 'properties.url', + type: { + name: 'String' + } + }, + extraInfoUrl: { + required: false, + serializedName: 'properties.extraInfoUrl', + type: { + name: 'String' + } + }, + jobType: { + required: false, + serializedName: 'properties.jobType', + type: { + name: 'Enum', + allowedValues: [ 'Continuous', 'Triggered' ] + } + }, + error: { + required: false, + serializedName: 'properties.error', + type: { + name: 'String' + } + }, + usingSdk: { + required: false, + serializedName: 'properties.usingSdk', + 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..99a440181a --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/continuousWebJobCollection.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 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, + 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..9375a0b953 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/csmOperationDescription.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'; + +const models = require('./index'); + +/** + * 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] + */ + 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..77631076bc --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/csmOperationDescriptionProperties.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'); + +/** + * Properties available for a Microsoft.Web resource provider operation. + * + */ +class CsmOperationDescriptionProperties { + /** + * Create a CsmOperationDescriptionProperties. + * @member {object} [serviceSpecification] + * @member {array} [serviceSpecification.metricSpecifications] + */ + 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..1311235ff5 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/csmPublishingProfileOptions.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'; + +/** + * 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' + */ + 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' + } + } + } + } + }; + } +} + +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..9d8687b3bc --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/csmUsageQuota.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'; + +const models = require('./index'); + +/** + * 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..1e4d2a6438 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/dataSource.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 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/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..7626a48a16 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/defaultErrorResponse.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'; + +const models = require('./index'); + +/** + * 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..678b354c64 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/defaultErrorResponseError.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'); + +/** + * 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: true, + readOnly: true, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: true, + 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..f5f3609ef2 --- /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: true, + readOnly: true, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: true, + 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/deletedSite.js b/lib/services/websiteManagement2/lib/models/deletedSite.js new file mode 100644 index 0000000000..265245476b --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/deletedSite.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'; + +/** + * A deleted app. + * + */ +class DeletedSite { + /** + * Create a DeletedSite. + * @member {number} [id] 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} [name] Name of the deleted site + * @member {string} [slot] Slot of the deleted site + */ + constructor() { + } + + /** + * 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, + serializedName: 'id', + type: { + name: 'Number' + } + }, + deletedTimestamp: { + required: false, + readOnly: true, + serializedName: 'deletedTimestamp', + type: { + name: 'String' + } + }, + subscription: { + required: false, + readOnly: true, + serializedName: 'subscription', + type: { + name: 'String' + } + }, + resourceGroup: { + required: false, + readOnly: true, + serializedName: 'resourceGroup', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + slot: { + required: false, + readOnly: true, + serializedName: 'slot', + 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..052aab349d --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/deployment.js @@ -0,0 +1,160 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 {string} [deploymentId] Identifier for 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' + } + }, + deploymentId: { + required: false, + serializedName: 'properties.id', + 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.authorEmail', + type: { + name: 'String' + } + }, + startTime: { + required: false, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + serializedName: 'properties.endTime', + 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..ad15f8aec8 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/deploymentLocations.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'); + +/** + * 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..4d97fd6c60 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/detectorAbnormalTimePeriod.js @@ -0,0 +1,137 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 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/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/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..dec74d0fc2 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/diagnosticMetricSet.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'); + +/** + * 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..7fe76aef2e --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/errorEntity.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'); + +/** + * 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/errorResponse.js b/lib/services/websiteManagement2/lib/models/errorResponse.js new file mode 100644 index 0000000000..32e994231a --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/errorResponse.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'; + +/** + * Error Response. + * + */ +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, + serializedName: 'code', + type: { + name: 'String' + } + }, + message: { + required: false, + serializedName: 'message', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = ErrorResponse; diff --git a/lib/services/websiteManagement2/lib/models/experiments.js b/lib/services/websiteManagement2/lib/models/experiments.js new file mode 100644 index 0000000000..cf40478e30 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/experiments.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'; + +const models = require('./index'); + +/** + * 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..d7389e080d --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/functionEnvelope.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'); + +/** + * Web Job Information. + * + * @extends models['ProxyOnlyResource'] + */ +class FunctionEnvelope extends models['ProxyOnlyResource'] { + /** + * Create a FunctionEnvelope. + * @member {string} [functionEnvelopeName] Function name. + * @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' + } + }, + functionEnvelopeName: { + required: false, + readOnly: true, + serializedName: 'properties.name', + type: { + name: 'String' + } + }, + functionAppId: { + required: false, + readOnly: true, + serializedName: 'properties.functionAppId', + type: { + name: 'String' + } + }, + scriptRootPathHref: { + required: false, + serializedName: 'properties.scriptRootPathHref', + type: { + name: 'String' + } + }, + scriptHref: { + required: false, + serializedName: 'properties.scriptHref', + type: { + name: 'String' + } + }, + configHref: { + required: false, + serializedName: 'properties.configHref', + type: { + name: 'String' + } + }, + secretsFileHref: { + required: false, + serializedName: 'properties.secretsFileHref', + 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.testData', + 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..6c33bce188 --- /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.triggerUrl', + 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..bf004ffc2e --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/geoRegion.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'); + +/** + * Geographical region. + * + * @extends models['ProxyOnlyResource'] + */ +class GeoRegion extends models['ProxyOnlyResource'] { + /** + * Create a GeoRegion. + * @member {string} [geoRegionName] Region name. + * @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' + } + }, + geoRegionName: { + required: false, + readOnly: true, + serializedName: 'properties.name', + 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..4e36a7f290 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/globalCsmSkuDescription.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'); + +/** + * 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..b517c55838 --- /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} [arguments] 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' + } + }, + arguments: { + 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..2636ecd1ff --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/httpLogsConfig.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'; + +const models = require('./index'); + +/** + * 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..ba97df93da --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/index.d.ts @@ -0,0 +1,7271 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * 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} [certificateOrderActionType] 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 { + certificateOrderActionType?: string; + 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} [vnetRouteName] The name of this route. This is only + * returned by the server and does not need to be set by the client. + * @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 { + vnetRouteName?: string; + 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} [userName] Username + * @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. + */ +export interface User extends ProxyOnlyResource { + userName?: string; + publishingUserName: string; + publishingPassword?: string; + publishingPasswordHash?: string; + publishingPasswordHashSalt?: string; +} + +/** + * @class + * Initializes a new instance of the SnapshotRecoveryTarget class. + * @constructor + * Specifies the web app that snapshot contents will be written to. + * + * @member {string} [location] Geographical location of the target web app, + * e.g. SouthEastAsia, SouthCentralUS + * @member {string} [id] ARM resource ID of the target 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 SnapshotRecoveryTarget { + location?: string; + id?: string; +} + +/** + * @class + * Initializes a new instance of the SnapshotRecoveryRequest class. + * @constructor + * Details about app recovery operation. + * + * @member {string} [snapshotTime] Point in time in which the app recovery + * should be attempted, formatted as a DateTime string. + * @member {object} [recoveryTarget] Specifies the web app that snapshot + * contents will be written to. + * @member {string} [recoveryTarget.location] Geographical location of the + * target web app, e.g. SouthEastAsia, SouthCentralUS + * @member {string} [recoveryTarget.id] ARM resource ID of the target 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 recovery 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 SnapshotRecoveryRequest extends ProxyOnlyResource { + snapshotTime?: string; + recoveryTarget?: SnapshotRecoveryTarget; + overwrite: boolean; + recoverConfiguration?: boolean; + ignoreConflictingHostNames?: boolean; +} + +/** + * @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 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 ResourceMetricDefinition class. + * @constructor + * Metadata for the metrics. + * + * @member {object} [resourceMetricDefinitionName] Name of the metric. + * @member {string} [resourceMetricDefinitionName.value] metric name value. + * @member {string} [resourceMetricDefinitionName.localizedValue] Localized + * metric name value. + * @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 {string} [resourceMetricDefinitionId] Resource ID. + * @member {object} [properties] Resource metric definition properties. + */ +export interface ResourceMetricDefinition extends ProxyOnlyResource { + readonly resourceMetricDefinitionName?: ResourceMetricName; + readonly unit?: string; + readonly primaryAggregationType?: string; + readonly metricAvailabilities?: ResourceMetricAvailability[]; + readonly resourceUri?: string; + readonly resourceMetricDefinitionId?: 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 ManagedServiceIdentity class. + * @constructor + * Managed service identity. + * + * @member {string} [type] Type of managed service identity. Possible values + * include: 'SystemAssigned' + * @member {string} [tenantId] Tenant of managed service identity. + * @member {string} [principalId] Principal Id of managed service identity. + */ +export interface ManagedServiceIdentity { + type?: string; + readonly tenantId?: string; + readonly principalId?: 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. + * @member {boolean} [ignoreQuotas] true if quotas should be + * ignored; otherwise, false. + */ +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; + ignoreQuotas?: boolean; +} + +/** + * @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. + * @member {string} [subnetMask] Subnet mask for the range of IP addresses the + * restriction is valid for. + */ +export interface IpSecurityRestriction { + ipAddress: string; + subnetMask?: 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} [arguments] Command-line arguments to be passed to the + * script processor. + */ +export interface HandlerMapping { + extension?: string; + scriptProcessor?: string; + arguments?: 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 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 {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 {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 {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' + */ +export interface SiteConfig { + numberOfWorkers?: number; + defaultDocuments?: string[]; + netFrameworkVersion?: string; + phpVersion?: string; + pythonVersion?: string; + nodeVersion?: string; + linuxFxVersion?: string; + requestTracingEnabled?: boolean; + requestTracingExpirationTime?: Date; + remoteDebuggingEnabled?: boolean; + remoteDebuggingVersion?: string; + httpLoggingEnabled?: boolean; + logsDirectorySizeLimit?: number; + detailedErrorLoggingEnabled?: boolean; + publishingUsername?: string; + appSettings?: NameValuePair[]; + 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; + ipSecurityRestrictions?: IpSecurityRestriction[]; + http20Enabled?: boolean; + minTlsVersion?: string; +} + +/** + * @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 {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 {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 {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 {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 {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 {boolean} [cloningInfo.ignoreQuotas] true if quotas + * should be ignored; otherwise, false. + * @member {object} [snapshotInfo] If specified during app creation, the app is + * created from a previous snapshot. + * @member {string} [snapshotInfo.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * @member {object} [snapshotInfo.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * @member {string} [snapshotInfo.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @member {string} [snapshotInfo.recoveryTarget.id] ARM resource ID of the + * target 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} [snapshotInfo.overwrite] If true the recovery + * operation can overwrite source app; otherwise, false. + * @member {boolean} [snapshotInfo.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * @member {boolean} [snapshotInfo.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. + * @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' + * @member {string} [identity.tenantId] Tenant of managed service identity. + * @member {string} [identity.principalId] Principal Id of managed service + * identity. + */ +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; + 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; + snapshotInfo?: SnapshotRecoveryRequest; + 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} appServicePlanName Name for the App Service plan. + * @member {string} [workerTierName] Target worker tier assigned to the App + * Service plan. + * @member {string} [status] App Service plan status. Possible values include: + * 'Ready', 'Pending', 'Creating' + * @member {string} [subscription] App Service plan subscription. + * @member {string} [adminSiteName] App Service plan administration site. + * @member {object} [hostingEnvironmentProfile] Specification for the App + * Service Environment to use for the App Service plan. + * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App + * Service Environment. + * @member {string} [hostingEnvironmentProfile.name] Name of the App Service + * Environment. + * @member {string} [hostingEnvironmentProfile.type] Resource type of the App + * Service Environment. + * @member {number} [maximumNumberOfWorkers] Maximum number of instances that + * can be assigned to this App Service plan. + * @member {string} [geoRegion] Geographical location for the App Service plan. + * @member {boolean} [perSiteScaling] If true, apps assigned to + * this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. Default value: false . + * @member {number} [numberOfSites] Number of apps assigned to this App Service + * plan. + * @member {boolean} [isSpot] If true, this App Service Plan owns + * spot instances. + * @member {date} [spotExpirationTime] The time when the server farm expires. + * Valid only if it is a spot server farm. + * @member {string} [resourceGroup] Resource group of the App Service plan. + * @member {boolean} [reserved] If Linux 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 { + appServicePlanName: string; + workerTierName?: string; + readonly status?: string; + readonly subscription?: string; + adminSiteName?: string; + hostingEnvironmentProfile?: HostingEnvironmentProfile; + readonly maximumNumberOfWorkers?: number; + readonly geoRegion?: string; + perSiteScaling?: boolean; + readonly numberOfSites?: number; + isSpot?: boolean; + spotExpirationTime?: Date; + readonly resourceGroup?: string; + reserved?: boolean; + targetWorkerCount?: number; + targetWorkerSizeId?: number; + readonly provisioningState?: string; + sku?: SkuDescription; +} + +/** + * @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 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] + */ +export interface ServiceSpecification { + metricSpecifications?: MetricSpecification[]; +} + +/** + * @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] + */ +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] + */ +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 ErrorResponse class. + * @constructor + * Error Response. + * + * @member {string} [code] Error code. + * @member {string} [message] Error message indicating why the operation + * failed. + */ +export interface ErrorResponse { + code?: string; + message?: string; +} + +/** + * @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 {string} [domainName] Name of the top level domain. + * @member {boolean} [privacy] If true, then the top level domain + * supports domain privacy; otherwise, false. + */ +export interface TopLevelDomain extends ProxyOnlyResource { + readonly domainName?: string; + 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} [geoRegion] Region of the certificate. + * @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; + readonly geoRegion?: 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} [geoRegion] Region of the certificate. + * @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; + readonly geoRegion?: 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: + * 'Default', 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3' + * @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. + */ +export interface StampCapacity { + name?: string; + availableCapacity?: number; + totalCapacity?: number; + unit?: string; + computeMode?: string; + workerSize?: string; + workerSizeId?: number; + excludeFromCapacityAllocation?: boolean; + isApplicableForAllComputeModes?: boolean; + siteMode?: string; +} + +/** + * @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 + */ +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[]; +} + +/** + * @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 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 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 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 DeletedSite class. + * @constructor + * A deleted app. + * + * @member {number} [id] 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} [name] Name of the deleted site + * @member {string} [slot] Slot of the deleted site + */ +export interface DeletedSite { + id?: number; + readonly deletedTimestamp?: string; + readonly subscription?: string; + readonly resourceGroup?: string; + readonly name?: string; + readonly slot?: string; +} + +/** + * @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 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 BillingMeter class. + * @constructor + * Billing meter. + * + * @member {string} [meterId] Meter GUID onboarded in Commerce + * @member {string} [billingLocation] CSM Location + * @member {string} [shortName] Short Name from Azure pricing Page + * @member {string} [friendlyName] Meter Resource Name + * @member {string} [resourceType] ResourceType meter used for + */ +export interface BillingMeter { + meterId?: string; + billingLocation?: string; + shortName?: string; + friendlyName?: string; + resourceType?: string; +} + +/** + * @class + * Initializes a new instance of the StackMinorVersion class. + * @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} [tags] The list of category tags that this recommendation + * belongs to. + * @member {string} [actionName] Name of action recommended by this object. + * @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; + tags?: string[]; + actionName?: 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} [recommendationRuleName] 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} [tags] An array of category tags that the rule contains. + * @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 { + recommendationRuleName?: string; + displayName?: string; + message?: string; + recommendationId?: string; + description?: string; + actionName?: string; + level?: string; + channels?: string; + tags?: string[]; + isDynamic?: boolean; + extensionName?: string; + bladeName?: string; + forwardLink?: string; +} + +/** + * @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 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} [geoRegionName] Region name. + * @member {string} [description] Region description. + * @member {string} [displayName] Display name for region. + */ +export interface GeoRegion extends ProxyOnlyResource { + readonly geoRegionName?: string; + 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 {string} [premierAddOnOfferName] Premier add on offer Name. + * @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; + premierAddOnOfferName?: 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} [sourceControlName] Name or source control type. + * @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 { + sourceControlName?: string; + 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. + */ +export interface ValidateRequest { + name: string; + type: string; + location: string; + serverFarmId?: string; + skuName?: string; + needLinuxWorkers?: boolean; + isSpot?: boolean; + capacity?: number; + hostingEnvironment?: string; +} + +/** + * @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 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} backupRequestName 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. + * @member {string} [backupRequestType] Type of the backup. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + */ +export interface BackupRequest extends ProxyOnlyResource { + backupRequestName: string; + enabled?: boolean; + storageAccountUrl: string; + backupSchedule?: BackupSchedule; + databases?: DatabaseBackupSetting[]; + backupRequestType?: string; +} + +/** + * @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} [continuousWebJobName] Job name. Used as job identifier in + * ARM resource URI. + * @member {string} [runCommand] Run command. + * @member {string} [url] Job URL. + * @member {string} [extraInfoUrl] Extra Info URL. + * @member {string} [jobType] 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; + readonly continuousWebJobName?: string; + runCommand?: string; + url?: string; + extraInfoUrl?: string; + jobType?: 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' + */ +export interface CsmPublishingProfileOptions { + format?: string; +} + +/** + * @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 Deployment class. + * @constructor + * User crendentials used for publishing activity. + * + * @member {string} [deploymentId] Identifier for 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. + */ +export interface Deployment extends ProxyOnlyResource { + deploymentId?: string; + 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} [functionEnvelopeName] Function name. + * @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 { + readonly functionEnvelopeName?: string; + readonly functionAppId?: string; + scriptRootPathHref?: string; + scriptHref?: string; + configHref?: string; + secretsFileHref?: string; + href?: string; + config?: any; + files?: { [propertyName: string]: string }; + testData?: string; +} + +/** + * @class + * Initializes a new instance of the FunctionSecrets class. + * @constructor + * Function secrets. + * + * @member {string} [key] Secret key. + * @member {string} [triggerUrl] Trigger URL. + */ +export interface FunctionSecrets extends ProxyOnlyResource { + key?: string; + triggerUrl?: string; +} + +/** + * @class + * Initializes a new instance of the HostNameBinding class. + * @constructor + * A hostname binding object. + * + * @member {string} [siteName] App Service app name. + * @member {string} [domainId] Fully qualified ARM domain resource URI. + * @member {string} [azureResourceName] Azure resource name. + * @member {string} [azureResourceType] Azure resource type. Possible values + * include: 'Website', 'TrafficManager' + * @member {string} [customHostNameDnsRecordType] Custom DNS record type. + * Possible values include: 'CName', 'A' + * @member {string} [hostNameType] Hostname type. Possible values include: + * 'Verified', 'Managed' + * @member {string} [sslState] SSL type. Possible values include: 'Disabled', + * 'SniEnabled', 'IpBasedEnabled' + * @member {string} [thumbprint] SSL certificate thumbprint + * @member {string} [virtualIP] Virtual IP address assigned to the hostname if + * IP based SSL is enabled. + */ +export interface HostNameBinding extends ProxyOnlyResource { + siteName?: string; + domainId?: string; + azureResourceName?: string; + azureResourceType?: string; + customHostNameDnsRecordType?: string; + hostNameType?: string; + sslState?: string; + thumbprint?: string; + readonly virtualIP?: string; +} + +/** + * @class + * Initializes a new instance of the HttpLogsConfig class. + * @constructor + * Http logs configuration. + * + * @member {object} [fileSystem] Http logs to file system configuration. + * @member {number} [fileSystem.retentionInMb] Maximum size in megabytes that + * http log files can use. + * When reached old log files will be removed to make space for new ones. + * Value can range between 25 and 100. + * @member {number} [fileSystem.retentionInDays] Retention in days. + * Remove files older than X days. + * 0 or lower means no retention. + * @member {boolean} [fileSystem.enabled] True if configuration is enabled, + * false if it is disabled and null if configuration is not set. + * @member {object} [azureBlobStorage] Http logs to azure blob storage + * configuration. + * @member {string} [azureBlobStorage.sasUrl] SAS url to a azure blob container + * with read/write/list/delete permissions. + * @member {number} [azureBlobStorage.retentionInDays] Retention in days. + * Remove blobs older than X days. + * 0 or lower means no retention. + * @member {boolean} [azureBlobStorage.enabled] True if configuration is + * enabled, false if it is disabled and null if configuration is not set. + */ +export interface HttpLogsConfig { + fileSystem?: FileSystemHttpLogsConfig; + azureBlobStorage?: AzureBlobStorageHttpLogsConfig; +} + +/** + * @class + * Initializes a new instance of the MSDeploy class. + * @constructor + * MSDeploy ARM PUT information + * + * @member {string} [packageUri] Package URI + * @member {string} [connectionString] SQL Connection String + * @member {string} [dbType] Database Type + * @member {string} [setParametersXmlFileUri] URI of MSDeploy Parameters file. + * Must not be set if SetParameters is used. + * @member {object} [setParameters] MSDeploy Parameters. Must not be set if + * SetParametersXmlFileUri is used. + * @member {boolean} [skipAppData] Controls whether the MSDeploy operation + * skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * @member {boolean} [appOffline] Sets the AppOffline rule while the MSDeploy + * operation executes. + * Setting is false by default. + */ +export interface MSDeploy extends ProxyOnlyResource { + packageUri?: string; + connectionString?: string; + dbType?: string; + setParametersXmlFileUri?: string; + setParameters?: { [propertyName: string]: string }; + skipAppData?: boolean; + appOffline?: boolean; +} + +/** + * @class + * Initializes a new instance of the MSDeployLogEntry class. + * @constructor + * MSDeploy log entry + * + * @member {date} [time] Timestamp of log entry + * @member {string} [type] Log entry type. Possible values include: 'Message', + * 'Warning', 'Error' + * @member {string} [message] Log entry message + */ +export interface MSDeployLogEntry { + readonly time?: Date; + readonly type?: string; + readonly message?: string; +} + +/** + * @class + * Initializes a new instance of the MSDeployLog class. + * @constructor + * MSDeploy log + * + * @member {array} [entries] List of log entry messages + */ +export interface MSDeployLog extends ProxyOnlyResource { + readonly entries?: MSDeployLogEntry[]; +} + +/** + * @class + * Initializes a new instance of the MSDeployStatus class. + * @constructor + * MSDeploy ARM response + * + * @member {string} [deployer] Username of deployer + * @member {string} [provisioningState] Provisioning state. Possible values + * include: 'accepted', 'running', 'succeeded', 'failed', 'canceled' + * @member {date} [startTime] Start time of deploy operation + * @member {date} [endTime] End time of deploy operation + * @member {boolean} [complete] Whether the deployment operation has completed + */ +export interface MSDeployStatus extends ProxyOnlyResource { + readonly deployer?: string; + readonly provisioningState?: string; + readonly startTime?: Date; + readonly endTime?: Date; + readonly complete?: boolean; +} + +/** + * @class + * Initializes a new instance of the MigrateMySqlRequest class. + * @constructor + * MySQL migration request. + * + * @member {string} connectionString Connection string to the remote MySQL + * database. + * @member {string} migrationType The type of migration operation to be done. + * Possible values include: 'LocalToRemote', 'RemoteToLocal' + */ +export interface MigrateMySqlRequest extends ProxyOnlyResource { + connectionString: string; + migrationType: string; +} + +/** + * @class + * Initializes a new instance of the MigrateMySqlStatus class. + * @constructor + * MySQL migration status. + * + * @member {string} [migrationOperationStatus] Status of the migration task. + * Possible values include: 'InProgress', 'Failed', 'Succeeded', 'TimedOut', + * 'Created' + * @member {string} [operationId] Operation ID for the migration task. + * @member {boolean} [localMySqlEnabled] True if the web app has in app MySql + * enabled + */ +export interface MigrateMySqlStatus extends ProxyOnlyResource { + readonly migrationOperationStatus?: string; + readonly operationId?: string; + readonly localMySqlEnabled?: boolean; +} + +/** + * @class + * Initializes a new instance of the RelayServiceConnectionEntity class. + * @constructor + * Hybrid Connection for an App Service app. + * + * @member {string} [entityName] + * @member {string} [entityConnectionString] + * @member {string} [resourceType] + * @member {string} [resourceConnectionString] + * @member {string} [hostname] + * @member {number} [port] + * @member {string} [biztalkUri] + */ +export interface RelayServiceConnectionEntity extends ProxyOnlyResource { + entityName?: string; + entityConnectionString?: string; + resourceType?: string; + resourceConnectionString?: string; + hostname?: string; + port?: number; + biztalkUri?: string; +} + +/** + * @class + * Initializes a new instance of the NetworkFeatures class. + * @constructor + * Full view of network features for an app (presently VNET integration and + * Hybrid Connections). + * + * @member {string} [virtualNetworkName] The Virtual Network name. + * @member {object} [virtualNetworkConnection] The Virtual Network summary + * view. + * @member {string} [virtualNetworkConnection.vnetResourceId] The Virtual + * Network's resource ID. + * @member {string} [virtualNetworkConnection.certThumbprint] The client + * certificate thumbprint. + * @member {buffer} [virtualNetworkConnection.certBlob] A certificate file + * (.cer) blob containing the public key of the private key used to + * authenticate a + * Point-To-Site VPN connection. + * @member {array} [virtualNetworkConnection.routes] The routes that this + * Virtual Network connection uses. + * @member {boolean} [virtualNetworkConnection.resyncRequired] + * true if a resync is required; otherwise, false. + * @member {string} [virtualNetworkConnection.dnsServers] DNS servers to be + * used by this Virtual Network. This should be a comma-separated list of IP + * addresses. + * @member {array} [hybridConnections] The Hybrid Connections summary view. + * @member {array} [hybridConnectionsV2] The Hybrid Connection V2 (Service Bus) + * view. + */ +export interface NetworkFeatures extends ProxyOnlyResource { + readonly virtualNetworkName?: string; + readonly virtualNetworkConnection?: VnetInfo; + readonly hybridConnections?: RelayServiceConnectionEntity[]; + readonly hybridConnectionsV2?: HybridConnection[]; +} + +/** + * @class + * Initializes a new instance of the PerfMonSample class. + * @constructor + * Performance monitor sample in a set. + * + * @member {date} [time] Point in time for which counter was measured. + * @member {string} [instanceName] Name of the server on which the measurement + * is made. + * @member {number} [value] Value of counter at a certain time. + * @member {number} [coreCount] Core Count of worker. Not a data member + */ +export interface PerfMonSample { + time?: Date; + instanceName?: string; + value?: number; + coreCount?: 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} [premierAddOnName] Premier add on Name. + * @member {string} [premierAddOnLocation] Premier add on Location. + * @member {object} [premierAddOnTags] Premier add on Tags. + * @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; + premierAddOnName?: string; + premierAddOnLocation?: string; + premierAddOnTags?: { [propertyName: string]: string }; + marketplacePublisher?: string; + marketplaceOffer?: string; +} + +/** + * @class + * Initializes a new instance of the ProcessThreadInfo class. + * @constructor + * Process Thread Information. + * + * @member {number} [processThreadInfoId] ARM Identifier for deployment. + * @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 { + processThreadInfoId?: 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} [processInfoId] ARM Identifier for deployment. + * @member {string} [processInfoName] 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} [totalProcessorTime] Total CPU time. + * @member {string} [userProcessorTime] User CPU time. + * @member {string} [privilegedProcessorTime] Privileged CPU time. + * @member {number} [workingSet64] Working set. + * @member {number} [peakWorkingSet64] Peak working set. + * @member {number} [privateMemorySize64] Private memory size. + * @member {number} [virtualMemorySize64] Virtual memory size. + * @member {number} [peakVirtualMemorySize64] Peak virtual memory usage. + * @member {number} [pagedSystemMemorySize64] Paged system memory. + * @member {number} [nonpagedSystemMemorySize64] Non-paged system memory. + * @member {number} [pagedMemorySize64] Paged memory. + * @member {number} [peakPagedMemorySize64] 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 { + processInfoId?: number; + processInfoName?: 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; + totalProcessorTime?: string; + userProcessorTime?: string; + privilegedProcessorTime?: string; + workingSet64?: number; + peakWorkingSet64?: number; + privateMemorySize64?: number; + virtualMemorySize64?: number; + peakVirtualMemorySize64?: number; + pagedSystemMemorySize64?: number; + nonpagedSystemMemorySize64?: number; + pagedMemorySize64?: number; + peakPagedMemorySize64?: 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'. 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 RestoreResponse class. + * @constructor + * Response for an app restore request. + * + * @member {string} [operationId] When server starts the restore process, it + * will return an operation ID identifying that particular restore operation. + */ +export interface RestoreResponse extends ProxyOnlyResource { + readonly operationId?: 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 {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; + 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 {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 {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 {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' + */ +export interface SiteConfigResource extends ProxyOnlyResource { + numberOfWorkers?: number; + defaultDocuments?: string[]; + netFrameworkVersion?: string; + phpVersion?: string; + pythonVersion?: string; + nodeVersion?: string; + linuxFxVersion?: string; + requestTracingEnabled?: boolean; + requestTracingExpirationTime?: Date; + remoteDebuggingEnabled?: boolean; + remoteDebuggingVersion?: string; + httpLoggingEnabled?: boolean; + logsDirectorySizeLimit?: number; + detailedErrorLoggingEnabled?: boolean; + publishingUsername?: string; + appSettings?: NameValuePair[]; + 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; + ipSecurityRestrictions?: IpSecurityRestriction[]; + http20Enabled?: boolean; + minTlsVersion?: string; +} + +/** + * @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} [siteConfigurationSnapshotInfoId] The id of the snapshot + */ +export interface SiteConfigurationSnapshotInfo extends ProxyOnlyResource { + readonly time?: Date; + readonly siteConfigurationSnapshotInfoId?: number; +} + +/** + * @class + * Initializes a new instance of the SiteExtensionInfo class. + * @constructor + * Site Extension Information. + * + * @member {string} [siteExtensionInfoId] Site extension ID. + * @member {string} [title] Site extension title. + * @member {string} [siteExtensionInfoType] 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} [installationArgs] 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 { + siteExtensionInfoId?: string; + title?: string; + siteExtensionInfoType?: string; + summary?: string; + description?: string; + version?: string; + extensionUrl?: string; + projectUrl?: string; + iconUrl?: string; + licenseUrl?: string; + feedUrl?: string; + authors?: string[]; + installationArgs?: 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 {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 {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 {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 {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 {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 {boolean} [cloningInfo.ignoreQuotas] true if quotas + * should be ignored; otherwise, false. + * @member {object} [snapshotInfo] If specified during app creation, the app is + * created from a previous snapshot. + * @member {string} [snapshotInfo.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * @member {object} [snapshotInfo.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * @member {string} [snapshotInfo.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @member {string} [snapshotInfo.recoveryTarget.id] ARM resource ID of the + * target 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} [snapshotInfo.overwrite] If true the recovery + * operation can overwrite source app; otherwise, false. + * @member {boolean} [snapshotInfo.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * @member {boolean} [snapshotInfo.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. + * @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; + 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; + snapshotInfo?: SnapshotRecoveryRequest; + 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. + */ +export interface SlotConfigNamesResource extends ProxyOnlyResource { + connectionStringNames?: string[]; + appSettingNames?: string[]; +} + +/** + * @class + * Initializes a new instance of the SlotDifference class. + * @constructor + * A setting difference between two deployment slots of an app. + * + * @member {string} [slotDifferenceType] Type 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 slotDifferenceType?: 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 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 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 TriggeredJobRun class. + * @constructor + * Triggered Web Job Run Information. + * + * @member {string} [triggeredJobRunId] Job ID. + * @member {string} [triggeredJobRunName] 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 { + triggeredJobRunId?: string; + readonly triggeredJobRunName?: 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} [triggeredJobRuns] List of triggered web job runs. + */ +export interface TriggeredJobHistory extends ProxyOnlyResource { + triggeredJobRuns?: 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.triggeredJobRunId] Job ID. + * @member {string} [latestRun.triggeredJobRunName] 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} [triggeredWebJobName] Job name. Used as job identifier in + * ARM resource URI. + * @member {string} [runCommand] Run command. + * @member {string} [url] Job URL. + * @member {string} [extraInfoUrl] Extra Info URL. + * @member {string} [jobType] 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; + readonly triggeredWebJobName?: string; + runCommand?: string; + url?: string; + extraInfoUrl?: string; + jobType?: string; + error?: string; + usingSdk?: boolean; + settings?: { [propertyName: string]: any }; +} + +/** + * @class + * Initializes a new instance of the WebJob class. + * @constructor + * Web Job Information. + * + * @member {string} [webJobName] Job name. Used as job identifier in ARM + * resource URI. + * @member {string} [runCommand] Run command. + * @member {string} [url] Job URL. + * @member {string} [extraInfoUrl] Extra Info URL. + * @member {string} [jobType] 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 { + readonly webJobName?: string; + runCommand?: string; + url?: string; + extraInfoUrl?: string; + jobType?: 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 + */ +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[]; +} + +/** + * @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 + */ +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[]; +} + +/** + * @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} [metricDefinitionName] Name of the 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 metricDefinitionName?: string; + 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} [usageName] Name of the quota. + * @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 usageName?: 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} appServicePlanPatchResourceName Name for the App Service + * plan. + * @member {string} [workerTierName] Target worker tier assigned to the App + * Service plan. + * @member {string} [status] App Service plan status. Possible values include: + * 'Ready', 'Pending', 'Creating' + * @member {string} [subscription] App Service plan subscription. + * @member {string} [adminSiteName] App Service plan administration site. + * @member {object} [hostingEnvironmentProfile] Specification for the App + * Service Environment to use for the App Service plan. + * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App + * Service Environment. + * @member {string} [hostingEnvironmentProfile.name] Name of the App Service + * Environment. + * @member {string} [hostingEnvironmentProfile.type] Resource type of the App + * Service Environment. + * @member {number} [maximumNumberOfWorkers] Maximum number of instances that + * can be assigned to this App Service plan. + * @member {string} [geoRegion] Geographical location for the App Service plan. + * @member {boolean} [perSiteScaling] If true, apps assigned to + * this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. Default value: false . + * @member {number} [numberOfSites] Number of apps assigned to this App Service + * plan. + * @member {boolean} [isSpot] If true, this App Service Plan owns + * spot instances. + * @member {date} [spotExpirationTime] The time when the server farm expires. + * Valid only if it is a spot server farm. + * @member {string} [resourceGroup] Resource group of the App Service plan. + * @member {boolean} [reserved] If Linux 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 { + appServicePlanPatchResourceName: string; + workerTierName?: string; + readonly status?: string; + readonly subscription?: string; + adminSiteName?: string; + hostingEnvironmentProfile?: HostingEnvironmentProfile; + readonly maximumNumberOfWorkers?: number; + readonly geoRegion?: string; + perSiteScaling?: boolean; + readonly numberOfSites?: number; + isSpot?: boolean; + spotExpirationTime?: Date; + readonly resourceGroup?: string; + reserved?: 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 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 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 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; +} + +/** + * @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 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 { + 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 { + 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; +} diff --git a/lib/services/websiteManagement2/lib/models/index.js b/lib/services/websiteManagement2/lib/models/index.js new file mode 100644 index 0000000000..3dc66f961a --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/index.js @@ -0,0 +1,277 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * 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.SnapshotRecoveryTarget = require('./snapshotRecoveryTarget'); +exports.SnapshotRecoveryRequest = require('./snapshotRecoveryRequest'); +exports.ResourceMetricAvailability = require('./resourceMetricAvailability'); +exports.ResourceMetricName = require('./resourceMetricName'); +exports.ResourceMetricDefinition = require('./resourceMetricDefinition'); +exports.PushSettings = require('./pushSettings'); +exports.Identifier = require('./identifier'); +exports.HybridConnectionKey = require('./hybridConnectionKey'); +exports.HybridConnection = require('./hybridConnection'); +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.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.NameIdentifier = require('./nameIdentifier'); +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.ErrorResponse = require('./errorResponse'); +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.DefaultErrorResponseErrorDetailsItem = require('./defaultErrorResponseErrorDetailsItem'); +exports.DefaultErrorResponseError = require('./defaultErrorResponseError'); +exports.DefaultErrorResponse = require('./defaultErrorResponse'); +exports.Operation = require('./operation'); +exports.ResourceMetricProperty = require('./resourceMetricProperty'); +exports.ResourceMetricValue = require('./resourceMetricValue'); +exports.ResourceMetric = require('./resourceMetric'); +exports.DeletedSite = require('./deletedSite'); +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.DiagnosticAnalysis = require('./diagnosticAnalysis'); +exports.DiagnosticCategory = require('./diagnosticCategory'); +exports.DiagnosticDetectorResponse = require('./diagnosticDetectorResponse'); +exports.BillingMeter = require('./billingMeter'); +exports.StackMinorVersion = require('./stackMinorVersion'); +exports.StackMajorVersion = require('./stackMajorVersion'); +exports.ApplicationStack = require('./applicationStack'); +exports.Recommendation = require('./recommendation'); +exports.RecommendationRule = require('./recommendationRule'); +exports.ResourceHealthMetadata = require('./resourceHealthMetadata'); +exports.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.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.Deployment = require('./deployment'); +exports.EnabledConfig = require('./enabledConfig'); +exports.FileSystemHttpLogsConfig = require('./fileSystemHttpLogsConfig'); +exports.FunctionEnvelope = require('./functionEnvelope'); +exports.FunctionSecrets = require('./functionSecrets'); +exports.HostNameBinding = require('./hostNameBinding'); +exports.HttpLogsConfig = require('./httpLogsConfig'); +exports.MSDeploy = require('./mSDeploy'); +exports.MSDeployLogEntry = require('./mSDeployLogEntry'); +exports.MSDeployLog = require('./mSDeployLog'); +exports.MSDeployStatus = require('./mSDeployStatus'); +exports.MigrateMySqlRequest = require('./migrateMySqlRequest'); +exports.MigrateMySqlStatus = require('./migrateMySqlStatus'); +exports.RelayServiceConnectionEntity = require('./relayServiceConnectionEntity'); +exports.NetworkFeatures = require('./networkFeatures'); +exports.PerfMonSample = require('./perfMonSample'); +exports.PerfMonSet = require('./perfMonSet'); +exports.PerfMonResponse = require('./perfMonResponse'); +exports.PremierAddOn = require('./premierAddOn'); +exports.ProcessThreadInfo = require('./processThreadInfo'); +exports.ProcessModuleInfo = require('./processModuleInfo'); +exports.ProcessInfo = require('./processInfo'); +exports.PublicCertificate = require('./publicCertificate'); +exports.RestoreRequest = require('./restoreRequest'); +exports.RestoreResponse = require('./restoreResponse'); +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.Snapshot = require('./snapshot'); +exports.StorageMigrationOptions = require('./storageMigrationOptions'); +exports.StorageMigrationResponse = require('./storageMigrationResponse'); +exports.StringDictionary = require('./stringDictionary'); +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.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.DiagnosticCategoryCollection = require('./diagnosticCategoryCollection'); +exports.DiagnosticAnalysisCollection = require('./diagnosticAnalysisCollection'); +exports.DiagnosticDetectorCollection = require('./diagnosticDetectorCollection'); +exports.ApplicationStackCollection = require('./applicationStackCollection'); +exports.RecommendationCollection = require('./recommendationCollection'); +exports.ResourceHealthMetadataCollection = require('./resourceHealthMetadataCollection'); +exports.SourceControlCollection = require('./sourceControlCollection'); +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'); diff --git a/lib/services/websiteManagement2/lib/models/ipSecurityRestriction.js b/lib/services/websiteManagement2/lib/models/ipSecurityRestriction.js new file mode 100644 index 0000000000..c9589edfc8 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/ipSecurityRestriction.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'; + +/** + * IP security restriction on an app. + * + */ +class IpSecurityRestriction { + /** + * Create a IpSecurityRestriction. + * @member {string} ipAddress IP address the security restriction is valid + * for. + * @member {string} [subnetMask] Subnet mask for the range of IP addresses + * the restriction is valid for. + */ + 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' + } + } + } + } + }; + } +} + +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/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..1b38e8c693 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/managedServiceIdentity.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'; + +/** + * Managed service identity. + * + */ +class ManagedServiceIdentity { + /** + * Create a ManagedServiceIdentity. + * @member {string} [type] Type of managed service identity. Possible values + * include: 'SystemAssigned' + * @member {string} [tenantId] Tenant of managed service identity. + * @member {string} [principalId] Principal Id of managed service identity. + */ + 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' + } + } + } + } + }; + } +} + +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..7ef23aa4c1 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/metricDefinition.js @@ -0,0 +1,133 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} [metricDefinitionName] Name of the 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. + */ + 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' + } + }, + metricDefinitionName: { + required: false, + readOnly: true, + serializedName: 'properties.name', + 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..f181fc189b --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/metricSpecification.js @@ -0,0 +1,182 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 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/operation.js b/lib/services/websiteManagement2/lib/models/operation.js new file mode 100644 index 0000000000..4a24b281f8 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/operation.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'); + +/** + * 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..a4badd3919 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/perfMonResponse.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'); + +/** + * 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..f7882a7d2e --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/perfMonSample.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'; + +/** + * 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. + * @member {number} [coreCount] Core Count of worker. Not a data member + */ + 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' + } + }, + coreCount: { + required: false, + serializedName: 'coreCount', + 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..8a24e0d373 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/perfMonSet.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'); + +/** + * 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..ac3d6c9e2f --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/premierAddOn.js @@ -0,0 +1,172 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} [premierAddOnName] Premier add on Name. + * @member {string} [premierAddOnLocation] Premier add on Location. + * @member {object} [premierAddOnTags] Premier add on Tags. + * @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' + } + }, + premierAddOnName: { + required: false, + serializedName: 'properties.name', + type: { + name: 'String' + } + }, + premierAddOnLocation: { + required: false, + serializedName: 'properties.location', + type: { + name: 'String' + } + }, + premierAddOnTags: { + required: false, + serializedName: 'properties.tags', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + 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..2252e8969a --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/premierAddOnOffer.js @@ -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. + */ + +'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 {string} [premierAddOnOfferName] Premier add on offer Name. + * @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' + } + }, + premierAddOnOfferName: { + required: false, + serializedName: 'properties.name', + 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/processInfo.js b/lib/services/websiteManagement2/lib/models/processInfo.js new file mode 100644 index 0000000000..094583fabf --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/processInfo.js @@ -0,0 +1,405 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} [processInfoId] ARM Identifier for deployment. + * @member {string} [processInfoName] 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} [totalProcessorTime] Total CPU time. + * @member {string} [userProcessorTime] User CPU time. + * @member {string} [privilegedProcessorTime] Privileged CPU time. + * @member {number} [workingSet64] Working set. + * @member {number} [peakWorkingSet64] Peak working set. + * @member {number} [privateMemorySize64] Private memory size. + * @member {number} [virtualMemorySize64] Virtual memory size. + * @member {number} [peakVirtualMemorySize64] Peak virtual memory usage. + * @member {number} [pagedSystemMemorySize64] Paged system memory. + * @member {number} [nonpagedSystemMemorySize64] Non-paged system memory. + * @member {number} [pagedMemorySize64] Paged memory. + * @member {number} [peakPagedMemorySize64] 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' + } + }, + processInfoId: { + required: false, + serializedName: 'properties.id', + type: { + name: 'Number' + } + }, + processInfoName: { + required: false, + serializedName: 'properties.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.isProfileRunning', + type: { + name: 'Boolean' + } + }, + isIisProfileRunning: { + required: false, + serializedName: 'properties.isIisProfileRunning', + type: { + name: 'Boolean' + } + }, + iisProfileTimeoutInSeconds: { + required: false, + serializedName: 'properties.iisProfileTimeoutInSeconds', + 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.openFileHandles', + 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.fileName', + type: { + name: 'String' + } + }, + commandLine: { + required: false, + serializedName: 'properties.commandLine', + type: { + name: 'String' + } + }, + userName: { + required: false, + serializedName: 'properties.userName', + type: { + name: 'String' + } + }, + handleCount: { + required: false, + serializedName: 'properties.handleCount', + type: { + name: 'Number' + } + }, + moduleCount: { + required: false, + serializedName: 'properties.moduleCount', + type: { + name: 'Number' + } + }, + threadCount: { + required: false, + serializedName: 'properties.threadCount', + type: { + name: 'Number' + } + }, + startTime: { + required: false, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + totalProcessorTime: { + required: false, + serializedName: 'properties.totalProcessorTime', + type: { + name: 'String' + } + }, + userProcessorTime: { + required: false, + serializedName: 'properties.userProcessorTime', + type: { + name: 'String' + } + }, + privilegedProcessorTime: { + required: false, + serializedName: 'properties.privilegedProcessorTime', + type: { + name: 'String' + } + }, + workingSet64: { + required: false, + serializedName: 'properties.workingSet64', + type: { + name: 'Number' + } + }, + peakWorkingSet64: { + required: false, + serializedName: 'properties.peakWorkingSet64', + type: { + name: 'Number' + } + }, + privateMemorySize64: { + required: false, + serializedName: 'properties.privateMemorySize64', + type: { + name: 'Number' + } + }, + virtualMemorySize64: { + required: false, + serializedName: 'properties.virtualMemorySize64', + type: { + name: 'Number' + } + }, + peakVirtualMemorySize64: { + required: false, + serializedName: 'properties.peakVirtualMemorySize64', + type: { + name: 'Number' + } + }, + pagedSystemMemorySize64: { + required: false, + serializedName: 'properties.pagedSystemMemorySize64', + type: { + name: 'Number' + } + }, + nonpagedSystemMemorySize64: { + required: false, + serializedName: 'properties.nonpagedSystemMemorySize64', + type: { + name: 'Number' + } + }, + pagedMemorySize64: { + required: false, + serializedName: 'properties.pagedMemorySize64', + type: { + name: 'Number' + } + }, + peakPagedMemorySize64: { + required: false, + serializedName: 'properties.peakPagedMemorySize64', + type: { + name: 'Number' + } + }, + timeStamp: { + required: false, + serializedName: 'properties.timeStamp', + type: { + name: 'DateTime' + } + }, + environmentVariables: { + required: false, + serializedName: 'properties.environmentVariables', + type: { + name: 'Dictionary', + value: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + isScmSite: { + required: false, + serializedName: 'properties.isScmSite', + type: { + name: 'Boolean' + } + }, + isWebJob: { + required: false, + serializedName: 'properties.isWebJob', + 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..54334a64cf --- /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.baseAddress', + type: { + name: 'String' + } + }, + fileName: { + required: false, + serializedName: 'properties.fileName', + type: { + name: 'String' + } + }, + href: { + required: false, + serializedName: 'properties.href', + type: { + name: 'String' + } + }, + filePath: { + required: false, + serializedName: 'properties.filePath', + type: { + name: 'String' + } + }, + moduleMemorySize: { + required: false, + serializedName: 'properties.moduleMemorySize', + type: { + name: 'Number' + } + }, + fileVersion: { + required: false, + serializedName: 'properties.fileVersion', + type: { + name: 'String' + } + }, + fileDescription: { + required: false, + serializedName: 'properties.fileDescription', + type: { + name: 'String' + } + }, + product: { + required: false, + serializedName: 'properties.product', + type: { + name: 'String' + } + }, + productVersion: { + required: false, + serializedName: 'properties.productVersion', + type: { + name: 'String' + } + }, + isDebug: { + required: false, + serializedName: 'properties.isDebug', + 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..ec227556b0 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/processThreadInfo.js @@ -0,0 +1,183 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} [processThreadInfoId] ARM Identifier for deployment. + * @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' + } + }, + processThreadInfoId: { + required: false, + serializedName: 'properties.id', + 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.startAddress', + type: { + name: 'String' + } + }, + currentPriority: { + required: false, + serializedName: 'properties.currentPriority', + type: { + name: 'Number' + } + }, + priorityLevel: { + required: false, + serializedName: 'properties.priorityLevel', + type: { + name: 'String' + } + }, + basePriority: { + required: false, + serializedName: 'properties.basePriority', + type: { + name: 'Number' + } + }, + startTime: { + required: false, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + totalProcessorTime: { + required: false, + serializedName: 'properties.totalProcessorTime', + type: { + name: 'String' + } + }, + userProcessorTime: { + required: false, + serializedName: 'properties.userProcessorTime', + type: { + name: 'String' + } + }, + priviledgedProcessorTime: { + required: false, + serializedName: 'properties.priviledgedProcessorTime', + type: { + name: 'String' + } + }, + state: { + required: false, + serializedName: 'properties.state', + type: { + name: 'String' + } + }, + waitReason: { + required: false, + serializedName: 'properties.waitReason', + 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..665993eaba --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/recommendation.js @@ -0,0 +1,274 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} [tags] The list of category tags that this recommendation + * belongs to. + * @member {string} [actionName] Name of action recommended by this object. + * @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' ] + } + }, + tags: { + required: false, + serializedName: 'properties.tags', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + actionName: { + required: false, + serializedName: 'properties.actionName', + 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..6e35b0c290 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/recommendationRule.js @@ -0,0 +1,203 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} [recommendationRuleName] 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} [tags] An array of category tags that the rule contains. + * @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' + } + }, + recommendationRuleName: { + required: false, + serializedName: 'properties.name', + 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' ] + } + }, + tags: { + required: false, + serializedName: 'properties.tags', + 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/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..bc89c6dc3d --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/resourceMetric.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'; + +const models = require('./index'); + +/** + * 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..86464c5423 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/resourceMetricDefinition.js @@ -0,0 +1,162 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 {object} [resourceMetricDefinitionName] Name of the metric. + * @member {string} [resourceMetricDefinitionName.value] metric name value. + * @member {string} [resourceMetricDefinitionName.localizedValue] Localized + * metric name value. + * @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 {string} [resourceMetricDefinitionId] Resource ID. + * @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' + } + }, + resourceMetricDefinitionName: { + required: false, + readOnly: true, + serializedName: 'properties.name', + type: { + name: 'Composite', + className: 'ResourceMetricName' + } + }, + 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' + } + }, + resourceMetricDefinitionId: { + required: false, + readOnly: true, + serializedName: 'properties.id', + 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..6bc292af85 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/resourceMetricValue.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'); + +/** + * 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..1887a5d84a --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/responseMetaData.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'; + +const models = require('./index'); + +/** + * 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..ed24bafc6a --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/restoreRequest.js @@ -0,0 +1,193 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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'. 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' ] + } + }, + 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/restoreResponse.js b/lib/services/websiteManagement2/lib/models/restoreResponse.js new file mode 100644 index 0000000000..a3f06ae56a --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/restoreResponse.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'; + +const models = require('./index'); + +/** + * Response for an app restore request. + * + * @extends models['ProxyOnlyResource'] + */ +class RestoreResponse extends models['ProxyOnlyResource'] { + /** + * Create a RestoreResponse. + * @member {string} [operationId] When server starts the restore process, it + * will return an operation ID identifying that particular restore operation. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of RestoreResponse + * + * @returns {object} metadata of RestoreResponse + * + */ + mapper() { + return { + required: false, + serializedName: 'RestoreResponse', + type: { + name: 'Composite', + className: 'RestoreResponse', + 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 = RestoreResponse; diff --git a/lib/services/websiteManagement2/lib/models/serviceSpecification.js b/lib/services/websiteManagement2/lib/models/serviceSpecification.js new file mode 100644 index 0000000000..ebb2a7b9a3 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/serviceSpecification.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'; + +const models = require('./index'); + +/** + * Resource metrics service provided by Microsoft.Insights resource provider. + * + */ +class ServiceSpecification { + /** + * Create a ServiceSpecification. + * @member {array} [metricSpecifications] + */ + 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' + } + } + } + } + } + } + }; + } +} + +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..daa121c8ae --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/site.js @@ -0,0 +1,671 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 {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 {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 {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 {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 {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 {boolean} [cloningInfo.ignoreQuotas] true if quotas + * should be ignored; otherwise, false. + * @member {object} [snapshotInfo] If specified during app creation, the app + * is created from a previous snapshot. + * @member {string} [snapshotInfo.snapshotTime] Point in time in which the + * app recovery should be attempted, formatted as a DateTime string. + * @member {object} [snapshotInfo.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * @member {string} [snapshotInfo.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @member {string} [snapshotInfo.recoveryTarget.id] ARM resource ID of the + * target 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} [snapshotInfo.overwrite] If true the + * recovery operation can overwrite source app; otherwise, + * false. + * @member {boolean} [snapshotInfo.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * @member {boolean} [snapshotInfo.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. + * @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' + * @member {string} [identity.tenantId] Tenant of managed service identity. + * @member {string} [identity.principalId] Principal Id of managed service + * identity. + */ + 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' + } + }, + 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' + } + }, + snapshotInfo: { + required: false, + serializedName: 'properties.snapshotInfo', + type: { + name: 'Composite', + className: 'SnapshotRecoveryRequest' + } + }, + 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..977f86f4dc --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/siteAuthSettings.js @@ -0,0 +1,401 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 {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' + } + }, + 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..8e5728a618 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/siteCloneability.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'); + +/** + * 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..6dd3a24a75 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/siteConfig.js @@ -0,0 +1,548 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 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 {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 {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 {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' + */ + 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' + } + }, + 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' + } + } + } + }, + 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' + } + }, + 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' + } + } + } + } + }; + } +} + +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..247ba84dc6 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/siteConfigResource.js @@ -0,0 +1,581 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 {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 {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 {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' + */ + 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' + } + }, + 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' + } + } + } + }, + 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' + } + }, + 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' + } + } + } + } + }; + } +} + +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..ab201777eb --- /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} [siteConfigurationSnapshotInfoId] 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' + } + }, + siteConfigurationSnapshotInfoId: { + required: false, + readOnly: true, + serializedName: 'properties.id', + 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..8cd1cf009f --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/siteExtensionInfo.js @@ -0,0 +1,249 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} [siteExtensionInfoId] Site extension ID. + * @member {string} [title] Site extension title. + * @member {string} [siteExtensionInfoType] 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} [installationArgs] 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' + } + }, + siteExtensionInfoId: { + required: false, + serializedName: 'properties.id', + type: { + name: 'String' + } + }, + title: { + required: false, + serializedName: 'properties.title', + type: { + name: 'String' + } + }, + siteExtensionInfoType: { + required: false, + serializedName: 'properties.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.extensionUrl', + type: { + name: 'String' + } + }, + projectUrl: { + required: false, + serializedName: 'properties.projectUrl', + type: { + name: 'String' + } + }, + iconUrl: { + required: false, + serializedName: 'properties.iconUrl', + type: { + name: 'String' + } + }, + licenseUrl: { + required: false, + serializedName: 'properties.licenseUrl', + type: { + name: 'String' + } + }, + feedUrl: { + required: false, + serializedName: 'properties.feedUrl', + type: { + name: 'String' + } + }, + authors: { + required: false, + serializedName: 'properties.authors', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } + }, + installationArgs: { + required: false, + serializedName: 'properties.installationArgs', + type: { + name: 'String' + } + }, + publishedDateTime: { + required: false, + serializedName: 'properties.publishedDateTime', + type: { + name: 'DateTime' + } + }, + downloadCount: { + required: false, + serializedName: 'properties.downloadCount', + type: { + name: 'Number' + } + }, + localIsLatestVersion: { + required: false, + serializedName: 'properties.localIsLatestVersion', + type: { + name: 'Boolean' + } + }, + localPath: { + required: false, + serializedName: 'properties.localPath', + type: { + name: 'String' + } + }, + installedDateTime: { + required: false, + serializedName: 'properties.installedDateTime', + 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..850f9772ca --- /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.name', + 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..91322a206d --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/sitePatchResource.js @@ -0,0 +1,636 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 {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 {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 {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 {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 {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 {boolean} [cloningInfo.ignoreQuotas] true if quotas + * should be ignored; otherwise, false. + * @member {object} [snapshotInfo] If specified during app creation, the app + * is created from a previous snapshot. + * @member {string} [snapshotInfo.snapshotTime] Point in time in which the + * app recovery should be attempted, formatted as a DateTime string. + * @member {object} [snapshotInfo.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * @member {string} [snapshotInfo.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @member {string} [snapshotInfo.recoveryTarget.id] ARM resource ID of the + * target 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} [snapshotInfo.overwrite] If true the + * recovery operation can overwrite source app; otherwise, + * false. + * @member {boolean} [snapshotInfo.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * @member {boolean} [snapshotInfo.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. + * @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' + } + }, + 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' + } + }, + snapshotInfo: { + required: false, + serializedName: 'properties.snapshotInfo', + type: { + name: 'Composite', + className: 'SnapshotRecoveryRequest' + } + }, + 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..25c3b62002 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/skuDescription.js @@ -0,0 +1,137 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 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..ccf4d0de83 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/skuInfo.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'); + +/** + * 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..229a953e50 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/skuInfos.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'; + +const models = require('./index'); + +/** + * 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..e64eb91f19 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/slotConfigNamesResource.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'); + +/** + * 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. + */ + 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' + } + } + } + } + } + } + }; + } +} + +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..f20bdff1da --- /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} [slotDifferenceType] Type 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' + } + }, + slotDifferenceType: { + required: false, + readOnly: true, + serializedName: 'properties.type', + 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/snapshotRecoveryRequest.js b/lib/services/websiteManagement2/lib/models/snapshotRecoveryRequest.js new file mode 100644 index 0000000000..e59a088c7c --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/snapshotRecoveryRequest.js @@ -0,0 +1,133 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 SnapshotRecoveryRequest extends models['ProxyOnlyResource'] { + /** + * Create a SnapshotRecoveryRequest. + * @member {string} [snapshotTime] Point in time in which the app recovery + * should be attempted, formatted as a DateTime string. + * @member {object} [recoveryTarget] Specifies the web app that snapshot + * contents will be written to. + * @member {string} [recoveryTarget.location] Geographical location of the + * target web app, e.g. SouthEastAsia, SouthCentralUS + * @member {string} [recoveryTarget.id] ARM resource ID of the target 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 recovery 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 SnapshotRecoveryRequest + * + * @returns {object} metadata of SnapshotRecoveryRequest + * + */ + mapper() { + return { + required: false, + serializedName: 'SnapshotRecoveryRequest', + type: { + name: 'Composite', + className: 'SnapshotRecoveryRequest', + 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' + } + }, + recoveryTarget: { + required: false, + serializedName: 'properties.recoveryTarget', + type: { + name: 'Composite', + className: 'SnapshotRecoveryTarget' + } + }, + 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 = SnapshotRecoveryRequest; diff --git a/lib/services/websiteManagement2/lib/models/snapshotRecoveryTarget.js b/lib/services/websiteManagement2/lib/models/snapshotRecoveryTarget.js new file mode 100644 index 0000000000..9770a44e27 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/snapshotRecoveryTarget.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 written to. + * + */ +class SnapshotRecoveryTarget { + /** + * Create a SnapshotRecoveryTarget. + * @member {string} [location] Geographical location of the target web app, + * e.g. SouthEastAsia, SouthCentralUS + * @member {string} [id] ARM resource ID of the target 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 SnapshotRecoveryTarget + * + * @returns {object} metadata of SnapshotRecoveryTarget + * + */ + mapper() { + return { + required: false, + serializedName: 'SnapshotRecoveryTarget', + type: { + name: 'Composite', + className: 'SnapshotRecoveryTarget', + modelProperties: { + location: { + required: false, + serializedName: 'location', + type: { + name: 'String' + } + }, + id: { + required: false, + serializedName: 'id', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = SnapshotRecoveryTarget; diff --git a/lib/services/websiteManagement2/lib/models/solution.js b/lib/services/websiteManagement2/lib/models/solution.js new file mode 100644 index 0000000000..1b42d6409a --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/solution.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'); + +/** + * 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..0c0d72a318 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/sourceControl.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'); + +/** + * The source control OAuth token. + * + * @extends models['ProxyOnlyResource'] + */ +class SourceControl extends models['ProxyOnlyResource'] { + /** + * Create a SourceControl. + * @member {string} [sourceControlName] Name or source control type. + * @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' + } + }, + sourceControlName: { + required: false, + serializedName: 'properties.name', + 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..f8a3e54984 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/stackMajorVersion.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'); + +/** + * 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..8cb844d445 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/stampCapacity.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'; + +/** + * 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: 'Default', 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3' + * @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. + */ + 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: [ 'Default', 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3' ] + } + }, + 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' + } + } + } + } + }; + } +} + +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/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..76d8577eaf --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/topLevelDomain.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 top level domain object. + * + * @extends models['ProxyOnlyResource'] + */ +class TopLevelDomain extends models['ProxyOnlyResource'] { + /** + * Create a TopLevelDomain. + * @member {string} [domainName] Name of the top level domain. + * @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' + } + }, + domainName: { + required: false, + readOnly: true, + serializedName: 'properties.name', + 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..dda09c1cae --- /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} [triggeredJobRuns] 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' + } + }, + triggeredJobRuns: { + required: false, + serializedName: 'properties.triggeredJobRuns', + 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..dafb649e30 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/triggeredJobRun.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'); + +/** + * Triggered Web Job Run Information. + * + * @extends models['ProxyOnlyResource'] + */ +class TriggeredJobRun extends models['ProxyOnlyResource'] { + /** + * Create a TriggeredJobRun. + * @member {string} [triggeredJobRunId] Job ID. + * @member {string} [triggeredJobRunName] 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' + } + }, + triggeredJobRunId: { + required: false, + serializedName: 'properties.id', + type: { + name: 'String' + } + }, + triggeredJobRunName: { + required: false, + readOnly: true, + serializedName: 'properties.name', + type: { + name: 'String' + } + }, + status: { + required: false, + serializedName: 'properties.status', + type: { + name: 'Enum', + allowedValues: [ 'Success', 'Failed', 'Error' ] + } + }, + startTime: { + required: false, + serializedName: 'properties.startTime', + type: { + name: 'DateTime' + } + }, + endTime: { + required: false, + serializedName: 'properties.endTime', + type: { + name: 'DateTime' + } + }, + duration: { + required: false, + serializedName: 'properties.duration', + type: { + name: 'String' + } + }, + outputUrl: { + required: false, + serializedName: 'properties.outputUrl', + type: { + name: 'String' + } + }, + errorUrl: { + required: false, + serializedName: 'properties.errorUrl', + type: { + name: 'String' + } + }, + url: { + required: false, + serializedName: 'properties.url', + type: { + name: 'String' + } + }, + jobName: { + required: false, + serializedName: 'properties.jobName', + 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..076ffffe05 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/triggeredWebJob.js @@ -0,0 +1,191 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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.triggeredJobRunId] Job ID. + * @member {string} [latestRun.triggeredJobRunName] 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} [triggeredWebJobName] Job name. Used as job identifier in + * ARM resource URI. + * @member {string} [runCommand] Run command. + * @member {string} [url] Job URL. + * @member {string} [extraInfoUrl] Extra Info URL. + * @member {string} [jobType] 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.latestRun', + type: { + name: 'Composite', + className: 'TriggeredJobRun' + } + }, + historyUrl: { + required: false, + serializedName: 'properties.historyUrl', + type: { + name: 'String' + } + }, + schedulerLogsUrl: { + required: false, + serializedName: 'properties.schedulerLogsUrl', + type: { + name: 'String' + } + }, + triggeredWebJobName: { + required: false, + readOnly: true, + serializedName: 'properties.name', + type: { + name: 'String' + } + }, + runCommand: { + required: false, + serializedName: 'properties.runCommand', + type: { + name: 'String' + } + }, + url: { + required: false, + serializedName: 'properties.url', + type: { + name: 'String' + } + }, + extraInfoUrl: { + required: false, + serializedName: 'properties.extraInfoUrl', + type: { + name: 'String' + } + }, + jobType: { + required: false, + serializedName: 'properties.jobType', + type: { + name: 'Enum', + allowedValues: [ 'Continuous', 'Triggered' ] + } + }, + error: { + required: false, + serializedName: 'properties.error', + type: { + name: 'String' + } + }, + usingSdk: { + required: false, + serializedName: 'properties.usingSdk', + 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..a8bb508dd5 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/usage.js @@ -0,0 +1,162 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} [usageName] Name of the quota. + * @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' + } + }, + usageName: { + required: false, + readOnly: true, + serializedName: 'properties.name', + 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..8f3d0fbad6 --- /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} [userName] Username + * @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. + */ + 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' + } + }, + userName: { + required: false, + serializedName: 'properties.name', + 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' + } + } + } + } + }; + } +} + +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..479983a00f --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/validateRequest.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'; + +/** + * 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. + */ + 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' + } + } + } + } + }; + } +} + +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..e36d4735e4 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/validateResponse.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'); + +/** + * 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..c85bbd6402 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/virtualApplication.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'); + +/** + * 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..5df4cf5959 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/vnetRoute.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'); + +/** + * 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} [vnetRouteName] The name of this route. This is only + * returned by the server and does not need to be set by the client. + * @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' + } + }, + vnetRouteName: { + required: false, + serializedName: 'properties.name', + 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..8f2ed44730 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/webJob.js @@ -0,0 +1,154 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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} [webJobName] Job name. Used as job identifier in ARM + * resource URI. + * @member {string} [runCommand] Run command. + * @member {string} [url] Job URL. + * @member {string} [extraInfoUrl] Extra Info URL. + * @member {string} [jobType] 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' + } + }, + webJobName: { + required: false, + readOnly: true, + serializedName: 'properties.name', + type: { + name: 'String' + } + }, + runCommand: { + required: false, + serializedName: 'properties.runCommand', + type: { + name: 'String' + } + }, + url: { + required: false, + serializedName: 'properties.url', + type: { + name: 'String' + } + }, + extraInfoUrl: { + required: false, + serializedName: 'properties.extraInfoUrl', + type: { + name: 'String' + } + }, + jobType: { + required: false, + serializedName: 'properties.jobType', + type: { + name: 'Enum', + allowedValues: [ 'Continuous', 'Triggered' ] + } + }, + error: { + required: false, + serializedName: 'properties.error', + type: { + name: 'String' + } + }, + usingSdk: { + required: false, + serializedName: 'properties.usingSdk', + 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..66ac67f507 --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/appServiceCertificateOrders.js @@ -0,0 +1,6774 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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.'); + } + let apiVersion = '2015-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.CertificateRegistration/certificateOrders'; + 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['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.'); + } + let apiVersion = '2015-08-01'; + // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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; + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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 (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 = { + 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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 = { + 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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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..77b8ecdb35 --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/appServiceEnvironments.js @@ -0,0 +1,18725 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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.'); + } + let apiVersion = '2016-09-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.Web/hostingEnvironments'; + 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['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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 {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 {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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 {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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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; + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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 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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 _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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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._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._beginCreateOrUpdateMultiRolePool = _beginCreateOrUpdateMultiRolePool; + this._beginResume = _beginResume; + this._beginSuspend = _beginSuspend; + this._beginCreateOrUpdateWorkerPool = _beginCreateOrUpdateWorkerPool; + this._listNext = _listNext; + this._listByResourceGroupNext = _listByResourceGroupNext; + this._listCapacitiesNext = _listCapacitiesNext; + 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._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 {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 {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 {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 {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 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 {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 {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 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 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 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..418daf0d0c --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/appServicePlans.js @@ -0,0 +1,10483 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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; + let apiVersion = '2016-09-01'; + // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.appServicePlanName Name for the App Service + * plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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.appServicePlanPatchResourceName Name for the + * App Service plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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; + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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; + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.vnetRouteName] The name of this route. This is only + * returned by the server and does not need to be set by the client. + * + * @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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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.vnetRouteName] The name of this route. This is only + * returned by the server and does not need to be set by the client. + * + * @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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.appServicePlanName Name for the App Service + * plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.'); + } + let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.appServicePlanName Name for the App Service + * plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.appServicePlanName Name for the App Service + * plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.appServicePlanPatchResourceName Name for the + * App Service plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.appServicePlanPatchResourceName Name for the + * App Service plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.vnetRouteName] The name of this route. This is only + * returned by the server and does not need to be set by the client. + * + * @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.vnetRouteName] The name of this route. This is only + * returned by the server and does not need to be set by the client. + * + * @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.vnetRouteName] The name of this route. This is only + * returned by the server and does not need to be set by the client. + * + * @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.vnetRouteName] The name of this route. This is only + * returned by the server and does not need to be set by the client. + * + * @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.appServicePlanName Name for the App Service + * plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.appServicePlanName Name for the App Service + * plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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..d46700b376 --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/certificateRegistrationProvider.js @@ -0,0 +1,475 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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.'); + } + let apiVersion = '2015-08-01'; + // Validate + try { + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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..601943e575 --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/certificates.js @@ -0,0 +1,2089 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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.'); + } + let apiVersion = '2016-03-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.Web/certificates'; + 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['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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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..50d8c1e457 --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/deletedWebApps.js @@ -0,0 +1,467 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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.'); + } + let apiVersion = '2016-03-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.Web/deletedSites'; + 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['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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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..9eb79eb3f3 --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/diagnostics.js @@ -0,0 +1,6345 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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 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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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 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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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._listSiteDiagnosticCategories = _listSiteDiagnosticCategories; + this._getSiteDiagnosticCategory = _getSiteDiagnosticCategory; + this._listSiteAnalyses = _listSiteAnalyses; + this._getSiteAnalysis = _getSiteAnalysis; + this._executeSiteAnalysis = _executeSiteAnalysis; + this._listSiteDetectors = _listSiteDetectors; + this._getSiteDetector = _getSiteDetector; + this._executeSiteDetector = _executeSiteDetector; + 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._listSiteDiagnosticCategoriesNext = _listSiteDiagnosticCategoriesNext; + this._listSiteAnalysesNext = _listSiteAnalysesNext; + this._listSiteDetectorsNext = _listSiteDetectorsNext; + this._getSiteDetectorNext = _getSiteDetectorNext; + this._listSiteDiagnosticCategoriesSlotNext = _listSiteDiagnosticCategoriesSlotNext; + this._listSiteAnalysesSlotNext = _listSiteAnalysesSlotNext; + this._listSiteDetectorsSlotNext = _listSiteDetectorsSlotNext; + this._getSiteDetectorSlotNext = _getSiteDetectorSlotNext; + } + + /** + * @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 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 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 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..6de060c6f0 --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/domainRegistrationProvider.js @@ -0,0 +1,475 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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.'); + } + let apiVersion = '2015-04-01'; + // Validate + try { + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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..87984bef5e --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/domains.js @@ -0,0 +1,5682 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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; + let apiVersion = '2015-04-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 (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-04-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.DomainRegistration/domains'; + 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['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.'); + } + let apiVersion = '2015-04-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.DomainRegistration/generateSsoRequest'; + 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) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-04-01'; + // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(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.'); + } + let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(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.'); + } + let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + 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); + }); +} + +/** + * @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.'); + } + let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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/global.js b/lib/services/websiteManagement2/lib/operations/global.js new file mode 100644 index 0000000000..4491f2ad19 --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/global.js @@ -0,0 +1,257 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * 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 _getBillingMeters(options, callback) { + /* jshint 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 = '2016-03-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.Web/billingMeters'; + 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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BillingMeterElementType', + type: { + name: 'Composite', + className: 'BillingMeter' + } + } + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred 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 Global. */ +class Global { + /** + * Create a Global. + * @param {WebSiteManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._getBillingMeters = _getBillingMeters; + } + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getBillingMetersWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getBillingMeters(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 {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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. + */ + getBillingMeters(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getBillingMeters(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getBillingMeters(options, optionalCallback); + } + } + +} + +module.exports = Global; 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..2a958a79ea --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/index.d.ts @@ -0,0 +1,56076 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * 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 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 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 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 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 + * Global + * __NOTE__: An instance of this class is automatically created for an + * instance of the WebSiteManagementClient. + */ +export interface Global { + + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getBillingMetersWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Array} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Array} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getBillingMeters(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getBillingMeters(callback: ServiceCallback): void; + getBillingMeters(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Provider + * __NOTE__: An instance of this class is automatically created for an + * instance of the WebSiteManagementClient. + */ +export interface Provider { + + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getAvailableStacksWithHttpOperationResponse(options?: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplicationStackCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ApplicationStackCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationStackCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getAvailableStacks(options?: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + getAvailableStacks(callback: ServiceCallback): void; + getAvailableStacks(options: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listOperationsWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {CsmOperationCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CsmOperationCollection} [result] - The deserialized result object if an error did not occur. + * See {@link CsmOperationCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listOperations(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listOperations(callback: ServiceCallback): void; + listOperations(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getAvailableStacksOnPremWithHttpOperationResponse(options?: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplicationStackCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ApplicationStackCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationStackCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getAvailableStacksOnPrem(options?: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + getAvailableStacksOnPrem(callback: ServiceCallback): void; + getAvailableStacksOnPrem(options: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getAvailableStacksNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplicationStackCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ApplicationStackCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationStackCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getAvailableStacksNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getAvailableStacksNext(nextPageLink: string, callback: ServiceCallback): void; + getAvailableStacksNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listOperationsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {CsmOperationCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {CsmOperationCollection} [result] - The deserialized result object if an error did not occur. + * See {@link CsmOperationCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listOperationsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listOperationsNext(nextPageLink: string, callback: ServiceCallback): void; + listOperationsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getAvailableStacksOnPremNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ApplicationStackCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ApplicationStackCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationStackCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getAvailableStacksOnPremNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getAvailableStacksOnPremNext(nextPageLink: string, callback: ServiceCallback): void; + getAvailableStacksOnPremNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + +/** + * @class + * Recommendations + * __NOTE__: An instance of this class is automatically created for an + * instance of the WebSiteManagementClient. + */ +export interface Recommendations { + + + /** + * @summary List all recommendations for a subscription. + * + * List all recommendations for a subscription. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.featured] Specify true to return only + * the most critical recommendations. The default is false, which + * returns all recommendations. + * + * @param {string} [options.filter] Filter is specified by using OData syntax. + * Example: $filter=channels 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=channels 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 {string} [options.filter] Filter is specified by using OData syntax. + * Example: $filter=channels 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?: { 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 {string} [options.filter] Filter is specified by using OData syntax. + * Example: $filter=channels 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?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listHistoryForWebApp(resourceGroupName: string, siteName: string, callback: ServiceCallback): void; + listHistoryForWebApp(resourceGroupName: string, siteName: string, options: { 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=channels + * 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=channels + * 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 + * 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; +} + +/** + * @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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @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 {boolean} [options.skipDnsRegistration] If true, DNS registration is + * skipped. + * + * @param {object} [options.customHeaders] Headers that 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, skipDnsRegistration? : 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is + * skipped. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [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, skipDnsRegistration? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, name: string, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, name: string, options: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, skipDnsRegistration? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, callback: ServiceCallback): void; + update(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, options: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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 Discovers an existing app backup that can be restored from a blob + * in Azure storage. + * + * Discovers an existing app backup that can be restored from a 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 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' + * + * @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. + */ + discoverRestoreWithHttpOperationResponse(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. + * + * Discovers an existing app backup that can be restored from a 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 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' + * + * @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. + */ + discoverRestore(resourceGroupName: string, name: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + discoverRestore(resourceGroupName: string, name: string, request: models.RestoreRequest, callback: ServiceCallback): void; + discoverRestore(resourceGroupName: string, name: string, request: models.RestoreRequest, 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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' + * + * @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' + * + * @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 {RestoreResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RestoreResponse} [result] - The deserialized result object if an error did not occur. + * See {@link RestoreResponse} for more information. + * + * {WebResource} [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 {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 {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 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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 {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 {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 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 {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 {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 {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.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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 {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 {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 {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.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 {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 {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 {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.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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 {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 {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 {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.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. + */ + getWebSiteContainerLogsZipWithHttpOperationResponse(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. + */ + getWebSiteContainerLogsZip(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getWebSiteContainerLogsZip(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getWebSiteContainerLogsZip(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 {string} [deployment.deploymentId] Identifier for deployment. + * + * @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 {string} [deployment.deploymentId] Identifier for deployment. + * + * @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 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.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.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {FunctionEnvelope} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FunctionEnvelope} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionEnvelope} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createFunction(resourceGroupName: string, name: string, functionName: string, functionEnvelope: models.FunctionEnvelope, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createFunction(resourceGroupName: string, name: string, functionName: string, functionEnvelope: models.FunctionEnvelope, callback: ServiceCallback): void; + createFunction(resourceGroupName: string, name: string, functionName: string, functionEnvelope: models.FunctionEnvelope, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteFunctionWithHttpOperationResponse(resourceGroupName: string, name: string, functionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteFunction(resourceGroupName: string, name: string, functionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteFunction(resourceGroupName: string, name: string, functionName: string, callback: ServiceCallback): void; + deleteFunction(resourceGroupName: string, name: string, functionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listFunctionSecretsWithHttpOperationResponse(resourceGroupName: string, name: string, functionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {FunctionSecrets} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FunctionSecrets} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionSecrets} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listFunctionSecrets(resourceGroupName: string, name: string, functionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listFunctionSecrets(resourceGroupName: string, name: string, functionName: string, callback: ServiceCallback): void; + listFunctionSecrets(resourceGroupName: string, name: string, functionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listHostNameBindingsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HostNameBindingCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HostNameBindingCollection} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBindingCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listHostNameBindings(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHostNameBindings(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listHostNameBindings(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getHostNameBindingWithHttpOperationResponse(resourceGroupName: string, name: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HostNameBinding} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HostNameBinding} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBinding} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getHostNameBinding(resourceGroupName: string, name: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getHostNameBinding(resourceGroupName: string, name: string, hostName: string, callback: ServiceCallback): void; + getHostNameBinding(resourceGroupName: string, name: string, hostName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateHostNameBindingWithHttpOperationResponse(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HostNameBinding} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HostNameBinding} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBinding} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateHostNameBinding(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateHostNameBinding(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, callback: ServiceCallback): void; + createOrUpdateHostNameBinding(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteHostNameBindingWithHttpOperationResponse(resourceGroupName: string, name: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteHostNameBinding(resourceGroupName: string, name: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteHostNameBinding(resourceGroupName: string, name: string, hostName: string, callback: ServiceCallback): void; + deleteHostNameBinding(resourceGroupName: string, name: string, hostName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getHybridConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HybridConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, callback: ServiceCallback): void; + getHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateHybridConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HybridConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, callback: ServiceCallback): void; + createOrUpdateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteHybridConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, callback: ServiceCallback): void; + deleteHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateHybridConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HybridConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + updateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, callback: ServiceCallback): void; + updateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listHybridConnectionKeysWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HybridConnectionKey} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HybridConnectionKey} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnectionKey} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listHybridConnectionKeys(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHybridConnectionKeys(resourceGroupName: string, name: string, namespaceName: string, relayName: string, callback: ServiceCallback): void; + listHybridConnectionKeys(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listHybridConnectionsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HybridConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listHybridConnections(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHybridConnections(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listHybridConnections(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listRelayServiceConnectionsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listRelayServiceConnections(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listRelayServiceConnections(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listRelayServiceConnections(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getRelayServiceConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, callback: ServiceCallback): void; + getRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateRelayServiceConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, callback: ServiceCallback): void; + createOrUpdateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteRelayServiceConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, callback: ServiceCallback): void; + deleteRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateRelayServiceConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + updateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, callback: ServiceCallback): void; + updateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listInstanceIdentifiersWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {WebAppInstanceCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {WebAppInstanceCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppInstanceCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceIdentifiers(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceIdentifiers(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listInstanceIdentifiers(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getInstanceMsDeployStatusWithHttpOperationResponse(resourceGroupName: string, name: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MSDeployStatus} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MSDeployStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceMsDeployStatus(resourceGroupName: string, name: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceMsDeployStatus(resourceGroupName: string, name: string, instanceId: string, callback: ServiceCallback): void; + getInstanceMsDeployStatus(resourceGroupName: string, name: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createInstanceMSDeployOperationWithHttpOperationResponse(resourceGroupName: string, name: string, instanceId: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MSDeployStatus} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MSDeployStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createInstanceMSDeployOperation(resourceGroupName: string, name: string, instanceId: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createInstanceMSDeployOperation(resourceGroupName: string, name: string, instanceId: string, mSDeploy: models.MSDeploy, callback: ServiceCallback): void; + createInstanceMSDeployOperation(resourceGroupName: string, name: string, instanceId: string, mSDeploy: models.MSDeploy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getInstanceMSDeployLogWithHttpOperationResponse(resourceGroupName: string, name: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MSDeployLog} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MSDeployLog} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployLog} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceMSDeployLog(resourceGroupName: string, name: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceMSDeployLog(resourceGroupName: string, name: string, instanceId: string, callback: ServiceCallback): void; + getInstanceMSDeployLog(resourceGroupName: string, name: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listInstanceProcessesWithHttpOperationResponse(resourceGroupName: string, name: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProcessInfoCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProcessInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfoCollection} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceProcesses(resourceGroupName: string, name: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceProcesses(resourceGroupName: string, name: string, instanceId: string, callback: ServiceCallback): void; + listInstanceProcesses(resourceGroupName: string, name: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getInstanceProcessWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProcessInfo} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProcessInfo} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfo} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, callback: ServiceCallback): void; + getInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteInstanceProcessWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, callback: ServiceCallback): void; + deleteInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getInstanceProcessDumpWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Object} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Object} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessDump(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceProcessDump(resourceGroupName: string, name: string, processId: string, instanceId: string, callback: ServiceCallback): void; + getInstanceProcessDump(resourceGroupName: string, name: string, processId: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listInstanceProcessModulesWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProcessModuleInfoCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProcessModuleInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfoCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceProcessModules(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceProcessModules(resourceGroupName: string, name: string, processId: string, instanceId: string, callback: ServiceCallback): void; + listInstanceProcessModules(resourceGroupName: string, name: string, processId: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getInstanceProcessModuleWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, baseAddress: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProcessModuleInfo} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProcessModuleInfo} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfo} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessModule(resourceGroupName: string, name: string, processId: string, baseAddress: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceProcessModule(resourceGroupName: string, name: string, processId: string, baseAddress: string, instanceId: string, callback: ServiceCallback): void; + getInstanceProcessModule(resourceGroupName: string, name: string, processId: string, baseAddress: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listInstanceProcessThreadsWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProcessThreadInfoCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProcessThreadInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfoCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceProcessThreads(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceProcessThreads(resourceGroupName: string, name: string, processId: string, instanceId: string, callback: ServiceCallback): void; + listInstanceProcessThreads(resourceGroupName: string, name: string, processId: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getInstanceProcessThreadWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, threadId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProcessThreadInfo} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProcessThreadInfo} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfo} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessThread(resourceGroupName: string, name: string, processId: string, threadId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceProcessThread(resourceGroupName: string, name: string, processId: string, threadId: string, instanceId: string, callback: ServiceCallback): void; + getInstanceProcessThread(resourceGroupName: string, name: string, processId: string, threadId: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + isCloneableWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SiteCloneability} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SiteCloneability} [result] - The deserialized result object if an error did not occur. + * See {@link SiteCloneability} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + isCloneable(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + isCloneable(resourceGroupName: string, name: string, callback: ServiceCallback): void; + isCloneable(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listSyncFunctionTriggersWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {FunctionSecrets} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FunctionSecrets} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionSecrets} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listSyncFunctionTriggers(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSyncFunctionTriggers(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listSyncFunctionTriggers(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listMetricDefinitionsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ResourceMetricDefinitionCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ResourceMetricDefinitionCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricDefinitionCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listMetricDefinitions(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetricDefinitions(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listMetricDefinitions(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime + * eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listMetricsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime + * eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ResourceMetricCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ResourceMetricCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listMetrics(resourceGroupName: string, name: string, options?: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listMetrics(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listMetrics(resourceGroupName: string, name: string, options: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Restores a web app. + * + * Restores a web app. + * + * @param {string} subscriptionName Azure subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationOptions Migration migrationOptions. + * + * @param {string} migrationOptions.azurefilesConnectionString AzureFiles + * connection string. + * + * @param {string} migrationOptions.azurefilesShare AzureFiles share. + * + * @param {boolean} [migrationOptions.switchSiteAfterMigration] + * trueif the app should be switched over; otherwise, + * false. + * + * @param {boolean} [migrationOptions.blockWriteAccessToSite] true + * if the app should be read only during copy operation; otherwise, + * false. + * + * @param {string} [migrationOptions.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + migrateStorageWithHttpOperationResponse(subscriptionName: string, resourceGroupName: string, name: string, migrationOptions: models.StorageMigrationOptions, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Restores a web app. + * + * Restores a web app. + * + * @param {string} subscriptionName Azure subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationOptions Migration migrationOptions. + * + * @param {string} migrationOptions.azurefilesConnectionString AzureFiles + * connection string. + * + * @param {string} migrationOptions.azurefilesShare AzureFiles share. + * + * @param {boolean} [migrationOptions.switchSiteAfterMigration] + * trueif the app should be switched over; otherwise, + * false. + * + * @param {boolean} [migrationOptions.blockWriteAccessToSite] true + * if the app should be read only during copy operation; otherwise, + * false. + * + * @param {string} [migrationOptions.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {StorageMigrationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {StorageMigrationResponse} [result] - The deserialized result object if an error did not occur. + * See {@link StorageMigrationResponse} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + migrateStorage(subscriptionName: string, resourceGroupName: string, name: string, migrationOptions: models.StorageMigrationOptions, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + migrateStorage(subscriptionName: string, resourceGroupName: string, name: string, migrationOptions: models.StorageMigrationOptions, callback: ServiceCallback): void; + migrateStorage(subscriptionName: string, resourceGroupName: string, name: string, migrationOptions: models.StorageMigrationOptions, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Migrates a local (in-app) MySql database to a remote MySql + * database. + * + * Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationRequestEnvelope MySql migration options. + * + * @param {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. + * + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' + * + * @param {string} [migrationRequestEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + migrateMySqlWithHttpOperationResponse(resourceGroupName: string, name: string, migrationRequestEnvelope: models.MigrateMySqlRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Migrates a local (in-app) MySql database to a remote MySql + * database. + * + * Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationRequestEnvelope MySql migration options. + * + * @param {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. + * + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' + * + * @param {string} [migrationRequestEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Operation} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Operation} [result] - The deserialized result object if an error did not occur. + * See {@link Operation} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + migrateMySql(resourceGroupName: string, name: string, migrationRequestEnvelope: models.MigrateMySqlRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + migrateMySql(resourceGroupName: string, name: string, migrationRequestEnvelope: models.MigrateMySqlRequest, callback: ServiceCallback): void; + migrateMySql(resourceGroupName: string, name: string, migrationRequestEnvelope: models.MigrateMySqlRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getMigrateMySqlStatusWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MigrateMySqlStatus} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MigrateMySqlStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MigrateMySqlStatus} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getMigrateMySqlStatus(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getMigrateMySqlStatus(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getMigrateMySqlStatus(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNetworkFeaturesWithHttpOperationResponse(resourceGroupName: string, name: string, view: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkFeatures} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {NetworkFeatures} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkFeatures} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNetworkFeatures(resourceGroupName: string, name: string, view: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNetworkFeatures(resourceGroupName: string, name: string, view: string, callback: ServiceCallback): void; + listNetworkFeatures(resourceGroupName: string, name: string, view: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + startWebSiteNetworkTraceWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {String} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {String} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + startWebSiteNetworkTrace(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + startWebSiteNetworkTrace(resourceGroupName: string, name: string, callback: ServiceCallback): void; + startWebSiteNetworkTrace(resourceGroupName: string, name: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + stopWebSiteNetworkTraceWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {String} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {String} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + stopWebSiteNetworkTrace(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + stopWebSiteNetworkTrace(resourceGroupName: string, name: string, callback: ServiceCallback): void; + stopWebSiteNetworkTrace(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + generateNewSitePublishingPasswordWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + generateNewSitePublishingPassword(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + generateNewSitePublishingPassword(resourceGroupName: string, name: string, callback: ServiceCallback): void; + generateNewSitePublishingPassword(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain + * eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listPerfMonCountersWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain + * eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PerfMonCounterCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {PerfMonCounterCollection} [result] - The deserialized result object if an error did not occur. + * See {@link PerfMonCounterCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listPerfMonCounters(resourceGroupName: string, name: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listPerfMonCounters(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listPerfMonCounters(resourceGroupName: string, name: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getSitePhpErrorLogFlagWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SitePhpErrorLogFlag} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SitePhpErrorLogFlag} [result] - The deserialized result object if an error did not occur. + * See {@link SitePhpErrorLogFlag} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getSitePhpErrorLogFlag(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSitePhpErrorLogFlag(resourceGroupName: string, name: string, callback: ServiceCallback): void; + getSitePhpErrorLogFlag(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listPremierAddOnsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PremierAddOn} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {PremierAddOn} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listPremierAddOns(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listPremierAddOns(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listPremierAddOns(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getPremierAddOnWithHttpOperationResponse(resourceGroupName: string, name: string, premierAddOnName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PremierAddOn} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {PremierAddOn} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getPremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getPremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, callback: ServiceCallback): void; + getPremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. + * + * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. + * + * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. + * + * @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.premierAddOnName] Premier add on Name. + * + * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. + * + * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. + * + * @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 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} [options] Optional Parameters. + * + * @param {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {object} [options.customHeaders] Headers that 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, options?: { format? : string, 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} [options] Optional Parameters. + * + * @param {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, options?: { format? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, options: { format? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + recoverWithHttpOperationResponse(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. + */ + recover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + recover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, callback: ServiceCallback): void; + recover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, 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 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is + * skipped. + * + * @param {object} [options.customHeaders] Headers that 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, skipDnsRegistration? : 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is + * skipped. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [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, skipDnsRegistration? : 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, skipDnsRegistration? : 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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 Discovers an existing app backup that can be restored from a blob + * in Azure storage. + * + * Discovers an existing app backup that can be restored from a 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 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' + * + * @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. + */ + discoverRestoreSlotWithHttpOperationResponse(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. + * + * Discovers an existing app backup that can be restored from a 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 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' + * + * @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. + */ + discoverRestoreSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + discoverRestoreSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, callback: ServiceCallback): void; + discoverRestoreSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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' + * + * @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' + * + * @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 {RestoreResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RestoreResponse} [result] - The deserialized result object if an error did not occur. + * See {@link RestoreResponse} for more information. + * + * {WebResource} [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 {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 {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 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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 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 {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 {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 {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.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 {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 {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 {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.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 {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 {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 {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.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 {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 {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 {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.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. + */ + getWebSiteContainerLogsZipSlotWithHttpOperationResponse(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. + */ + getWebSiteContainerLogsZipSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getWebSiteContainerLogsZipSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + getWebSiteContainerLogsZipSlot(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 {string} [deployment.deploymentId] Identifier for deployment. + * + * @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 {string} [deployment.deploymentId] Identifier for deployment. + * + * @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 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.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.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {FunctionEnvelope} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FunctionEnvelope} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionEnvelope} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, functionEnvelope: models.FunctionEnvelope, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, functionEnvelope: models.FunctionEnvelope, callback: ServiceCallback): void; + createInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, functionEnvelope: models.FunctionEnvelope, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteInstanceFunctionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, functionName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, callback: ServiceCallback): void; + deleteInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listFunctionSecretsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, functionName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {FunctionSecrets} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FunctionSecrets} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionSecrets} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listFunctionSecretsSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listFunctionSecretsSlot(resourceGroupName: string, name: string, functionName: string, slot: string, callback: ServiceCallback): void; + listFunctionSecretsSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets hostname bindings for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listHostNameBindingsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets hostname bindings for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HostNameBindingCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HostNameBindingCollection} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBindingCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listHostNameBindingsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHostNameBindingsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listHostNameBindingsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API the named binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getHostNameBindingSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API the named binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HostNameBinding} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HostNameBinding} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBinding} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, callback: ServiceCallback): void; + getHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create a binding for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateHostNameBindingSlotWithHttpOperationResponse(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create a binding for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HostNameBinding} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HostNameBinding} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBinding} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateHostNameBindingSlot(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateHostNameBindingSlot(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, slot: string, callback: ServiceCallback): void; + createOrUpdateHostNameBindingSlot(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteHostNameBindingSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, callback: ServiceCallback): void; + deleteHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getHybridConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HybridConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, callback: ServiceCallback): void; + getHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateHybridConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HybridConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, callback: ServiceCallback): void; + createOrUpdateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteHybridConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, callback: ServiceCallback): void; + deleteHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateHybridConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HybridConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + updateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, callback: ServiceCallback): void; + updateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listHybridConnectionKeysSlotWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HybridConnectionKey} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HybridConnectionKey} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnectionKey} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listHybridConnectionKeysSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHybridConnectionKeysSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, callback: ServiceCallback): void; + listHybridConnectionKeysSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listHybridConnectionsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {HybridConnection} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listHybridConnectionsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listHybridConnectionsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listHybridConnectionsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get hybrid connections for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listRelayServiceConnectionsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get hybrid connections for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listRelayServiceConnectionsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listRelayServiceConnectionsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listRelayServiceConnectionsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a hybrid connection for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a hybrid connection for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, callback: ServiceCallback): void; + getRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createOrUpdateRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, callback: ServiceCallback): void; + createOrUpdateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete a hybrid connection for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete a hybrid connection for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, callback: ServiceCallback): void; + deleteRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + updateRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + updateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + updateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, callback: ServiceCallback): void; + updateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets the production slot instances. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listInstanceIdentifiersSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets the production slot instances. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {WebAppInstanceCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {WebAppInstanceCollection} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppInstanceCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceIdentifiersSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceIdentifiersSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listInstanceIdentifiersSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getInstanceMsDeployStatusSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MSDeployStatus} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MSDeployStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceMsDeployStatusSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceMsDeployStatusSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, callback: ServiceCallback): void; + getInstanceMsDeployStatusSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + createInstanceMSDeployOperationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, instanceId: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MSDeployStatus} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MSDeployStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + createInstanceMSDeployOperationSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + createInstanceMSDeployOperationSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, mSDeploy: models.MSDeploy, callback: ServiceCallback): void; + createInstanceMSDeployOperationSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, mSDeploy: models.MSDeploy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getInstanceMSDeployLogSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MSDeployLog} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MSDeployLog} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployLog} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceMSDeployLogSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceMSDeployLogSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, callback: ServiceCallback): void; + getInstanceMSDeployLogSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listInstanceProcessesSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProcessInfoCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProcessInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfoCollection} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceProcessesSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceProcessesSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, callback: ServiceCallback): void; + listInstanceProcessesSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getInstanceProcessSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProcessInfo} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProcessInfo} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfo} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, callback: ServiceCallback): void; + getInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + deleteInstanceProcessSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + deleteInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + deleteInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, callback: ServiceCallback): void; + deleteInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getInstanceProcessDumpSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {Object} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {Object} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessDumpSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceProcessDumpSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, callback: ServiceCallback): void; + getInstanceProcessDumpSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listInstanceProcessModulesSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProcessModuleInfoCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProcessModuleInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfoCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceProcessModulesSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceProcessModulesSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, callback: ServiceCallback): void; + listInstanceProcessModulesSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getInstanceProcessModuleSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProcessModuleInfo} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProcessModuleInfo} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfo} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessModuleSlot(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceProcessModuleSlot(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, instanceId: string, callback: ServiceCallback): void; + getInstanceProcessModuleSlot(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listInstanceProcessThreadsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProcessThreadInfoCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProcessThreadInfoCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfoCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceProcessThreadsSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listInstanceProcessThreadsSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, callback: ServiceCallback): void; + listInstanceProcessThreadsSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getInstanceProcessThreadSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ProcessThreadInfo} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ProcessThreadInfo} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfo} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessThreadSlot(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getInstanceProcessThreadSlot(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, instanceId: string, callback: ServiceCallback): void; + getInstanceProcessThreadSlot(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. By default, this API + * returns information on the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + isCloneableSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. By default, this API + * returns information on the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SiteCloneability} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SiteCloneability} [result] - The deserialized result object if an error did not occur. + * See {@link SiteCloneability} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + isCloneableSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + isCloneableSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + isCloneableSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listSyncFunctionTriggersSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {FunctionSecrets} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {FunctionSecrets} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionSecrets} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listSyncFunctionTriggersSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listSyncFunctionTriggersSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listSyncFunctionTriggersSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metric definitions of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listMetricDefinitionsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metric definitions of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ResourceMetricDefinitionCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ResourceMetricDefinitionCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricDefinitionCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listMetricDefinitionsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listMetricDefinitionsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listMetricDefinitionsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metrics of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime + * eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listMetricsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metrics of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime + * eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {ResourceMetricCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {ResourceMetricCollection} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listMetricsSlot(resourceGroupName: string, name: string, slot: string, options?: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listMetricsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listMetricsSlot(resourceGroupName: string, name: string, slot: string, options: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of the deployment slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getMigrateMySqlStatusSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of the deployment slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {MigrateMySqlStatus} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {MigrateMySqlStatus} [result] - The deserialized result object if an error did not occur. + * See {@link MigrateMySqlStatus} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getMigrateMySqlStatusSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getMigrateMySqlStatusSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + getMigrateMySqlStatusSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get network features for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNetworkFeaturesSlotWithHttpOperationResponse(resourceGroupName: string, name: string, view: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get network features for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {NetworkFeatures} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {NetworkFeatures} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkFeatures} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNetworkFeaturesSlot(resourceGroupName: string, name: string, view: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNetworkFeaturesSlot(resourceGroupName: string, name: string, view: string, slot: string, callback: ServiceCallback): void; + listNetworkFeaturesSlot(resourceGroupName: string, name: string, view: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + startWebSiteNetworkTraceSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {String} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {String} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + startWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + startWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + startWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + stopWebSiteNetworkTraceSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {String} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {String} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + stopWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + stopWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + stopWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API generate a new publishing password for the production + * slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + generateNewSitePublishingPasswordSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API generate a new publishing password for the production + * slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + generateNewSitePublishingPasswordSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + generateNewSitePublishingPasswordSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + generateNewSitePublishingPasswordSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain + * eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listPerfMonCountersSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain + * eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PerfMonCounterCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {PerfMonCounterCollection} [result] - The deserialized result object if an error did not occur. + * See {@link PerfMonCounterCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listPerfMonCountersSlot(resourceGroupName: string, name: string, slot: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listPerfMonCountersSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listPerfMonCountersSlot(resourceGroupName: string, name: string, slot: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getSitePhpErrorLogFlagSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {SitePhpErrorLogFlag} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {SitePhpErrorLogFlag} [result] - The deserialized result object if an error did not occur. + * See {@link SitePhpErrorLogFlag} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getSitePhpErrorLogFlagSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getSitePhpErrorLogFlagSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + getSitePhpErrorLogFlagSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the premier add-ons for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listPremierAddOnsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the premier add-ons for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PremierAddOn} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {PremierAddOn} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listPremierAddOnsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listPremierAddOnsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listPremierAddOnsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the named add-on for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + getPremierAddOnSlotWithHttpOperationResponse(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the named add-on for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {PremierAddOn} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {PremierAddOn} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} for more information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + getPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + getPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, callback: ServiceCallback): void; + getPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. + * + * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. + * + * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. + * + * @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.premierAddOnName] Premier add on Name. + * + * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. + * + * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. + * + * @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 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 {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 {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {object} [options.customHeaders] Headers that 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, slot: string, options?: { format? : string, 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 {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 {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, slot: string, options?: { format? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listPublishingProfileXmlWithSecretsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; + listPublishingProfileXmlWithSecretsSlot(resourceGroupName: string, name: string, slot: string, options: { format? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. + */ + recoverSlotWithHttpOperationResponse(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. + */ + recoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + recoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, callback: ServiceCallback): void; + recoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, 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 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @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' + * + * @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' + * + * @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 {RestoreResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RestoreResponse} [result] - The deserialized result object if an error did not occur. + * See {@link RestoreResponse} for more information. + * + * {WebResource} [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.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.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 Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + beginRecoverWithHttpOperationResponse(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. + */ + beginRecover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRecover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, callback: ServiceCallback): void; + beginRecover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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' + * + * @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' + * + * @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 {RestoreResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {RestoreResponse} [result] - The deserialized result object if an error did not occur. + * See {@link RestoreResponse} for more information. + * + * {WebResource} [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.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.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 Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. + */ + beginRecoverSlotWithHttpOperationResponse(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. + */ + beginRecoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + beginRecoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, callback: ServiceCallback): void; + beginRecoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, 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 {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 {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 {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 {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 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 {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 {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 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 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 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.appServicePlanName Name for the App Service + * plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.appServicePlanName Name for the App Service + * plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.appServicePlanPatchResourceName Name for the + * App Service plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.appServicePlanPatchResourceName Name for the + * App Service plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.vnetRouteName] The name of this route. This is only + * returned by the server and does not need to be set by the client. + * + * @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.vnetRouteName] The name of this route. This is only + * returned by the server and does not need to be set by the client. + * + * @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.vnetRouteName] The name of this route. This is only + * returned by the server and does not need to be set by the client. + * + * @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.vnetRouteName] The name of this route. This is only + * returned by the server and does not need to be set by the client. + * + * @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.appServicePlanName Name for the App Service + * plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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.appServicePlanName Name for the App Service + * plan. + * + * @param {string} [appServicePlan.workerTierName] Target worker tier assigned + * to the App Service plan. + * + * @param {string} [appServicePlan.adminSiteName] App Service plan + * administration site. + * + * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for + * the App Service Environment to use for the App Service plan. + * + * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of + * the App Service Environment. + * + * @param {boolean} [appServicePlan.perSiteScaling] If true, apps + * assigned to this App Service plan can be scaled independently. + * If false, apps assigned to this App Service plan will scale to + * all instances of the plan. + * + * @param {boolean} [appServicePlan.isSpot] If true, this App + * Service Plan owns spot instances. + * + * @param {date} [appServicePlan.spotExpirationTime] The time when the server + * farm expires. Valid only if it is a spot server farm. + * + * @param {boolean} [appServicePlan.reserved] If Linux 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; +} diff --git a/lib/services/websiteManagement2/lib/operations/index.js b/lib/services/websiteManagement2/lib/operations/index.js new file mode 100644 index 0000000000..a7f2101d8e --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/index.js @@ -0,0 +1,31 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * 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.Global = require('./global'); +exports.Provider = require('./provider'); +exports.Recommendations = require('./recommendations'); +exports.ResourceHealthMetadataOperations = require('./resourceHealthMetadataOperations'); +exports.WebApps = require('./webApps'); +exports.AppServiceEnvironments = require('./appServiceEnvironments'); +exports.AppServicePlans = require('./appServicePlans'); diff --git a/lib/services/websiteManagement2/lib/operations/provider.js b/lib/services/websiteManagement2/lib/operations/provider.js new file mode 100644 index 0000000000..e65baac626 --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/provider.js @@ -0,0 +1,1379 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationStackCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getAvailableStacks(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let osTypeSelected = (options && options.osTypeSelected !== undefined) ? options.osTypeSelected : undefined; + let apiVersion = '2016-03-01'; + // Validate + try { + if (osTypeSelected !== null && osTypeSelected !== undefined && typeof osTypeSelected.valueOf() !== 'string') { + throw new Error('osTypeSelected must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-01'; + // Validate + try { + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['CsmOperationCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationStackCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _getAvailableStacksOnPrem(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let osTypeSelected = (options && options.osTypeSelected !== undefined) ? options.osTypeSelected : undefined; + let apiVersion = '2016-03-01'; + // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['ApplicationStackCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a Provider. */ +class Provider { + /** + * Create a Provider. + * @param {WebSiteManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._getAvailableStacks = _getAvailableStacks; + this._listOperations = _listOperations; + this._getAvailableStacksOnPrem = _getAvailableStacksOnPrem; + this._getAvailableStacksNext = _getAvailableStacksNext; + this._listOperationsNext = _listOperationsNext; + this._getAvailableStacksOnPremNext = _getAvailableStacksOnPremNext; + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getAvailableStacksWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getAvailableStacks(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ApplicationStackCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationStackCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getAvailableStacks(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getAvailableStacks(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getAvailableStacks(options, optionalCallback); + } + } + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listOperationsWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listOperations(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {CsmOperationCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CsmOperationCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listOperations(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listOperations(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listOperations(options, optionalCallback); + } + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getAvailableStacksOnPremWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getAvailableStacksOnPrem(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ApplicationStackCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationStackCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getAvailableStacksOnPrem(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getAvailableStacksOnPrem(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getAvailableStacksOnPrem(options, optionalCallback); + } + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getAvailableStacksNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getAvailableStacksNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ApplicationStackCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationStackCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getAvailableStacksNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getAvailableStacksNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getAvailableStacksNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listOperationsNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listOperationsNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets all available operations for the Microsoft.Web resource + * provider. Also exposes resource metric definitions + * + * Gets all available operations for the Microsoft.Web resource provider. Also + * exposes resource metric definitions + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {CsmOperationCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link CsmOperationCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listOperationsNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listOperationsNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listOperationsNext(nextPageLink, options, optionalCallback); + } + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getAvailableStacksOnPremNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getAvailableStacksOnPremNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get available application frameworks and their versions + * + * Get available application frameworks and their versions + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ApplicationStackCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ApplicationStackCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getAvailableStacksOnPremNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getAvailableStacksOnPremNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getAvailableStacksOnPremNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = Provider; diff --git a/lib/services/websiteManagement2/lib/operations/recommendations.js b/lib/services/websiteManagement2/lib/operations/recommendations.js new file mode 100644 index 0000000000..66adb54b6a --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/recommendations.js @@ -0,0 +1,2944 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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=channels 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; + let apiVersion = '2016-03-01'; + // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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.Web/recommendations/reset'; + 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 !== 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.'); + } + let apiVersion = '2016-03-01'; + // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 {string} [options.filter] Filter is specified by using OData syntax. + * Example: $filter=channels 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 filter = (options && options.filter !== undefined) ? options.filter : undefined; + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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 (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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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 (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + 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['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=channels + * 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; + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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; + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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=channels 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=channels 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 {string} [options.filter] Filter is specified by using OData syntax. + * Example: $filter=channels 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 {string} [options.filter] Filter is specified by using OData syntax. + * Example: $filter=channels 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=channels + * 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=channels + * 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..22c45328e6 --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/resourceHealthMetadataOperations.js @@ -0,0 +1,2470 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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.'); + } + let apiVersion = '2016-03-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.Web/resourceHealthMetadata'; + 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['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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..ed6c81ea55 --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/topLevelDomains.js @@ -0,0 +1,1200 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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.'); + } + let apiVersion = '2015-04-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.DomainRegistration/topLevelDomains'; + 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['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.'); + } + let apiVersion = '2015-04-01'; + // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2015-04-01'; + // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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..5512ecb8d8 --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/webApps.js @@ -0,0 +1,116459 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * 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.'); + } + let apiVersion = '2016-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.Web/sites'; + 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['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; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is + * skipped. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [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; + let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { + throw new Error('skipDnsRegistration must be of type boolean.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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())); + } + if (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { + queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); + } + 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 && 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} 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.'); + } + let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; + let skipCustomDomainVerification = (options && options.skipCustomDomainVerification !== undefined) ? options.skipCustomDomainVerification : undefined; + let forceDnsRegistration = (options && options.forceDnsRegistration !== undefined) ? options.forceDnsRegistration : undefined; + let ttlInSeconds = (options && options.ttlInSeconds !== undefined) ? options.ttlInSeconds : undefined; + let apiVersion = '2016-08-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { + throw new Error('skipDnsRegistration must be of type boolean.'); + } + if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined && typeof skipCustomDomainVerification !== 'boolean') { + throw new Error('skipCustomDomainVerification must be of type boolean.'); + } + if (forceDnsRegistration !== null && forceDnsRegistration !== undefined && typeof forceDnsRegistration !== 'boolean') { + throw new Error('forceDnsRegistration must be of type boolean.'); + } + if (ttlInSeconds !== null && ttlInSeconds !== undefined && typeof ttlInSeconds.valueOf() !== 'string') { + throw new Error('ttlInSeconds must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { + queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); + } + if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined) { + queryParameters.push('skipCustomDomainVerification=' + encodeURIComponent(skipCustomDomainVerification.toString())); + } + if (forceDnsRegistration !== null && forceDnsRegistration !== undefined) { + queryParameters.push('forceDnsRegistration=' + encodeURIComponent(forceDnsRegistration.toString())); + } + if (ttlInSeconds !== null && ttlInSeconds !== undefined) { + queryParameters.push('ttlInSeconds=' + encodeURIComponent(ttlInSeconds)); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Discovers an existing app backup that can be restored from a blob + * in Azure storage. + * + * Discovers an existing app backup that can be restored from a 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 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' + * + * @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 _discoverRestore(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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/discover'; + 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(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['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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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' + * + * @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 RestoreResponse} for more information. + * + * {object} [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 + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RestoreResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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 {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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 {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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 {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 {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 {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.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 {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 {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 {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.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 _getWebSiteContainerLogsZip(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 apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 {string} [deployment.deploymentId] Identifier for deployment. + * + * @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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['NetworkFeatures']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let durationInSeconds = (options && options.durationInSeconds !== undefined) ? options.durationInSeconds : undefined; + let maxFrameLength = (options && options.maxFrameLength !== undefined) ? options.maxFrameLength : undefined; + let sasUrl = (options && options.sasUrl !== undefined) ? options.sasUrl : undefined; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _generateNewSitePublishingPassword(resourceGroupName, name, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.premierAddOnName] Premier add on Name. + * + * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. + * + * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. + * + * @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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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} [options] Optional Parameters. + * + * @param {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, 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, options, callback) { + /* jshint 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 format = (options && options.format !== undefined) ? options.format : undefined; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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 (format !== null && format !== undefined && typeof format.valueOf() !== 'string') { + throw new Error('format must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.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 publishingProfileOptions; + if (format !== null && format !== undefined) { + publishingProfileOptions = new client.models['CsmPublishingProfileOptions'](); + publishingProfileOptions.format = format; + } + + // 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.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 Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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 _recover(resourceGroupName, name, recoveryEntity, options, callback) { + /* jshint 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.beginRecover(resourceGroupName, name, recoveryEntity, 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 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is + * skipped. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [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; + let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { + throw new Error('skipDnsRegistration must be of type boolean.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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())); + } + if (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { + queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); + } + 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 && 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} 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.'); + } + let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; + let skipCustomDomainVerification = (options && options.skipCustomDomainVerification !== undefined) ? options.skipCustomDomainVerification : undefined; + let forceDnsRegistration = (options && options.forceDnsRegistration !== undefined) ? options.forceDnsRegistration : undefined; + let ttlInSeconds = (options && options.ttlInSeconds !== undefined) ? options.ttlInSeconds : undefined; + let apiVersion = '2016-08-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { + throw new Error('skipDnsRegistration must be of type boolean.'); + } + if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined && typeof skipCustomDomainVerification !== 'boolean') { + throw new Error('skipCustomDomainVerification must be of type boolean.'); + } + if (forceDnsRegistration !== null && forceDnsRegistration !== undefined && typeof forceDnsRegistration !== 'boolean') { + throw new Error('forceDnsRegistration must be of type boolean.'); + } + if (ttlInSeconds !== null && ttlInSeconds !== undefined && typeof ttlInSeconds.valueOf() !== 'string') { + throw new Error('ttlInSeconds must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { + queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); + } + if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined) { + queryParameters.push('skipCustomDomainVerification=' + encodeURIComponent(skipCustomDomainVerification.toString())); + } + if (forceDnsRegistration !== null && forceDnsRegistration !== undefined) { + queryParameters.push('forceDnsRegistration=' + encodeURIComponent(forceDnsRegistration.toString())); + } + if (ttlInSeconds !== null && ttlInSeconds !== undefined) { + queryParameters.push('ttlInSeconds=' + encodeURIComponent(ttlInSeconds)); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Discovers an existing app backup that can be restored from a blob + * in Azure storage. + * + * Discovers an existing app backup that can be restored from a 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 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' + * + * @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 _discoverRestoreSlot(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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/discover'; + 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(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['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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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' + * + * @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. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestoreResponse} for more information. + * + * {object} [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 + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RestoreResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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 {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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 {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 {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 {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.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 {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 {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 {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.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 _getWebSiteContainerLogsZipSlot(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 apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 {string} [deployment.deploymentId] Identifier for deployment. + * + * @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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200 && statusCode !== 404) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['NetworkFeatures']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let durationInSeconds = (options && options.durationInSeconds !== undefined) ? options.durationInSeconds : undefined; + let maxFrameLength = (options && options.maxFrameLength !== undefined) ? options.maxFrameLength : undefined; + let sasUrl = (options && options.sasUrl !== undefined) ? options.sasUrl : undefined; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API generate a new publishing password for the production + * slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.premierAddOnName] Premier add on Name. + * + * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. + * + * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. + * + * @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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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 {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 {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, 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, slot, options, callback) { + /* jshint 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 format = (options && options.format !== undefined) ? options.format : undefined; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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 (format !== null && format !== undefined && typeof format.valueOf() !== 'string') { + throw new Error('format must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.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 publishingProfileOptions; + if (format !== null && format !== undefined) { + publishingProfileOptions = new client.models['CsmPublishingProfileOptions'](); + publishingProfileOptions.format = format; + } + + // 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.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 Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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 _recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, callback) { + /* jshint 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.beginRecoverSlot(resourceGroupName, name, recoveryEntity, 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 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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); + } + } + + 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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); + } + } + + 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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); + } + } + + 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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); + } + } + + 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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; + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} 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.'); + } + let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; + let skipCustomDomainVerification = (options && options.skipCustomDomainVerification !== undefined) ? options.skipCustomDomainVerification : undefined; + let forceDnsRegistration = (options && options.forceDnsRegistration !== undefined) ? options.forceDnsRegistration : undefined; + let ttlInSeconds = (options && options.ttlInSeconds !== undefined) ? options.ttlInSeconds : undefined; + let apiVersion = '2016-08-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { + throw new Error('skipDnsRegistration must be of type boolean.'); + } + if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined && typeof skipCustomDomainVerification !== 'boolean') { + throw new Error('skipCustomDomainVerification must be of type boolean.'); + } + if (forceDnsRegistration !== null && forceDnsRegistration !== undefined && typeof forceDnsRegistration !== 'boolean') { + throw new Error('forceDnsRegistration must be of type boolean.'); + } + if (ttlInSeconds !== null && ttlInSeconds !== undefined && typeof ttlInSeconds.valueOf() !== 'string') { + throw new Error('ttlInSeconds must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { + queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); + } + if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined) { + queryParameters.push('skipCustomDomainVerification=' + encodeURIComponent(skipCustomDomainVerification.toString())); + } + if (forceDnsRegistration !== null && forceDnsRegistration !== undefined) { + queryParameters.push('forceDnsRegistration=' + encodeURIComponent(forceDnsRegistration.toString())); + } + if (ttlInSeconds !== null && ttlInSeconds !== undefined) { + queryParameters.push('ttlInSeconds=' + encodeURIComponent(ttlInSeconds)); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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' + * + * @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 RestoreResponse} for more information. + * + * {object} [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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RestoreResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 _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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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.'); + } + let apiVersion = '2016-08-01'; + // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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 _beginRecover(resourceGroupName, name, recoveryEntity, options, callback) { + /* jshint 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 = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (recoveryEntity === null || recoveryEntity === undefined) { + throw new Error('recoveryEntity 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/recover'; + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 (recoveryEntity !== null && recoveryEntity !== undefined) { + let requestModelMapper = new client.models['SnapshotRecoveryRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, recoveryEntity, 'recoveryEntity'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(recoveryEntity, null, 2)}.`); + return callback(serializationError); + } + 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} 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.'); + } + let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; + let skipCustomDomainVerification = (options && options.skipCustomDomainVerification !== undefined) ? options.skipCustomDomainVerification : undefined; + let forceDnsRegistration = (options && options.forceDnsRegistration !== undefined) ? options.forceDnsRegistration : undefined; + let ttlInSeconds = (options && options.ttlInSeconds !== undefined) ? options.ttlInSeconds : undefined; + let apiVersion = '2016-08-01'; + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { + throw new Error('skipDnsRegistration must be of type boolean.'); + } + if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined && typeof skipCustomDomainVerification !== 'boolean') { + throw new Error('skipCustomDomainVerification must be of type boolean.'); + } + if (forceDnsRegistration !== null && forceDnsRegistration !== undefined && typeof forceDnsRegistration !== 'boolean') { + throw new Error('forceDnsRegistration must be of type boolean.'); + } + if (ttlInSeconds !== null && ttlInSeconds !== undefined && typeof ttlInSeconds.valueOf() !== 'string') { + throw new Error('ttlInSeconds must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { + queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); + } + if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined) { + queryParameters.push('skipCustomDomainVerification=' + encodeURIComponent(skipCustomDomainVerification.toString())); + } + if (forceDnsRegistration !== null && forceDnsRegistration !== undefined) { + queryParameters.push('forceDnsRegistration=' + encodeURIComponent(forceDnsRegistration.toString())); + } + if (ttlInSeconds !== null && ttlInSeconds !== undefined) { + queryParameters.push('ttlInSeconds=' + encodeURIComponent(ttlInSeconds)); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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' + * + * @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. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestoreResponse} for more information. + * + * {object} [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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['RestoreResponse']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in 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 _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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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 Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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 _beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, callback) { + /* jshint 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 = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === null || name === undefined || typeof name.valueOf() !== 'string') { + throw new Error('name cannot be null or undefined and it must be of type string.'); + } + if (recoveryEntity === null || recoveryEntity === undefined) { + throw new Error('recoveryEntity 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/recover'; + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 (recoveryEntity !== null && recoveryEntity !== undefined) { + let requestModelMapper = new client.models['SnapshotRecoveryRequest']().mapper(); + requestModel = client.serialize(requestModelMapper, recoveryEntity, 'recoveryEntity'); + requestContent = JSON.stringify(requestModel); + } + } catch (error) { + let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + + `payload - ${JSON.stringify(recoveryEntity, null, 2)}.`); + return callback(serializationError); + } + 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(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(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) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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); + } + } + + 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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.'); + } + let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + 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(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) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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); + } + } + + 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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._discoverRestore = _discoverRestore; + 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._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._getConfiguration = _getConfiguration; + this._createOrUpdateConfiguration = _createOrUpdateConfiguration; + this._updateConfiguration = _updateConfiguration; + this._listConfigurationSnapshotInfo = _listConfigurationSnapshotInfo; + this._getConfigurationSnapshot = _getConfigurationSnapshot; + this._recoverSiteConfigurationSnapshot = _recoverSiteConfigurationSnapshot; + this._getWebSiteContainerLogs = _getWebSiteContainerLogs; + this._getWebSiteContainerLogsZip = _getWebSiteContainerLogsZip; + 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._listDomainOwnershipIdentifiers = _listDomainOwnershipIdentifiers; + this._getDomainOwnershipIdentifier = _getDomainOwnershipIdentifier; + this._createOrUpdateDomainOwnershipIdentifier = _createOrUpdateDomainOwnershipIdentifier; + this._deleteDomainOwnershipIdentifier = _deleteDomainOwnershipIdentifier; + this._updateDomainOwnershipIdentifier = _updateDomainOwnershipIdentifier; + this._getMSDeployStatus = _getMSDeployStatus; + this._createMSDeployOperation = _createMSDeployOperation; + this._getMSDeployLog = _getMSDeployLog; + this._listFunctions = _listFunctions; + this._getFunctionsAdminToken = _getFunctionsAdminToken; + this._getFunction = _getFunction; + this._createFunction = _createFunction; + this._deleteFunction = _deleteFunction; + this._listFunctionSecrets = _listFunctionSecrets; + this._listHostNameBindings = _listHostNameBindings; + this._getHostNameBinding = _getHostNameBinding; + this._createOrUpdateHostNameBinding = _createOrUpdateHostNameBinding; + this._deleteHostNameBinding = _deleteHostNameBinding; + this._getHybridConnection = _getHybridConnection; + this._createOrUpdateHybridConnection = _createOrUpdateHybridConnection; + this._deleteHybridConnection = _deleteHybridConnection; + this._updateHybridConnection = _updateHybridConnection; + this._listHybridConnectionKeys = _listHybridConnectionKeys; + this._listHybridConnections = _listHybridConnections; + this._listRelayServiceConnections = _listRelayServiceConnections; + this._getRelayServiceConnection = _getRelayServiceConnection; + this._createOrUpdateRelayServiceConnection = _createOrUpdateRelayServiceConnection; + this._deleteRelayServiceConnection = _deleteRelayServiceConnection; + this._updateRelayServiceConnection = _updateRelayServiceConnection; + this._listInstanceIdentifiers = _listInstanceIdentifiers; + this._getInstanceMsDeployStatus = _getInstanceMsDeployStatus; + this._createInstanceMSDeployOperation = _createInstanceMSDeployOperation; + this._getInstanceMSDeployLog = _getInstanceMSDeployLog; + this._listInstanceProcesses = _listInstanceProcesses; + this._getInstanceProcess = _getInstanceProcess; + this._deleteInstanceProcess = _deleteInstanceProcess; + this._getInstanceProcessDump = _getInstanceProcessDump; + this._listInstanceProcessModules = _listInstanceProcessModules; + this._getInstanceProcessModule = _getInstanceProcessModule; + this._listInstanceProcessThreads = _listInstanceProcessThreads; + this._getInstanceProcessThread = _getInstanceProcessThread; + this._isCloneable = _isCloneable; + this._listSyncFunctionTriggers = _listSyncFunctionTriggers; + this._listMetricDefinitions = _listMetricDefinitions; + this._listMetrics = _listMetrics; + this._migrateStorage = _migrateStorage; + this._migrateMySql = _migrateMySql; + this._getMigrateMySqlStatus = _getMigrateMySqlStatus; + this._listNetworkFeatures = _listNetworkFeatures; + this._startWebSiteNetworkTrace = _startWebSiteNetworkTrace; + this._stopWebSiteNetworkTrace = _stopWebSiteNetworkTrace; + this._generateNewSitePublishingPassword = _generateNewSitePublishingPassword; + this._listPerfMonCounters = _listPerfMonCounters; + this._getSitePhpErrorLogFlag = _getSitePhpErrorLogFlag; + this._listPremierAddOns = _listPremierAddOns; + this._getPremierAddOn = _getPremierAddOn; + this._addPremierAddOn = _addPremierAddOn; + this._deletePremierAddOn = _deletePremierAddOn; + this._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._recover = _recover; + this._resetProductionSlotConfig = _resetProductionSlotConfig; + this._restart = _restart; + 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._discoverRestoreSlot = _discoverRestoreSlot; + 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._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._getConfigurationSlot = _getConfigurationSlot; + this._createOrUpdateConfigurationSlot = _createOrUpdateConfigurationSlot; + this._updateConfigurationSlot = _updateConfigurationSlot; + this._listConfigurationSnapshotInfoSlot = _listConfigurationSnapshotInfoSlot; + this._getConfigurationSnapshotSlot = _getConfigurationSnapshotSlot; + this._recoverSiteConfigurationSnapshotSlot = _recoverSiteConfigurationSnapshotSlot; + this._getWebSiteContainerLogsSlot = _getWebSiteContainerLogsSlot; + this._getWebSiteContainerLogsZipSlot = _getWebSiteContainerLogsZipSlot; + 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._listDomainOwnershipIdentifiersSlot = _listDomainOwnershipIdentifiersSlot; + this._getDomainOwnershipIdentifierSlot = _getDomainOwnershipIdentifierSlot; + this._createOrUpdateDomainOwnershipIdentifierSlot = _createOrUpdateDomainOwnershipIdentifierSlot; + this._deleteDomainOwnershipIdentifierSlot = _deleteDomainOwnershipIdentifierSlot; + this._updateDomainOwnershipIdentifierSlot = _updateDomainOwnershipIdentifierSlot; + this._getMSDeployStatusSlot = _getMSDeployStatusSlot; + this._createMSDeployOperationSlot = _createMSDeployOperationSlot; + this._getMSDeployLogSlot = _getMSDeployLogSlot; + this._listInstanceFunctionsSlot = _listInstanceFunctionsSlot; + this._getFunctionsAdminTokenSlot = _getFunctionsAdminTokenSlot; + this._getInstanceFunctionSlot = _getInstanceFunctionSlot; + this._createInstanceFunctionSlot = _createInstanceFunctionSlot; + this._deleteInstanceFunctionSlot = _deleteInstanceFunctionSlot; + this._listFunctionSecretsSlot = _listFunctionSecretsSlot; + this._listHostNameBindingsSlot = _listHostNameBindingsSlot; + this._getHostNameBindingSlot = _getHostNameBindingSlot; + this._createOrUpdateHostNameBindingSlot = _createOrUpdateHostNameBindingSlot; + this._deleteHostNameBindingSlot = _deleteHostNameBindingSlot; + this._getHybridConnectionSlot = _getHybridConnectionSlot; + this._createOrUpdateHybridConnectionSlot = _createOrUpdateHybridConnectionSlot; + this._deleteHybridConnectionSlot = _deleteHybridConnectionSlot; + this._updateHybridConnectionSlot = _updateHybridConnectionSlot; + this._listHybridConnectionKeysSlot = _listHybridConnectionKeysSlot; + this._listHybridConnectionsSlot = _listHybridConnectionsSlot; + this._listRelayServiceConnectionsSlot = _listRelayServiceConnectionsSlot; + this._getRelayServiceConnectionSlot = _getRelayServiceConnectionSlot; + this._createOrUpdateRelayServiceConnectionSlot = _createOrUpdateRelayServiceConnectionSlot; + this._deleteRelayServiceConnectionSlot = _deleteRelayServiceConnectionSlot; + this._updateRelayServiceConnectionSlot = _updateRelayServiceConnectionSlot; + this._listInstanceIdentifiersSlot = _listInstanceIdentifiersSlot; + this._getInstanceMsDeployStatusSlot = _getInstanceMsDeployStatusSlot; + this._createInstanceMSDeployOperationSlot = _createInstanceMSDeployOperationSlot; + this._getInstanceMSDeployLogSlot = _getInstanceMSDeployLogSlot; + this._listInstanceProcessesSlot = _listInstanceProcessesSlot; + this._getInstanceProcessSlot = _getInstanceProcessSlot; + this._deleteInstanceProcessSlot = _deleteInstanceProcessSlot; + this._getInstanceProcessDumpSlot = _getInstanceProcessDumpSlot; + this._listInstanceProcessModulesSlot = _listInstanceProcessModulesSlot; + this._getInstanceProcessModuleSlot = _getInstanceProcessModuleSlot; + this._listInstanceProcessThreadsSlot = _listInstanceProcessThreadsSlot; + this._getInstanceProcessThreadSlot = _getInstanceProcessThreadSlot; + this._isCloneableSlot = _isCloneableSlot; + this._listSyncFunctionTriggersSlot = _listSyncFunctionTriggersSlot; + this._listMetricDefinitionsSlot = _listMetricDefinitionsSlot; + this._listMetricsSlot = _listMetricsSlot; + this._getMigrateMySqlStatusSlot = _getMigrateMySqlStatusSlot; + this._listNetworkFeaturesSlot = _listNetworkFeaturesSlot; + this._startWebSiteNetworkTraceSlot = _startWebSiteNetworkTraceSlot; + this._stopWebSiteNetworkTraceSlot = _stopWebSiteNetworkTraceSlot; + this._generateNewSitePublishingPasswordSlot = _generateNewSitePublishingPasswordSlot; + this._listPerfMonCountersSlot = _listPerfMonCountersSlot; + this._getSitePhpErrorLogFlagSlot = _getSitePhpErrorLogFlagSlot; + this._listPremierAddOnsSlot = _listPremierAddOnsSlot; + this._getPremierAddOnSlot = _getPremierAddOnSlot; + this._addPremierAddOnSlot = _addPremierAddOnSlot; + this._deletePremierAddOnSlot = _deletePremierAddOnSlot; + this._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._recoverSlot = _recoverSlot; + this._resetSlotConfigurationSlot = _resetSlotConfigurationSlot; + this._restartSlot = _restartSlot; + 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._beginRecover = _beginRecover; + this._beginInstallSiteExtension = _beginInstallSiteExtension; + this._beginCreateOrUpdateSlot = _beginCreateOrUpdateSlot; + this._beginRestoreSlot = _beginRestoreSlot; + this._beginListPublishingCredentialsSlot = _beginListPublishingCredentialsSlot; + this._beginCreateMSDeployOperationSlot = _beginCreateMSDeployOperationSlot; + this._beginCreateInstanceFunctionSlot = _beginCreateInstanceFunctionSlot; + this._beginCreateInstanceMSDeployOperationSlot = _beginCreateInstanceMSDeployOperationSlot; + this._beginRecoverSlot = _beginRecoverSlot; + 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is + * skipped. + * + * @param {object} [options.customHeaders] Headers 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is + * skipped. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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 Discovers an existing app backup that can be restored from a blob + * in Azure storage. + * + * Discovers an existing app backup that can be restored from a 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 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' + * + * @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. + */ + discoverRestoreWithHttpOperationResponse(resourceGroupName, name, request, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._discoverRestore(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. + * + * Discovers an existing app backup that can be restored from a 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 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' + * + * @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. + */ + discoverRestore(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._discoverRestore(resourceGroupName, name, request, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._discoverRestore(resourceGroupName, name, request, 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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' + * + * @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' + * + * @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 {RestoreResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestoreResponse} for more information. + * + * {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 {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 {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 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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 {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 {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 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 {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 {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 {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.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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 {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 {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 {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.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 {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 {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 {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.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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 {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 {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 {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.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. + */ + getWebSiteContainerLogsZipWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getWebSiteContainerLogsZip(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. + */ + getWebSiteContainerLogsZip(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._getWebSiteContainerLogsZip(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getWebSiteContainerLogsZip(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 {string} [deployment.deploymentId] Identifier for deployment. + * + * @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 {string} [deployment.deploymentId] Identifier for deployment. + * + * @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 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.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.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {FunctionEnvelope} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionEnvelope} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createFunction(resourceGroupName, name, functionName, functionEnvelope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createFunction(resourceGroupName, name, functionName, functionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createFunction(resourceGroupName, name, functionName, functionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteFunctionWithHttpOperationResponse(resourceGroupName, name, functionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteFunction(resourceGroupName, name, functionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteFunction(resourceGroupName, name, functionName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteFunction(resourceGroupName, name, functionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteFunction(resourceGroupName, name, functionName, options, optionalCallback); + } + } + + /** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listFunctionSecretsWithHttpOperationResponse(resourceGroupName, name, functionName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listFunctionSecrets(resourceGroupName, name, functionName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {FunctionSecrets} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionSecrets} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listFunctionSecrets(resourceGroupName, name, functionName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listFunctionSecrets(resourceGroupName, name, functionName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listFunctionSecrets(resourceGroupName, name, functionName, options, optionalCallback); + } + } + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listHostNameBindingsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHostNameBindings(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HostNameBindingCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBindingCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listHostNameBindings(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listHostNameBindings(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHostNameBindings(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getHostNameBindingWithHttpOperationResponse(resourceGroupName, name, hostName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getHostNameBinding(resourceGroupName, name, hostName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HostNameBinding} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBinding} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getHostNameBinding(resourceGroupName, name, hostName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getHostNameBinding(resourceGroupName, name, hostName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getHostNameBinding(resourceGroupName, name, hostName, options, optionalCallback); + } + } + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateHostNameBindingWithHttpOperationResponse(resourceGroupName, name, hostName, hostNameBinding, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostNameBinding, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HostNameBinding} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBinding} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostNameBinding, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostNameBinding, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostNameBinding, options, optionalCallback); + } + } + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteHostNameBindingWithHttpOperationResponse(resourceGroupName, name, hostName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteHostNameBinding(resourceGroupName, name, hostName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteHostNameBinding(resourceGroupName, name, hostName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteHostNameBinding(resourceGroupName, name, hostName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteHostNameBinding(resourceGroupName, name, hostName, options, optionalCallback); + } + } + + /** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getHybridConnectionWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, optionalCallback); + } + } + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateHybridConnectionWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteHybridConnectionWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, optionalCallback); + } + } + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateHybridConnectionWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._updateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Gets the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listHybridConnectionKeysWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HybridConnectionKey} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnectionKey} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, optionalCallback); + } + } + + /** + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listHybridConnectionsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHybridConnections(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listHybridConnections(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listHybridConnections(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHybridConnections(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listRelayServiceConnectionsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listRelayServiceConnections(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listRelayServiceConnections(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listRelayServiceConnections(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listRelayServiceConnections(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets a hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getRelayServiceConnectionWithHttpOperationResponse(resourceGroupName, name, entityName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getRelayServiceConnection(resourceGroupName, name, entityName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getRelayServiceConnection(resourceGroupName, name, entityName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getRelayServiceConnection(resourceGroupName, name, entityName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getRelayServiceConnection(resourceGroupName, name, entityName, options, optionalCallback); + } + } + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateRelayServiceConnectionWithHttpOperationResponse(resourceGroupName, name, entityName, connectionEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteRelayServiceConnectionWithHttpOperationResponse(resourceGroupName, name, entityName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteRelayServiceConnection(resourceGroupName, name, entityName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteRelayServiceConnection(resourceGroupName, name, entityName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteRelayServiceConnection(resourceGroupName, name, entityName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteRelayServiceConnection(resourceGroupName, name, entityName, options, optionalCallback); + } + } + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateRelayServiceConnectionWithHttpOperationResponse(resourceGroupName, name, entityName, connectionEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._updateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listInstanceIdentifiersWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceIdentifiers(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {WebAppInstanceCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppInstanceCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceIdentifiers(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listInstanceIdentifiers(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceIdentifiers(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceMsDeployStatusWithHttpOperationResponse(resourceGroupName, name, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MSDeployStatus} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options, optionalCallback); + } + } + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createInstanceMSDeployOperationWithHttpOperationResponse(resourceGroupName, name, instanceId, mSDeploy, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MSDeployStatus} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, optionalCallback); + } + } + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceMSDeployLogWithHttpOperationResponse(resourceGroupName, name, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MSDeployLog} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployLog} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listInstanceProcessesWithHttpOperationResponse(resourceGroupName, name, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceProcesses(resourceGroupName, name, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProcessInfoCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfoCollection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceProcesses(resourceGroupName, name, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listInstanceProcesses(resourceGroupName, name, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcesses(resourceGroupName, name, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceProcessWithHttpOperationResponse(resourceGroupName, name, processId, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcess(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProcessInfo} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfo} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcess(resourceGroupName, name, processId, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getInstanceProcess(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcess(resourceGroupName, name, processId, instanceId, options, optionalCallback); + } + } + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteInstanceProcessWithHttpOperationResponse(resourceGroupName, name, processId, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteInstanceProcess(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteInstanceProcess(resourceGroupName, name, processId, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteInstanceProcess(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteInstanceProcess(resourceGroupName, name, processId, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceProcessDumpWithHttpOperationResponse(resourceGroupName, name, processId, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcessDump(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Object} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessDump(resourceGroupName, name, processId, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getInstanceProcessDump(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcessDump(resourceGroupName, name, processId, instanceId, options, optionalCallback); + } + } + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listInstanceProcessModulesWithHttpOperationResponse(resourceGroupName, name, processId, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceProcessModules(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProcessModuleInfoCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfoCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceProcessModules(resourceGroupName, name, processId, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listInstanceProcessModules(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcessModules(resourceGroupName, name, processId, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceProcessModuleWithHttpOperationResponse(resourceGroupName, name, processId, baseAddress, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcessModule(resourceGroupName, name, processId, baseAddress, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProcessModuleInfo} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfo} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessModule(resourceGroupName, name, processId, baseAddress, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getInstanceProcessModule(resourceGroupName, name, processId, baseAddress, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcessModule(resourceGroupName, name, processId, baseAddress, instanceId, options, optionalCallback); + } + } + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listInstanceProcessThreadsWithHttpOperationResponse(resourceGroupName, name, processId, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceProcessThreads(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProcessThreadInfoCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfoCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceProcessThreads(resourceGroupName, name, processId, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listInstanceProcessThreads(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcessThreads(resourceGroupName, name, processId, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceProcessThreadWithHttpOperationResponse(resourceGroupName, name, processId, threadId, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcessThread(resourceGroupName, name, processId, threadId, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProcessThreadInfo} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfo} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessThread(resourceGroupName, name, processId, threadId, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getInstanceProcessThread(resourceGroupName, name, processId, threadId, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcessThread(resourceGroupName, name, processId, threadId, instanceId, options, optionalCallback); + } + } + + /** + * @summary Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + isCloneableWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._isCloneable(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SiteCloneability} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SiteCloneability} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + isCloneable(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._isCloneable(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._isCloneable(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listSyncFunctionTriggersWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSyncFunctionTriggers(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {FunctionSecrets} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionSecrets} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listSyncFunctionTriggers(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listSyncFunctionTriggers(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSyncFunctionTriggers(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listMetricDefinitionsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetricDefinitions(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ResourceMetricDefinitionCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricDefinitionCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listMetricDefinitions(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listMetricDefinitions(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetricDefinitions(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime + * eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listMetricsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetrics(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime + * eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ResourceMetricCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listMetrics(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listMetrics(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetrics(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Restores a web app. + * + * Restores a web app. + * + * @param {string} subscriptionName Azure subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationOptions Migration migrationOptions. + * + * @param {string} migrationOptions.azurefilesConnectionString AzureFiles + * connection string. + * + * @param {string} migrationOptions.azurefilesShare AzureFiles share. + * + * @param {boolean} [migrationOptions.switchSiteAfterMigration] + * trueif the app should be switched over; otherwise, + * false. + * + * @param {boolean} [migrationOptions.blockWriteAccessToSite] true + * if the app should be read only during copy operation; otherwise, + * false. + * + * @param {string} [migrationOptions.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + migrateStorageWithHttpOperationResponse(subscriptionName, resourceGroupName, name, migrationOptions, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._migrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Restores a web app. + * + * Restores a web app. + * + * @param {string} subscriptionName Azure subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationOptions Migration migrationOptions. + * + * @param {string} migrationOptions.azurefilesConnectionString AzureFiles + * connection string. + * + * @param {string} migrationOptions.azurefilesShare AzureFiles share. + * + * @param {boolean} [migrationOptions.switchSiteAfterMigration] + * trueif the app should be switched over; otherwise, + * false. + * + * @param {boolean} [migrationOptions.blockWriteAccessToSite] true + * if the app should be read only during copy operation; otherwise, + * false. + * + * @param {string} [migrationOptions.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {StorageMigrationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link StorageMigrationResponse} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + migrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._migrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._migrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, optionalCallback); + } + } + + /** + * @summary Migrates a local (in-app) MySql database to a remote MySql + * database. + * + * Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationRequestEnvelope MySql migration options. + * + * @param {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. + * + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' + * + * @param {string} [migrationRequestEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + migrateMySqlWithHttpOperationResponse(resourceGroupName, name, migrationRequestEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._migrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Migrates a local (in-app) MySql database to a remote MySql + * database. + * + * Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationRequestEnvelope MySql migration options. + * + * @param {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. + * + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' + * + * @param {string} [migrationRequestEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Operation} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Operation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + migrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._migrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._migrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, optionalCallback); + } + } + + /** + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getMigrateMySqlStatusWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getMigrateMySqlStatus(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MigrateMySqlStatus} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MigrateMySqlStatus} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getMigrateMySqlStatus(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getMigrateMySqlStatus(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getMigrateMySqlStatus(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNetworkFeaturesWithHttpOperationResponse(resourceGroupName, name, view, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNetworkFeatures(resourceGroupName, name, view, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {NetworkFeatures} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkFeatures} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNetworkFeatures(resourceGroupName, name, view, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNetworkFeatures(resourceGroupName, name, view, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNetworkFeatures(resourceGroupName, name, view, options, optionalCallback); + } + } + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + startWebSiteNetworkTraceWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._startWebSiteNetworkTrace(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {String} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + startWebSiteNetworkTrace(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._startWebSiteNetworkTrace(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._startWebSiteNetworkTrace(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + stopWebSiteNetworkTraceWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._stopWebSiteNetworkTrace(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {String} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + stopWebSiteNetworkTrace(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._stopWebSiteNetworkTrace(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._stopWebSiteNetworkTrace(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + generateNewSitePublishingPasswordWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._generateNewSitePublishingPassword(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + generateNewSitePublishingPassword(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._generateNewSitePublishingPassword(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._generateNewSitePublishingPassword(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain + * eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listPerfMonCountersWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPerfMonCounters(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain + * eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PerfMonCounterCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PerfMonCounterCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listPerfMonCounters(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listPerfMonCounters(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPerfMonCounters(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getSitePhpErrorLogFlagWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSitePhpErrorLogFlag(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SitePhpErrorLogFlag} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SitePhpErrorLogFlag} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getSitePhpErrorLogFlag(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getSitePhpErrorLogFlag(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSitePhpErrorLogFlag(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listPremierAddOnsWithHttpOperationResponse(resourceGroupName, name, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPremierAddOns(resourceGroupName, name, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PremierAddOn} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listPremierAddOns(resourceGroupName, name, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listPremierAddOns(resourceGroupName, name, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPremierAddOns(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Gets a named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getPremierAddOnWithHttpOperationResponse(resourceGroupName, name, premierAddOnName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getPremierAddOn(resourceGroupName, name, premierAddOnName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PremierAddOn} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getPremierAddOn(resourceGroupName, name, premierAddOnName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getPremierAddOn(resourceGroupName, name, premierAddOnName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getPremierAddOn(resourceGroupName, name, premierAddOnName, options, optionalCallback); + } + } + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. + * + * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. + * + * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. + * + * @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.premierAddOnName] Premier add on Name. + * + * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. + * + * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. + * + * @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 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} [options] Optional Parameters. + * + * @param {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {object} [options.customHeaders] Headers 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, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPublishingProfileXmlWithSecrets(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 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} [options] Optional Parameters. + * + * @param {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, options, optionalCallback) { + 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, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPublishingProfileXmlWithSecrets(resourceGroupName, name, options, optionalCallback); + } + } + + /** + * @summary Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + recoverWithHttpOperationResponse(resourceGroupName, name, recoveryEntity, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._recover(resourceGroupName, name, recoveryEntity, 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 a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. + */ + recover(resourceGroupName, name, recoveryEntity, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._recover(resourceGroupName, name, recoveryEntity, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._recover(resourceGroupName, name, recoveryEntity, 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 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is + * skipped. + * + * @param {object} [options.customHeaders] Headers 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is + * skipped. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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 Discovers an existing app backup that can be restored from a blob + * in Azure storage. + * + * Discovers an existing app backup that can be restored from a 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 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' + * + * @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. + */ + discoverRestoreSlotWithHttpOperationResponse(resourceGroupName, name, request, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._discoverRestoreSlot(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. + * + * Discovers an existing app backup that can be restored from a 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 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' + * + * @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. + */ + discoverRestoreSlot(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._discoverRestoreSlot(resourceGroupName, name, request, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._discoverRestoreSlot(resourceGroupName, name, request, 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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' + * + * @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' + * + * @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 {RestoreResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestoreResponse} for more information. + * + * {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 {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 {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 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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible + * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * + * @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 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 {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 {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 {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.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 {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 {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 {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.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 {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 {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 {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.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 {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 {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 {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.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. + */ + getWebSiteContainerLogsZipSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getWebSiteContainerLogsZipSlot(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. + */ + getWebSiteContainerLogsZipSlot(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._getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getWebSiteContainerLogsZipSlot(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 {string} [deployment.deploymentId] Identifier for deployment. + * + * @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 {string} [deployment.deploymentId] Identifier for deployment. + * + * @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 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.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.scriptRootPathHref] Script root path URI. + * + * @param {string} [functionEnvelope.scriptHref] Script URI. + * + * @param {string} [functionEnvelope.configHref] Config URI. + * + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * + * @param {string} [functionEnvelope.href] Function URI. + * + * @param {object} [functionEnvelope.config] Config information. + * + * @param {object} [functionEnvelope.files] File list. + * + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. + * + * @param {string} [functionEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {FunctionEnvelope} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionEnvelope} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createInstanceFunctionSlot(resourceGroupName, name, functionName, slot, functionEnvelope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createInstanceFunctionSlot(resourceGroupName, name, functionName, slot, functionEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createInstanceFunctionSlot(resourceGroupName, name, functionName, slot, functionEnvelope, options, optionalCallback); + } + } + + /** + * @summary Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteInstanceFunctionSlotWithHttpOperationResponse(resourceGroupName, name, functionName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Delete a function for web site, or a deployment slot. + * + * Delete a function for web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, optionalCallback); + } + } + + /** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listFunctionSecretsSlotWithHttpOperationResponse(resourceGroupName, name, functionName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get function secrets for a function in a web site, or a deployment + * slot. + * + * Get function secrets for a function in a web site, or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} functionName Function name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {FunctionSecrets} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionSecrets} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, options, optionalCallback); + } + } + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets hostname bindings for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listHostNameBindingsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHostNameBindingsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get hostname bindings for an app or a deployment slot. + * + * Get hostname bindings for an app or a deployment slot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets hostname bindings for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HostNameBindingCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBindingCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listHostNameBindingsSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listHostNameBindingsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHostNameBindingsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API the named binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getHostNameBindingSlotWithHttpOperationResponse(resourceGroupName, name, slot, hostName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * Get the named hostname binding for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API the named binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HostNameBinding} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBinding} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, optionalCallback); + } + } + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create a binding for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateHostNameBindingSlotWithHttpOperationResponse(resourceGroupName, name, hostName, hostNameBinding, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, hostNameBinding, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a hostname binding for an app. + * + * Creates a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} hostNameBinding Binding details. This is the JSON + * representation of a HostNameBinding object. + * + * @param {string} [hostNameBinding.siteName] App Service app name. + * + * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain + * resource URI. + * + * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * + * @param {string} [hostNameBinding.azureResourceType] Azure resource type. + * Possible values include: 'Website', 'TrafficManager' + * + * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS + * record type. Possible values include: 'CName', 'A' + * + * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible + * values include: 'Verified', 'Managed' + * + * @param {string} [hostNameBinding.sslState] SSL type. Possible values + * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * + * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * + * @param {string} [hostNameBinding.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create a binding for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HostNameBinding} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HostNameBinding} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, hostNameBinding, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, hostNameBinding, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, hostNameBinding, slot, options, optionalCallback); + } + } + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteHostNameBindingSlotWithHttpOperationResponse(resourceGroupName, name, slot, hostName, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a hostname binding for an app. + * + * Deletes a hostname binding for an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete the binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, optionalCallback); + } + } + + /** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getHybridConnectionSlotWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. + * + * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, optionalCallback); + } + } + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateHybridConnectionSlotWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, optionalCallback); + } + } + + /** + * @summary Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteHybridConnectionSlotWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Removes a Hybrid Connection from this site. + * + * Removes a Hybrid Connection from this site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, optionalCallback); + } + } + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateHybridConnectionSlotWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new Hybrid Connection using a Service Bus relay. + * + * Creates a new Hybrid Connection using a Service Bus relay. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {object} connectionEnvelope The details of the hybrid connection. + * + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. + * + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. + * + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. + * + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * + * @param {number} [connectionEnvelope.port] The port of the endpoint. + * + * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus + * key which has Send permissions. This is used to authenticate to Service Bus. + * + * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service + * Bus key. This is used to authenticate to Service Bus. In ARM this key will + * not be returned + * normally, use the POST /listKeys API instead. + * + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._updateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, optionalCallback); + } + } + + /** + * @summary Gets the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listHybridConnectionKeysSlotWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, relayName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets the send key name and value for a Hybrid Connection. + * + * Gets the send key name and value for a Hybrid Connection. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} namespaceName The namespace for this hybrid connection. + * + * @param {string} relayName The relay name for this hybrid connection. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HybridConnectionKey} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnectionKey} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, relayName, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, relayName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, relayName, slot, options, optionalCallback); + } + } + + /** + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listHybridConnectionsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listHybridConnectionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * Retrieves all Service Bus Hybrid Connections used by this Web App. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for the web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {HybridConnection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link HybridConnection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listHybridConnectionsSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listHybridConnectionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listHybridConnectionsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get hybrid connections for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listRelayServiceConnectionsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). + * + * Gets hybrid connections configured for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get hybrid connections for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets a hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a hybrid connection for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName, name, entityName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a hybrid connection configuration by its name. + * + * Gets a hybrid connection configuration by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get a hybrid connection for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, optionalCallback); + } + } + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createOrUpdateRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName, name, entityName, connectionEnvelope, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, optionalCallback); + } + } + + /** + * @summary Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete a hybrid connection for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName, name, entityName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Deletes a relay service connection by its name. + * + * Deletes a relay service connection by its name. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete a hybrid connection for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, optionalCallback); + } + } + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + updateRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName, name, entityName, connectionEnvelope, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). + * + * Creates a new hybrid connection configuration (PUT), or updates an existing + * one (PATCH). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} entityName Name of the hybrid connection configuration. + * + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. + * + * @param {string} [connectionEnvelope.entityName] + * + * @param {string} [connectionEnvelope.entityConnectionString] + * + * @param {string} [connectionEnvelope.resourceType] + * + * @param {string} [connectionEnvelope.resourceConnectionString] + * + * @param {string} [connectionEnvelope.hostname] + * + * @param {number} [connectionEnvelope.port] + * + * @param {string} [connectionEnvelope.biztalkUri] + * + * @param {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will create or update a hybrid connection for the + * production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {RelayServiceConnectionEntity} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RelayServiceConnectionEntity} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, optionalCallback); + } + } + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets the production slot instances. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listInstanceIdentifiersSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets all scale-out instances of an app. + * + * Gets all scale-out instances of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API gets the production slot instances. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {WebAppInstanceCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link WebAppInstanceCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceMsDeployStatusSlotWithHttpOperationResponse(resourceGroupName, name, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the status of the last MSDeploy operation. + * + * Get the status of the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MSDeployStatus} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + createInstanceMSDeployOperationSlotWithHttpOperationResponse(resourceGroupName, name, slot, instanceId, mSDeploy, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._createInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Invoke the MSDeploy web app extension. + * + * Invoke the MSDeploy web app extension. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} mSDeploy Details of MSDeploy operation + * + * @param {string} [mSDeploy.packageUri] Package URI + * + * @param {string} [mSDeploy.connectionString] SQL Connection String + * + * @param {string} [mSDeploy.dbType] Database Type + * + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. + * + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. + * + * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy + * operation skips the App_Data directory. + * If set to true, the existing App_Data directory on the + * destination + * will not be deleted, and any App_Data directory in the source will be + * ignored. + * Setting is false by default. + * + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. + * + * @param {string} [mSDeploy.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MSDeployStatus} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployStatus} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + createInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._createInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._createInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, options, optionalCallback); + } + } + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceMSDeployLogSlotWithHttpOperationResponse(resourceGroupName, name, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get the MSDeploy Log for the last MSDeploy operation. + * + * Get the MSDeploy Log for the last MSDeploy operation. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {string} instanceId ID of web app instance. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MSDeployLog} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MSDeployLog} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listInstanceProcessesSlotWithHttpOperationResponse(resourceGroupName, name, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. + * + * Get list of processes for a web site, or a deployment slot, or for a + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProcessInfoCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfoCollection} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceProcessSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProcessInfo} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessInfo} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + deleteInstanceProcessSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. + * + * Terminate a process by its ID for a web site, or a deployment slot, or + * specific scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceProcessDumpSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. + * + * Get a memory dump of a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Object} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listInstanceProcessModulesSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. + * + * List module information for a process by its ID for a specific scaled-out + * instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProcessModuleInfoCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfoCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceProcessModuleSlotWithHttpOperationResponse(resourceGroupName, name, processId, baseAddress, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. + * + * Get process information by its ID for a specific scaled-out instance in a + * web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProcessModuleInfo} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessModuleInfo} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listInstanceProcessThreadsSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. + * + * List the threads in a process by its ID for a specific scaled-out instance + * in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProcessThreadInfoCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfoCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getInstanceProcessThreadSlotWithHttpOperationResponse(resourceGroupName, name, processId, threadId, slot, instanceId, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. + * + * Get thread information by Thread ID for a specific process, in a specific + * scaled-out instance in a web site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Site name. + * + * @param {string} processId PID. + * + * @param {string} threadId TID. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API returns deployments for the production slot. + * + * @param {string} instanceId ID of a specific scaled-out instance. This is the + * value of the name property in the JSON response from "GET + * api/sites/{siteName}/instances". + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ProcessThreadInfo} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ProcessThreadInfo} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, optionalCallback); + } + } + + /** + * @summary Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. By default, this API + * returns information on the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + isCloneableSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._isCloneableSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Shows whether an app can be cloned to another resource group or + * subscription. + * + * Shows whether an app can be cloned to another resource group or + * subscription. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. By default, this API + * returns information on the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SiteCloneability} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SiteCloneability} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + isCloneableSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._isCloneableSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._isCloneableSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listSyncFunctionTriggersSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary This is to allow calling via powershell and ARM template. + * + * This is to allow calling via powershell and ARM template. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {FunctionSecrets} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link FunctionSecrets} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metric definitions of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listMetricDefinitionsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetricDefinitionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). + * + * Gets all metric definitions of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metric definitions of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ResourceMetricDefinitionCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricDefinitionCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listMetricDefinitionsSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listMetricDefinitionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetricDefinitionsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metrics of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime + * eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listMetricsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listMetricsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). + * + * Gets performance metrics of an app (or deployment slot, if specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get metrics of the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. + * + * @param {string} [options.filter] Return only metrics specified in the filter + * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or + * name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime + * eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {ResourceMetricCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link ResourceMetricCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listMetricsSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listMetricsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listMetricsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of the deployment slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getMigrateMySqlStatusSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled + * + * Returns the status of MySql in app migration, if one is active, and whether + * or not MySql in app is enabled + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of the deployment slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {MigrateMySqlStatus} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link MigrateMySqlStatus} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get network features for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNetworkFeaturesSlotWithHttpOperationResponse(resourceGroupName, name, view, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets all network features used by the app (or deployment slot, if + * specified). + * + * Gets all network features used by the app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} view The type of view. This can either be "summary" or + * "detailed". + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get network features for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {NetworkFeatures} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link NetworkFeatures} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, optionalCallback); + } + } + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + startWebSiteNetworkTraceSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Start capturing network packets for the site. + * + * Start capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {number} [options.durationInSeconds] The duration to keep capturing + * in seconds. + * + * @param {number} [options.maxFrameLength] The maximum frame length in bytes + * (Optional). + * + * @param {string} [options.sasUrl] The Blob URL to store capture file. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {String} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + stopWebSiteNetworkTraceSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Stop ongoing capturing network packets for the site. + * + * Stop ongoing capturing network packets for the site. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name The name of the web app. + * + * @param {string} slot The name of the slot for this web app. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {String} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {string} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API generate a new publishing password for the production + * slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + generateNewSitePublishingPasswordSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). + * + * Generates a new publishing password for an app (or deployment slot, if + * specified). + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API generate a new publishing password for the production + * slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain + * eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listPerfMonCountersSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPerfMonCountersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets perfmon counters for web app. + * + * Gets perfmon counters for web app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.filter] Return only usages/metrics specified in the + * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq + * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain + * eq duration'[Hour|Minute|Day]'. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PerfMonCounterCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PerfMonCounterCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listPerfMonCountersSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listPerfMonCountersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPerfMonCountersSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getSitePhpErrorLogFlagSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets web app's event logs. + * + * Gets web app's event logs. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {SitePhpErrorLogFlag} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SitePhpErrorLogFlag} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the premier add-ons for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listPremierAddOnsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPremierAddOnsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets the premier add-ons of an app. + * + * Gets the premier add-ons of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the premier add-ons for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PremierAddOn} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listPremierAddOnsSlot(resourceGroupName, name, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listPremierAddOnsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPremierAddOnsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Gets a named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the named add-on for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + getPremierAddOnSlotWithHttpOperationResponse(resourceGroupName, name, premierAddOnName, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a named add-on of an app. + * + * Gets a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get the named add-on for the production slot. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {PremierAddOn} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PremierAddOn} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, optionalCallback); + } + } + + /** + * @summary Updates a named add-on of an app. + * + * Updates a named add-on of an app. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {string} premierAddOnName Add-on name. + * + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. + * + * @param {string} [premierAddOn.sku] Premier add on SKU. + * + * @param {string} [premierAddOn.product] Premier add on Product. + * + * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * + * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. + * + * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. + * + * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. + * + * @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.premierAddOnName] Premier add on Name. + * + * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. + * + * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. + * + * @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 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 {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 {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {object} [options.customHeaders] Headers 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, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listPublishingProfileXmlWithSecretsSlot(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 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 {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 {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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, slot, options, optionalCallback) { + 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, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, options, optionalCallback); + } + } + + /** + * @summary Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. + */ + recoverSlotWithHttpOperationResponse(resourceGroupName, name, recoveryEntity, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._recoverSlot(resourceGroupName, name, recoveryEntity, slot, 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 a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. + */ + recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._recoverSlot(resourceGroupName, name, recoveryEntity, 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 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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' + * + * @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' + * + * @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 {RestoreResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestoreResponse} for more information. + * + * {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.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.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 Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginRecoverWithHttpOperationResponse(resourceGroupName, name, recoveryEntity, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRecover(resourceGroupName, name, recoveryEntity, 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 a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. + */ + beginRecover(resourceGroupName, name, recoveryEntity, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginRecover(resourceGroupName, name, recoveryEntity, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRecover(resourceGroupName, name, recoveryEntity, 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true + * if quotas should be ignored; otherwise, false. + * + * @param {object} [siteEnvelope.snapshotInfo] If specified during app + * creation, the app is created from a previous snapshot. + * + * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in + * which the app recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web + * app that snapshot contents will be written to. + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] + * Geographical location of the target web app, e.g. SouthEastAsia, + * SouthCentralUS + * + * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource + * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true + * the recovery operation can overwrite source app; otherwise, + * false. + * + * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, + * site configuration, in addition to content, will be reverted. + * + * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * + * @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' + * + * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is + * not registered with DNS on creation. This parameter is + * only used for app creation. + * + * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non + * *.azurewebsites.net) domains associated with web app are not verified. + * + * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is + * force registered with DNS. + * + * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's + * default domain name. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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' + * + * @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' + * + * @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 {RestoreResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link RestoreResponse} for more information. + * + * {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.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.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 Recovers a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. + */ + beginRecoverSlotWithHttpOperationResponse(resourceGroupName, name, recoveryEntity, slot, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, 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 a web app to a previous snapshot. + * + * Recovers a web app to a previous snapshot. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} recoveryEntity Snapshot data used for web app recovery. + * Snapshot information can be obtained by calling GetDeletedSites or + * GetSiteSnapshots API. + * + * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app + * recovery should be attempted, formatted as a DateTime string. + * + * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that + * snapshot contents will be written to. + * + * @param {string} [recoveryEntity.recoveryTarget.location] Geographical + * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * + * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the + * target 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} recoveryEntity.overwrite If true the recovery + * operation can overwrite source app; otherwise, false. + * + * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. + * + * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. + */ + beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginRecoverSlot(resourceGroupName, name, recoveryEntity, 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/package.json b/lib/services/websiteManagement2/lib/package.json new file mode 100644 index 0000000000..7cc436fe61 --- /dev/null +++ b/lib/services/websiteManagement2/lib/package.json @@ -0,0 +1,22 @@ +{ + "name": "azure-arm-website", + "author": "Microsoft Corporation", + "description": "WebSiteManagementClient Library with typescript type definitions for node", + "version": "", + "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": "http://github.com/azure/azure-sdk-for-node", + "repository": { + "type": "git", + "url": "https://github.com/azure/azure-sdk-for-node.git" + }, + "bugs": { + "url": "http://github.com/Azure/azure-sdk-for-node/issues" + } +} diff --git a/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts b/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts new file mode 100644 index 0000000000..11de86f278 --- /dev/null +++ b/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts @@ -0,0 +1,1381 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * 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] - 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. + * + */ + constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); + + credentials: ServiceClientCredentials; + + subscriptionId: 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; + global: operations.Global; + provider: operations.Provider; + recommendations: operations.Recommendations; + resourceHealthMetadataOperations: operations.ResourceHealthMetadataOperations; + webApps: operations.WebApps; + appServiceEnvironments: operations.AppServiceEnvironments; + appServicePlans: operations.AppServicePlans; + + + /** + * @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.userName] Username + * + * @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.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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.userName] Username + * + * @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.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.sourceControlName] Name or source control + * type. + * + * @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.sourceControlName] Name or source control + * type. + * + * @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 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', + * 'PremiumV2', 'Dynamic', 'Isolated' + * + * @param {boolean} [options.linuxWorkersEnabled] Specify true if + * you want to filter to only regions that support Linux 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, 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', + * 'PremiumV2', 'Dynamic', 'Isolated' + * + * @param {boolean} [options.linuxWorkersEnabled] Specify true if + * you want to filter to only regions that support Linux 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, customHeaders? : { [headerName: string]: string; } }): Promise; + listGeoRegions(callback: ServiceCallback): void; + listGeoRegions(options: { sku? : string, linuxWorkersEnabled? : 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 {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that 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 {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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 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..0d65abd6c7 --- /dev/null +++ b/lib/services/websiteManagement2/lib/webSiteManagementClient.js @@ -0,0 +1,4748 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * 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.'); + } + let apiVersion = '2016-03-01'; + // Validate + try { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.userName] Username + * + * @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.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.'); + } + let apiVersion = '2016-03-01'; + // Validate + try { + if (userDetails === null || userDetails === undefined) { + throw new Error('userDetails 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.Web/publishingUsers/web'; + 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.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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-01'; + // Validate + try { + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-03-01'; + // 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.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.sourceControlName] Name or source control + * type. + * + * @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.'); + } + let apiVersion = '2016-03-01'; + // 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.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(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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 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; + let apiVersion = '2016-03-01'; + // 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 (name === 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-01'; + // 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.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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', + * 'PremiumV2', 'Dynamic', 'Isolated' + * + * @param {boolean} [options.linuxWorkersEnabled] Specify true if + * you want to filter to only regions that support Linux 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 apiVersion = '2016-03-01'; + // 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 (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.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())); + } + 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.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['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; + let apiVersion = '2016-03-01'; + // 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 (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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-01'; + // 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.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-03-01'; + // 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.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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['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.'); + } + let apiVersion = '2016-03-01'; + // 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.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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 {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} 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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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.'); + } + let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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] - 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. + */ + 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.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.global = new operations.Global(this); + this.provider = new operations.Provider(this); + this.recommendations = new operations.Recommendations(this); + this.resourceHealthMetadataOperations = new operations.ResourceHealthMetadataOperations(this); + this.webApps = new operations.WebApps(this); + this.appServiceEnvironments = new operations.AppServiceEnvironments(this); + this.appServicePlans = new operations.AppServicePlans(this); + this.models = models; + this._getPublishingUser = _getPublishingUser; + this._updatePublishingUser = _updatePublishingUser; + this._listSourceControls = _listSourceControls; + this._getSourceControl = _getSourceControl; + this._updateSourceControl = _updateSourceControl; + 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._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.userName] Username + * + * @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.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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.userName] Username + * + * @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.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.sourceControlName] Name or source control + * type. + * + * @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.sourceControlName] Name or source control + * type. + * + * @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 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', + * 'PremiumV2', 'Dynamic', 'Isolated' + * + * @param {boolean} [options.linuxWorkersEnabled] Specify true if + * you want to filter to only regions that support Linux 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', + * 'PremiumV2', 'Dynamic', 'Isolated' + * + * @param {boolean} [options.linuxWorkersEnabled] Specify true if + * you want to filter to only regions that support Linux 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 {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers 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 {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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 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; From a401e6208a148a2c9ef7708db0d94a4d88dec381 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 12 Apr 2018 14:33:13 -0700 Subject: [PATCH 2/9] [AutoPR web/resource-manager] Adding new API version for Microsoft.Web RP which fixes swagger errors (#2650) * Generated from b8fffef042a6c835cb77572d62eca885096e1d8e Adding examples for the resource health metadata * Generated from ef4aa89464e06d61a88dabeef057d89009f19aa3 Removing ClassicMobileServices.json * Generated from 8957477812a8f2abbc895a363756062be9f2ca45 Removed location element for top level domain examples --- lib/services/websiteManagement2/LICENSE.txt | 21 + lib/services/websiteManagement2/README.md | 40 ++ .../lib/models/billingMeter.js | 59 ++- .../lib/models/billingMeterCollection.js | 68 +++ .../lib/models/defaultErrorResponseError.js | 10 +- .../defaultErrorResponseErrorDetailsItem.js | 10 +- .../lib/models/handlerMapping.js | 6 +- .../websiteManagement2/lib/models/index.d.ts | 75 +-- .../websiteManagement2/lib/models/index.js | 3 +- .../lib/operations/billingMeters.js | 483 ++++++++++++++++++ .../lib/operations/index.d.ts | 304 ++++++----- .../lib/operations/index.js | 2 +- .../lib/operations/webApps.js | 189 ------- .../lib/webSiteManagementClient.d.ts | 2 +- .../lib/webSiteManagementClient.js | 2 +- lib/services/websiteManagement2/package.json | 22 + 16 files changed, 889 insertions(+), 407 deletions(-) create mode 100644 lib/services/websiteManagement2/LICENSE.txt create mode 100644 lib/services/websiteManagement2/README.md create mode 100644 lib/services/websiteManagement2/lib/models/billingMeterCollection.js create mode 100644 lib/services/websiteManagement2/lib/operations/billingMeters.js create mode 100644 lib/services/websiteManagement2/package.json diff --git a/lib/services/websiteManagement2/LICENSE.txt b/lib/services/websiteManagement2/LICENSE.txt new file mode 100644 index 0000000000..5431ba98b9 --- /dev/null +++ b/lib/services/websiteManagement2/LICENSE.txt @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2018 Microsoft + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/lib/services/websiteManagement2/README.md b/lib/services/websiteManagement2/README.md new file mode 100644 index 0000000000..74dfd85526 --- /dev/null +++ b/lib/services/websiteManagement2/README.md @@ -0,0 +1,40 @@ +--- +uid: azure-arm-website +summary: *content + +--- +# Microsoft Azure SDK for Node.js - WebSiteManagementClient +This project provides a Node.js package for accessing Azure. Right now it supports: +- **Node.js version 6.x.x or higher** + +## Features + + +## How to Install + +```bash +npm install azure-arm-website +``` + +## How to use + +### Authentication, client creation and list appServiceCertificateOrders as an example. + +```javascript +const msRestAzure = require("ms-rest-azure"); +const WebSiteManagementClient = require("azure-arm-website"); +msRestAzure.interactiveLogin().then((creds) => { + const subscriptionId = ""; + const client = new WebSiteManagementClient(creds, subscriptionId); + return client.appServiceCertificateOrders.list().then((result) => { + console.log("The result is:"); + console.log(result); + }); +}).catch((err) => { + console.log('An error occurred:'); + console.dir(err, {depth: null, colors: true}); +}); + +## Related projects + +- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) diff --git a/lib/services/websiteManagement2/lib/models/billingMeter.js b/lib/services/websiteManagement2/lib/models/billingMeter.js index 0a4e321786..14229378b7 100644 --- a/lib/services/websiteManagement2/lib/models/billingMeter.js +++ b/lib/services/websiteManagement2/lib/models/billingMeter.js @@ -10,20 +10,26 @@ 'use strict'; +const models = require('./index'); + /** - * Billing meter. + * App Service billing entity that contains information about meter which the + * Azure billing system utilizes to charge users for services. * + * @extends models['ProxyOnlyResource'] */ -class BillingMeter { +class BillingMeter extends models['ProxyOnlyResource'] { /** * Create a BillingMeter. * @member {string} [meterId] Meter GUID onboarded in Commerce - * @member {string} [billingLocation] CSM Location - * @member {string} [shortName] Short Name from Azure pricing Page - * @member {string} [friendlyName] Meter Resource Name - * @member {string} [resourceType] ResourceType meter used for + * @member {string} [billingLocation] Azure Location of billable resource + * @member {string} [shortName] Short Name from App Service Azure pricing + * Page + * @member {string} [friendlyName] Friendly name of the meter + * @member {string} [resourceType] App Service resource type meter used for */ constructor() { + super(); } /** @@ -40,37 +46,68 @@ class BillingMeter { name: 'Composite', className: 'BillingMeter', modelProperties: { + id: { + required: false, + readOnly: true, + serializedName: 'id', + type: { + name: 'String' + } + }, + name: { + required: false, + readOnly: true, + serializedName: 'name', + type: { + name: 'String' + } + }, + kind: { + required: false, + serializedName: 'kind', + type: { + name: 'String' + } + }, + type: { + required: false, + readOnly: true, + serializedName: 'type', + type: { + name: 'String' + } + }, meterId: { required: false, - serializedName: 'meterId', + serializedName: 'properties.meterId', type: { name: 'String' } }, billingLocation: { required: false, - serializedName: 'billingLocation', + serializedName: 'properties.billingLocation', type: { name: 'String' } }, shortName: { required: false, - serializedName: 'shortName', + serializedName: 'properties.shortName', type: { name: 'String' } }, friendlyName: { required: false, - serializedName: 'friendlyName', + serializedName: 'properties.friendlyName', type: { name: 'String' } }, resourceType: { required: false, - serializedName: 'resourceType', + serializedName: 'properties.resourceType', type: { name: 'String' } diff --git a/lib/services/websiteManagement2/lib/models/billingMeterCollection.js b/lib/services/websiteManagement2/lib/models/billingMeterCollection.js new file mode 100644 index 0000000000..731a97562d --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/billingMeterCollection.js @@ -0,0 +1,68 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +/** + * Collection of Billing Meters + */ +class BillingMeterCollection extends Array { + /** + * Create a BillingMeterCollection. + * @member {string} [nextLink] Link to next page of resources. + */ + constructor() { + super(); + } + + /** + * Defines the metadata of BillingMeterCollection + * + * @returns {object} metadata of BillingMeterCollection + * + */ + mapper() { + return { + required: false, + serializedName: 'BillingMeterCollection', + type: { + name: 'Composite', + className: 'BillingMeterCollection', + modelProperties: { + value: { + required: true, + serializedName: '', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'BillingMeterElementType', + type: { + name: 'Composite', + className: 'BillingMeter' + } + } + } + }, + nextLink: { + required: false, + readOnly: true, + serializedName: 'nextLink', + type: { + name: 'String' + } + } + } + } + }; + } +} + +module.exports = BillingMeterCollection; diff --git a/lib/services/websiteManagement2/lib/models/defaultErrorResponseError.js b/lib/services/websiteManagement2/lib/models/defaultErrorResponseError.js index 678b354c64..db22658770 100644 --- a/lib/services/websiteManagement2/lib/models/defaultErrorResponseError.js +++ b/lib/services/websiteManagement2/lib/models/defaultErrorResponseError.js @@ -19,9 +19,9 @@ const models = require('./index'); class DefaultErrorResponseError { /** * Create a DefaultErrorResponseError. - * @member {string} code Standardized string to programmatically identify the - * error. - * @member {string} message Detailed error description and debugging + * @member {string} [code] Standardized string to programmatically identify + * the error. + * @member {string} [message] Detailed error description and debugging * information. * @member {string} [target] Detailed error description and debugging * information. @@ -46,7 +46,7 @@ class DefaultErrorResponseError { className: 'DefaultErrorResponseError', modelProperties: { code: { - required: true, + required: false, readOnly: true, serializedName: 'code', type: { @@ -54,7 +54,7 @@ class DefaultErrorResponseError { } }, message: { - required: true, + required: false, readOnly: true, serializedName: 'message', type: { diff --git a/lib/services/websiteManagement2/lib/models/defaultErrorResponseErrorDetailsItem.js b/lib/services/websiteManagement2/lib/models/defaultErrorResponseErrorDetailsItem.js index f5f3609ef2..5462c48e7a 100644 --- a/lib/services/websiteManagement2/lib/models/defaultErrorResponseErrorDetailsItem.js +++ b/lib/services/websiteManagement2/lib/models/defaultErrorResponseErrorDetailsItem.js @@ -17,9 +17,9 @@ class DefaultErrorResponseErrorDetailsItem { /** * Create a DefaultErrorResponseErrorDetailsItem. - * @member {string} code Standardized string to programmatically identify the - * error. - * @member {string} message Detailed error description and debugging + * @member {string} [code] Standardized string to programmatically identify + * the error. + * @member {string} [message] Detailed error description and debugging * information. * @member {string} [target] Detailed error description and debugging * information. @@ -42,7 +42,7 @@ class DefaultErrorResponseErrorDetailsItem { className: 'DefaultErrorResponseErrorDetailsItem', modelProperties: { code: { - required: true, + required: false, readOnly: true, serializedName: 'code', type: { @@ -50,7 +50,7 @@ class DefaultErrorResponseErrorDetailsItem { } }, message: { - required: true, + required: false, readOnly: true, serializedName: 'message', type: { diff --git a/lib/services/websiteManagement2/lib/models/handlerMapping.js b/lib/services/websiteManagement2/lib/models/handlerMapping.js index b517c55838..ee5dc87e3b 100644 --- a/lib/services/websiteManagement2/lib/models/handlerMapping.js +++ b/lib/services/websiteManagement2/lib/models/handlerMapping.js @@ -24,8 +24,8 @@ class HandlerMapping { * using the specified FastCGI application. * @member {string} [scriptProcessor] The absolute path to the FastCGI * application. - * @member {string} [arguments] Command-line arguments to be passed to the - * script processor. + * @member {string} [argumentsProperty] Command-line arguments to be passed + * to the script processor. */ constructor() { } @@ -58,7 +58,7 @@ class HandlerMapping { name: 'String' } }, - arguments: { + argumentsProperty: { required: false, serializedName: 'arguments', type: { diff --git a/lib/services/websiteManagement2/lib/models/index.d.ts b/lib/services/websiteManagement2/lib/models/index.d.ts index ba97df93da..2ccef7087d 100644 --- a/lib/services/websiteManagement2/lib/models/index.d.ts +++ b/lib/services/websiteManagement2/lib/models/index.d.ts @@ -1114,13 +1114,13 @@ export interface VirtualApplication { * using the specified FastCGI application. * @member {string} [scriptProcessor] The absolute path to the FastCGI * application. - * @member {string} [arguments] Command-line arguments to be passed to the - * script processor. + * @member {string} [argumentsProperty] Command-line arguments to be passed to + * the script processor. */ export interface HandlerMapping { extension?: string; scriptProcessor?: string; - arguments?: string; + argumentsProperty?: string; } /** @@ -2997,16 +2997,16 @@ export interface ErrorEntity { * @constructor * Detailed errors. * - * @member {string} code Standardized string to programmatically identify the + * @member {string} [code] Standardized string to programmatically identify the * error. - * @member {string} message Detailed error description and debugging + * @member {string} [message] Detailed error description and debugging * information. * @member {string} [target] Detailed error description and debugging * information. */ export interface DefaultErrorResponseErrorDetailsItem { - readonly code: string; - readonly message: string; + readonly code?: string; + readonly message?: string; readonly target?: string; } @@ -3016,9 +3016,9 @@ export interface DefaultErrorResponseErrorDetailsItem { * @constructor * Error model. * - * @member {string} code Standardized string to programmatically identify the + * @member {string} [code] Standardized string to programmatically identify the * error. - * @member {string} message Detailed error description and debugging + * @member {string} [message] Detailed error description and debugging * information. * @member {string} [target] Detailed error description and debugging * information. @@ -3026,8 +3026,8 @@ export interface DefaultErrorResponseErrorDetailsItem { * @member {string} [innererror] More information to debug error. */ export interface DefaultErrorResponseError { - readonly code: string; - readonly message: string; + readonly code?: string; + readonly message?: string; readonly target?: string; details?: DefaultErrorResponseErrorDetailsItem[]; readonly innererror?: string; @@ -3463,26 +3463,6 @@ export interface DiagnosticDetectorResponse extends ProxyOnlyResource { responseMetaData?: ResponseMetaData; } -/** - * @class - * Initializes a new instance of the BillingMeter class. - * @constructor - * Billing meter. - * - * @member {string} [meterId] Meter GUID onboarded in Commerce - * @member {string} [billingLocation] CSM Location - * @member {string} [shortName] Short Name from Azure pricing Page - * @member {string} [friendlyName] Meter Resource Name - * @member {string} [resourceType] ResourceType meter used for - */ -export interface BillingMeter { - meterId?: string; - billingLocation?: string; - shortName?: string; - friendlyName?: string; - resourceType?: string; -} - /** * @class * Initializes a new instance of the StackMinorVersion class. @@ -3678,6 +3658,27 @@ export interface ResourceHealthMetadata extends ProxyOnlyResource { signalAvailability?: boolean; } +/** + * @class + * Initializes a new instance of the BillingMeter class. + * @constructor + * App Service billing entity that contains information about meter which the + * Azure billing system utilizes to charge users for services. + * + * @member {string} [meterId] Meter GUID onboarded in Commerce + * @member {string} [billingLocation] Azure Location of billable resource + * @member {string} [shortName] Short Name from App Service Azure pricing Page + * @member {string} [friendlyName] Friendly name of the meter + * @member {string} [resourceType] App Service resource type meter used for + */ +export interface BillingMeter extends ProxyOnlyResource { + meterId?: string; + billingLocation?: string; + shortName?: string; + friendlyName?: string; + resourceType?: string; +} + /** * @class * Initializes a new instance of the CsmMoveResourceEnvelope class. @@ -6896,6 +6897,18 @@ export interface PremierAddOnOfferCollection extends Array { readonly nextLink?: string; } +/** + * @class + * Initializes a new instance of the BillingMeterCollection class. + * @constructor + * Collection of Billing Meters + * + * @member {string} [nextLink] Link to next page of resources. + */ +export interface BillingMeterCollection extends Array { + readonly nextLink?: string; +} + /** * @class * Initializes a new instance of the WebAppCollection class. diff --git a/lib/services/websiteManagement2/lib/models/index.js b/lib/services/websiteManagement2/lib/models/index.js index 3dc66f961a..af2e518523 100644 --- a/lib/services/websiteManagement2/lib/models/index.js +++ b/lib/services/websiteManagement2/lib/models/index.js @@ -129,13 +129,13 @@ exports.AnalysisDefinition = require('./analysisDefinition'); exports.DiagnosticAnalysis = require('./diagnosticAnalysis'); exports.DiagnosticCategory = require('./diagnosticCategory'); exports.DiagnosticDetectorResponse = require('./diagnosticDetectorResponse'); -exports.BillingMeter = require('./billingMeter'); exports.StackMinorVersion = require('./stackMinorVersion'); exports.StackMajorVersion = require('./stackMajorVersion'); exports.ApplicationStack = require('./applicationStack'); exports.Recommendation = require('./recommendation'); exports.RecommendationRule = require('./recommendationRule'); exports.ResourceHealthMetadata = require('./resourceHealthMetadata'); +exports.BillingMeter = require('./billingMeter'); exports.CsmMoveResourceEnvelope = require('./csmMoveResourceEnvelope'); exports.GeoRegion = require('./geoRegion'); exports.HostingEnvironmentDeploymentInfo = require('./hostingEnvironmentDeploymentInfo'); @@ -244,6 +244,7 @@ exports.SourceControlCollection = require('./sourceControlCollection'); exports.GeoRegionCollection = require('./geoRegionCollection'); exports.IdentifierCollection = require('./identifierCollection'); exports.PremierAddOnOfferCollection = require('./premierAddOnOfferCollection'); +exports.BillingMeterCollection = require('./billingMeterCollection'); exports.WebAppCollection = require('./webAppCollection'); exports.BackupItemCollection = require('./backupItemCollection'); exports.SiteConfigResourceCollection = require('./siteConfigResourceCollection'); diff --git a/lib/services/websiteManagement2/lib/operations/billingMeters.js b/lib/services/websiteManagement2/lib/operations/billingMeters.js new file mode 100644 index 0000000000..19ed4bd40c --- /dev/null +++ b/lib/services/websiteManagement2/lib/operations/billingMeters.js @@ -0,0 +1,483 @@ +/* + * Copyright (c) Microsoft Corporation. All rights reserved. + * Licensed under the MIT License. See License.txt in the project root for + * license information. + * + * Code generated by Microsoft (R) AutoRest Code Generator. + * Changes may cause incorrect behavior and will be lost if the code is + * regenerated. + */ + +'use strict'; + +const msRest = require('ms-rest'); +const msRestAzure = require('ms-rest-azure'); +const WebResource = msRest.WebResource; + +/** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.billingLocation] Azure Location of billable + * resource + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BillingMeterCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _list(options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + let billingLocation = (options && options.billingLocation !== undefined) ? options.billingLocation : undefined; + let apiVersion = '2016-03-01'; + // Validate + try { + if (billingLocation !== null && billingLocation !== undefined && typeof billingLocation.valueOf() !== 'string') { + throw new Error('billingLocation must be of type string.'); + } + if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let baseUrl = this.client.baseUri; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/billingMeters'; + requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); + let queryParameters = []; + if (billingLocation !== null && billingLocation !== undefined) { + queryParameters.push('billingLocation=' + encodeURIComponent(billingLocation)); + } + queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['BillingMeterCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BillingMeterCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ +function _listNext(nextPageLink, options, callback) { + /* jshint validthis: true */ + let client = this.client; + if(!callback && typeof options === 'function') { + callback = options; + options = null; + } + if (!callback) { + throw new Error('callback cannot be null.'); + } + // Validate + try { + if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { + throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { + throw new Error('this.client.acceptLanguage must be of type string.'); + } + } catch (error) { + return callback(error); + } + + // Construct URL + let requestUrl = '{nextLink}'; + requestUrl = requestUrl.replace('{nextLink}', nextPageLink); + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; + try { + parsedResponse = JSON.parse(responseBody); + result = JSON.parse(responseBody); + if (parsedResponse !== null && parsedResponse !== undefined) { + let resultMapper = new client.models['BillingMeterCollection']().mapper(); + result = client.deserialize(resultMapper, parsedResponse, 'result'); + } + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); + } + } + + return callback(null, result, httpRequest, response); + }); +} + +/** Class representing a BillingMeters. */ +class BillingMeters { + /** + * Create a BillingMeters. + * @param {WebSiteManagementClient} client Reference to the service client. + */ + constructor(client) { + this.client = client; + this._list = _list; + this._listNext = _listNext; + } + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.billingLocation] Azure Location of billable + * resource + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listWithHttpOperationResponse(options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.billingLocation] Azure Location of billable + * resource + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {BillingMeterCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BillingMeterCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + list(options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._list(options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._list(options, optionalCallback); + } + } + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {BillingMeterCollection} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BillingMeterCollection} for more + * information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._listNext(nextPageLink, options, optionalCallback); + } + } + +} + +module.exports = BillingMeters; diff --git a/lib/services/websiteManagement2/lib/operations/index.d.ts b/lib/services/websiteManagement2/lib/operations/index.d.ts index 2a958a79ea..f99d619675 100644 --- a/lib/services/websiteManagement2/lib/operations/index.d.ts +++ b/lib/services/websiteManagement2/lib/operations/index.d.ts @@ -6894,69 +6894,6 @@ export interface Diagnostics { getSiteDetectorSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } -/** - * @class - * Global - * __NOTE__: An instance of this class is automatically created for an - * instance of the WebSiteManagementClient. - */ -export interface Global { - - - /** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getBillingMetersWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {Array} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {Array} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getBillingMeters(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getBillingMeters(callback: ServiceCallback): void; - getBillingMeters(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - /** * @class * Provider @@ -8845,6 +8782,139 @@ export interface ResourceHealthMetadataOperations { listBySiteSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } +/** + * @class + * BillingMeters + * __NOTE__: An instance of this class is automatically created for an + * instance of the WebSiteManagementClient. + */ +export interface BillingMeters { + + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.billingLocation] Azure Location of billable + * resource + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listWithHttpOperationResponse(options?: { billingLocation? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {object} [options] Optional Parameters. + * + * @param {string} [options.billingLocation] Azure Location of billable + * resource + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {BillingMeterCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {BillingMeterCollection} [result] - The deserialized result object if an error did not occur. + * See {@link BillingMeterCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + list(options?: { billingLocation? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + list(callback: ServiceCallback): void; + list(options: { billingLocation? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + */ + listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + + /** + * @summary Gets a list of meters for a given location. + * + * Gets a list of meters for a given location. + * + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {BillingMeterCollection} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {BillingMeterCollection} [result] - The deserialized result object if an error did not occur. + * See {@link BillingMeterCollection} for more + * information. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. + */ + listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; + listNext(nextPageLink: string, callback: ServiceCallback): void; + listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; +} + /** * @class * WebApps @@ -9428,19 +9498,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -9450,7 +9507,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.Site, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.Site, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Creates a new web, mobile, or API app in an existing resource @@ -9837,19 +9894,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -9875,9 +9919,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; createOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -9900,9 +9944,6 @@ export interface WebApps { * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -9912,7 +9953,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, skipDnsRegistration? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Deletes a web, mobile, or API app, or one of the deployment slots. @@ -9934,9 +9975,6 @@ export interface WebApps { * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -9961,9 +9999,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, name: string, options?: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, skipDnsRegistration? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, name: string, options?: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; deleteMethod(resourceGroupName: string, name: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, name: string, options: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, skipDnsRegistration? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, name: string, options: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -10342,19 +10380,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -10364,7 +10389,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Creates a new web, mobile, or API app in an existing resource @@ -10742,19 +10767,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -10780,9 +10792,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; update(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, callback: ServiceCallback): void; - update(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, options: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -40215,19 +40227,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -40237,7 +40236,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.Site, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.Site, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Creates a new web, mobile, or API app in an existing resource @@ -40624,19 +40623,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -40662,9 +40648,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; beginCreateOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** diff --git a/lib/services/websiteManagement2/lib/operations/index.js b/lib/services/websiteManagement2/lib/operations/index.js index a7f2101d8e..3a92dd8e10 100644 --- a/lib/services/websiteManagement2/lib/operations/index.js +++ b/lib/services/websiteManagement2/lib/operations/index.js @@ -22,10 +22,10 @@ exports.DomainRegistrationProvider = require('./domainRegistrationProvider'); exports.Certificates = require('./certificates'); exports.DeletedWebApps = require('./deletedWebApps'); exports.Diagnostics = require('./diagnostics'); -exports.Global = require('./global'); exports.Provider = require('./provider'); exports.Recommendations = require('./recommendations'); exports.ResourceHealthMetadataOperations = require('./resourceHealthMetadataOperations'); +exports.BillingMeters = require('./billingMeters'); exports.WebApps = require('./webApps'); exports.AppServiceEnvironments = require('./appServiceEnvironments'); exports.AppServicePlans = require('./appServicePlans'); diff --git a/lib/services/websiteManagement2/lib/operations/webApps.js b/lib/services/websiteManagement2/lib/operations/webApps.js index 5512ecb8d8..2770531df4 100644 --- a/lib/services/websiteManagement2/lib/operations/webApps.js +++ b/lib/services/websiteManagement2/lib/operations/webApps.js @@ -858,19 +858,6 @@ function _get(resourceGroupName, name, options, callback) { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -959,9 +946,6 @@ function _createOrUpdate(resourceGroupName, name, siteEnvelope, options, callbac * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -989,7 +973,6 @@ function _deleteMethod(resourceGroupName, name, options, callback) { } let deleteMetrics = (options && options.deleteMetrics !== undefined) ? options.deleteMetrics : undefined; let deleteEmptyServerFarm = (options && options.deleteEmptyServerFarm !== undefined) ? options.deleteEmptyServerFarm : undefined; - let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; let apiVersion = '2016-08-01'; // Validate try { @@ -1019,9 +1002,6 @@ function _deleteMethod(resourceGroupName, name, options, callback) { if (deleteEmptyServerFarm !== null && deleteEmptyServerFarm !== undefined && typeof deleteEmptyServerFarm !== 'boolean') { throw new Error('deleteEmptyServerFarm must be of type boolean.'); } - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { - throw new Error('skipDnsRegistration must be of type boolean.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1045,9 +1025,6 @@ function _deleteMethod(resourceGroupName, name, options, callback) { if (deleteEmptyServerFarm !== null && deleteEmptyServerFarm !== undefined) { queryParameters.push('deleteEmptyServerFarm=' + encodeURIComponent(deleteEmptyServerFarm.toString())); } - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { - queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); - } queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -1489,19 +1466,6 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -1528,10 +1492,6 @@ function _update(resourceGroupName, name, siteEnvelope, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; - let skipCustomDomainVerification = (options && options.skipCustomDomainVerification !== undefined) ? options.skipCustomDomainVerification : undefined; - let forceDnsRegistration = (options && options.forceDnsRegistration !== undefined) ? options.forceDnsRegistration : undefined; - let ttlInSeconds = (options && options.ttlInSeconds !== undefined) ? options.ttlInSeconds : undefined; let apiVersion = '2016-08-01'; // Validate try { @@ -1558,18 +1518,6 @@ function _update(resourceGroupName, name, siteEnvelope, options, callback) { if (siteEnvelope === null || siteEnvelope === undefined) { throw new Error('siteEnvelope cannot be null or undefined.'); } - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { - throw new Error('skipDnsRegistration must be of type boolean.'); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined && typeof skipCustomDomainVerification !== 'boolean') { - throw new Error('skipCustomDomainVerification must be of type boolean.'); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined && typeof forceDnsRegistration !== 'boolean') { - throw new Error('forceDnsRegistration must be of type boolean.'); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined && typeof ttlInSeconds.valueOf() !== 'string') { - throw new Error('ttlInSeconds must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -1587,18 +1535,6 @@ function _update(resourceGroupName, name, siteEnvelope, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { - queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined) { - queryParameters.push('skipCustomDomainVerification=' + encodeURIComponent(skipCustomDomainVerification.toString())); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined) { - queryParameters.push('forceDnsRegistration=' + encodeURIComponent(forceDnsRegistration.toString())); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined) { - queryParameters.push('ttlInSeconds=' + encodeURIComponent(ttlInSeconds)); - } queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -55282,19 +55218,6 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -55321,10 +55244,6 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; - let skipCustomDomainVerification = (options && options.skipCustomDomainVerification !== undefined) ? options.skipCustomDomainVerification : undefined; - let forceDnsRegistration = (options && options.forceDnsRegistration !== undefined) ? options.forceDnsRegistration : undefined; - let ttlInSeconds = (options && options.ttlInSeconds !== undefined) ? options.ttlInSeconds : undefined; let apiVersion = '2016-08-01'; // Validate try { @@ -55351,18 +55270,6 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca if (siteEnvelope === null || siteEnvelope === undefined) { throw new Error('siteEnvelope cannot be null or undefined.'); } - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { - throw new Error('skipDnsRegistration must be of type boolean.'); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined && typeof skipCustomDomainVerification !== 'boolean') { - throw new Error('skipCustomDomainVerification must be of type boolean.'); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined && typeof forceDnsRegistration !== 'boolean') { - throw new Error('forceDnsRegistration must be of type boolean.'); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined && typeof ttlInSeconds.valueOf() !== 'string') { - throw new Error('ttlInSeconds must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } @@ -55380,18 +55287,6 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { - queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined) { - queryParameters.push('skipCustomDomainVerification=' + encodeURIComponent(skipCustomDomainVerification.toString())); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined) { - queryParameters.push('forceDnsRegistration=' + encodeURIComponent(forceDnsRegistration.toString())); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined) { - queryParameters.push('ttlInSeconds=' + encodeURIComponent(ttlInSeconds)); - } queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -68327,19 +68222,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -68748,19 +68630,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -68826,9 +68695,6 @@ class WebApps { * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -68872,9 +68738,6 @@ class WebApps { * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -69295,19 +69158,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -69707,19 +69557,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -107430,19 +107267,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -107851,19 +107675,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * diff --git a/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts b/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts index 11de86f278..0016cb7d6d 100644 --- a/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts +++ b/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts @@ -62,10 +62,10 @@ export default class WebSiteManagementClient extends AzureServiceClient { certificates: operations.Certificates; deletedWebApps: operations.DeletedWebApps; diagnostics: operations.Diagnostics; - global: operations.Global; provider: operations.Provider; recommendations: operations.Recommendations; resourceHealthMetadataOperations: operations.ResourceHealthMetadataOperations; + billingMeters: operations.BillingMeters; webApps: operations.WebApps; appServiceEnvironments: operations.AppServiceEnvironments; appServicePlans: operations.AppServicePlans; diff --git a/lib/services/websiteManagement2/lib/webSiteManagementClient.js b/lib/services/websiteManagement2/lib/webSiteManagementClient.js index 0d65abd6c7..beb4798477 100644 --- a/lib/services/websiteManagement2/lib/webSiteManagementClient.js +++ b/lib/services/websiteManagement2/lib/webSiteManagementClient.js @@ -2890,10 +2890,10 @@ class WebSiteManagementClient extends ServiceClient { this.certificates = new operations.Certificates(this); this.deletedWebApps = new operations.DeletedWebApps(this); this.diagnostics = new operations.Diagnostics(this); - this.global = new operations.Global(this); this.provider = new operations.Provider(this); this.recommendations = new operations.Recommendations(this); this.resourceHealthMetadataOperations = new operations.ResourceHealthMetadataOperations(this); + this.billingMeters = new operations.BillingMeters(this); this.webApps = new operations.WebApps(this); this.appServiceEnvironments = new operations.AppServiceEnvironments(this); this.appServicePlans = new operations.AppServicePlans(this); diff --git a/lib/services/websiteManagement2/package.json b/lib/services/websiteManagement2/package.json new file mode 100644 index 0000000000..423c98b02d --- /dev/null +++ b/lib/services/websiteManagement2/package.json @@ -0,0 +1,22 @@ +{ + "name": "azure-arm-website", + "author": "Microsoft Corporation", + "description": "WebSiteManagementClient Library with typescript type definitions for node", + "version": "3.0.0-preview", + "dependencies": { + "ms-rest": "^2.3.2", + "ms-rest-azure": "^2.5.5" + }, + "keywords": [ "node", "azure" ], + "license": "MIT", + "main": "./lib/webSiteManagementClient.js", + "types": "./lib/webSiteManagementClient.d.ts", + "homepage": "http://github.com/azure/azure-sdk-for-node", + "repository": { + "type": "git", + "url": "https://github.com/azure/azure-sdk-for-node.git" + }, + "bugs": { + "url": "http://github.com/Azure/azure-sdk-for-node/issues" + } +} From 4b8b6b672bb6cc0935ad091c519b361e6c85192c Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 26 Apr 2018 10:58:29 -0700 Subject: [PATCH 3/9] Generated from 94426dd9c084482cf78b5515094a389b6995bd5c (#2791) Another location of the error --- .../lib/models/dataTableResponseColumn.js | 69 + .../lib/models/dataTableResponseObject.js | 92 + .../lib/models/detectorInfo.js | 81 + .../lib/models/detectorResponse.js | 109 + .../lib/models/detectorResponseCollection.js | 68 + .../lib/models/diagnosticData.js | 74 + .../websiteManagement2/lib/models/index.d.ts | 124 + .../websiteManagement2/lib/models/index.js | 7 + .../lib/models/rendering.js | 71 + .../lib/operations/appServiceEnvironments.js | 4 +- .../lib/operations/diagnostics.js | 3383 ++++++++++++++--- .../lib/operations/index.d.ts | 759 +++- 12 files changed, 4273 insertions(+), 568 deletions(-) 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/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/diagnosticData.js create mode 100644 lib/services/websiteManagement2/lib/models/rendering.js 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..9b1b335eb2 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/dataTableResponseObject.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'); + +/** + * 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/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/diagnosticData.js b/lib/services/websiteManagement2/lib/models/diagnosticData.js new file mode 100644 index 0000000000..e583cf9598 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/diagnosticData.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'; + +const models = require('./index'); + +/** + * 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.renderingType] 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/index.d.ts b/lib/services/websiteManagement2/lib/models/index.d.ts index 2ccef7087d..1ad4b42f71 100644 --- a/lib/services/websiteManagement2/lib/models/index.d.ts +++ b/lib/services/websiteManagement2/lib/models/index.d.ts @@ -3391,6 +3391,118 @@ 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} [renderingType] 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 { + renderingType?: 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.renderingType] 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. @@ -6777,6 +6889,18 @@ 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. diff --git a/lib/services/websiteManagement2/lib/models/index.js b/lib/services/websiteManagement2/lib/models/index.js index af2e518523..2e4f391d06 100644 --- a/lib/services/websiteManagement2/lib/models/index.js +++ b/lib/services/websiteManagement2/lib/models/index.js @@ -126,6 +126,12 @@ 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'); @@ -234,6 +240,7 @@ 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'); diff --git a/lib/services/websiteManagement2/lib/models/rendering.js b/lib/services/websiteManagement2/lib/models/rendering.js new file mode 100644 index 0000000000..09e9783dbb --- /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} [renderingType] 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: { + renderingType: { + required: false, + serializedName: 'renderingType', + 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/operations/appServiceEnvironments.js b/lib/services/websiteManagement2/lib/operations/appServiceEnvironments.js index 77b8ecdb35..ad008a5ab6 100644 --- a/lib/services/websiteManagement2/lib/operations/appServiceEnvironments.js +++ b/lib/services/websiteManagement2/lib/operations/appServiceEnvironments.js @@ -2930,7 +2930,7 @@ function _listMultiRolePoolInstanceMetrics(resourceGroupName, name, instance, op // 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'; + 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)); @@ -5689,7 +5689,7 @@ function _listWorkerPoolInstanceMetrics(resourceGroupName, name, workerPoolName, // 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'; + 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)); diff --git a/lib/services/websiteManagement2/lib/operations/diagnostics.js b/lib/services/websiteManagement2/lib/operations/diagnostics.js index 9eb79eb3f3..c33b53260b 100644 --- a/lib/services/websiteManagement2/lib/operations/diagnostics.js +++ b/lib/services/websiteManagement2/lib/operations/diagnostics.js @@ -15,14 +15,14 @@ const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; /** - * @summary Get Diagnostics Categories + * @summary List Hosting Environment Detector Responses * - * Get Diagnostics Categories + * List Hosting Environment Detector Responses * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} siteName Site Name + * @param {string} name Site Name * * @param {object} [options] Optional Parameters. * @@ -36,14 +36,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 DiagnosticCategoryCollection} for more + * 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 _listSiteDiagnosticCategories(resourceGroupName, siteName, options, callback) { +function _listHostingEnvironmentDetectorResponses(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -73,8 +73,8 @@ function _listSiteDiagnosticCategories(resourceGroupName, siteName, options, cal 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.'); @@ -88,9 +88,9 @@ function _listSiteDiagnosticCategories(resourceGroupName, siteName, options, cal // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors'; 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(apiVersion)); @@ -160,7 +160,7 @@ function _listSiteDiagnosticCategories(resourceGroupName, siteName, options, cal parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticCategoryCollection']().mapper(); + let resultMapper = new client.models['DetectorResponseCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -176,19 +176,25 @@ function _listSiteDiagnosticCategories(resourceGroupName, siteName, options, cal } /** - * @summary Get Diagnostics Category + * @summary Get Hosting Environment Detector Response * - * Get Diagnostics Category + * Get Hosting Environment Detector Response * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} siteName Site Name + * @param {string} name App Service Environment Name * - * @param {string} diagnosticCategory Diagnostic Category + * @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 * @@ -199,13 +205,13 @@ function _listSiteDiagnosticCategories(resourceGroupName, siteName, 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 DiagnosticCategory} for more information. + * 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 _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCategory, options, callback) { +function _getHostingEnvironmentDetectorResponse(resourceGroupName, name, detectorName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -215,6 +221,9 @@ function _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCateg 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 apiVersion = '2016-03-01'; // Validate try { @@ -235,11 +244,28 @@ function _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCateg 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 (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 (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.'); @@ -253,12 +279,21 @@ function _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCateg // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}'; + 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('{siteName}', encodeURIComponent(siteName)); - requestUrl = requestUrl.replace('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); + 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(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -326,7 +361,7 @@ function _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCateg parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticCategory']().mapper(); + let resultMapper = new client.models['DetectorResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -342,17 +377,15 @@ function _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCateg } /** - * @summary Get Site Analyses + * @summary List Site Detector Responses * - * Get Site Analyses + * List Site Detector Responses * * @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 @@ -365,14 +398,14 @@ function _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCateg * {Error} 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 + * 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 _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, options, callback) { +function _listSiteDetectorResponses(resourceGroupName, siteName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -405,9 +438,6 @@ function _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, opti 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.'); } @@ -420,10 +450,9 @@ function _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, opti // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses'; + 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('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); @@ -493,7 +522,7 @@ function _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, opti parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticAnalysisCollection']().mapper(); + let resultMapper = new client.models['DetectorResponseCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -509,21 +538,25 @@ function _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, opti } /** - * @summary Get Site Analysis + * @summary Get site detector response * - * Get Site Analysis + * Get site detector response * * @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} 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 * @@ -534,13 +567,13 @@ function _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, 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 DiagnosticAnalysis} for more information. + * 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 _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analysisName, options, callback) { +function _getSiteDetectorResponse(resourceGroupName, siteName, detectorName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -550,6 +583,9 @@ function _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analy 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 apiVersion = '2016-03-01'; // Validate try { @@ -573,11 +609,25 @@ function _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analy 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 (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.'); @@ -591,13 +641,21 @@ function _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analy // 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}'; + 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('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); - requestUrl = requestUrl.replace('{analysisName}', encodeURIComponent(analysisName)); + 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(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -665,7 +723,7 @@ function _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analy parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticAnalysis']().mapper(); + let resultMapper = new client.models['DetectorResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -681,27 +739,17 @@ function _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analy } /** - * @summary Execute Analysis + * @summary Get Diagnostics Categories * - * Execute Analysis + * Get Diagnostics Categories * * @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 * @@ -712,13 +760,14 @@ function _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analy * {Error} 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. + * 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 _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analysisName, options, callback) { +function _listSiteDiagnosticCategories(resourceGroupName, siteName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -728,9 +777,6 @@ function _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, a 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 apiVersion = '2016-03-01'; // Validate try { @@ -754,29 +800,6 @@ function _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, a 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.'); } @@ -789,22 +812,11 @@ function _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, a // 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'; + 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('{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(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -812,7 +824,7 @@ function _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, a // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -872,7 +884,7 @@ function _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, a parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticAnalysis']().mapper(); + let resultMapper = new client.models['DiagnosticCategoryCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -888,9 +900,9 @@ function _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, a } /** - * @summary Get Detectors + * @summary Get Diagnostics Category * - * Get Detectors + * Get Diagnostics Category * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -911,14 +923,13 @@ function _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, a * {Error} 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. + * 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 _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, options, callback) { +function _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCategory, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -966,7 +977,7 @@ function _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, opt // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors'; + 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)); @@ -1039,7 +1050,7 @@ function _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, opt parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticDetectorCollection']().mapper(); + let resultMapper = new client.models['DiagnosticCategory']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1055,9 +1066,9 @@ function _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, opt } /** - * @summary Get Detector + * @summary Get Site Analyses * - * Get Detector + * Get Site Analyses * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -1066,8 +1077,6 @@ function _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, opt * * @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 @@ -1080,14 +1089,14 @@ function _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, 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 DiagnosticDetectorCollection} for more + * 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 _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detectorName, options, callback) { +function _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1123,9 +1132,6 @@ function _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detec 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.'); } @@ -1138,11 +1144,10 @@ function _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detec // 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}'; + 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('{detectorName}', encodeURIComponent(detectorName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); @@ -1212,7 +1217,7 @@ function _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detec parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticDetectorCollection']().mapper(); + let resultMapper = new client.models['DiagnosticAnalysisCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1228,27 +1233,21 @@ function _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detec } /** - * @summary Execute Detector + * @summary Get Site Analysis * - * Execute Detector + * Get Site Analysis * * @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 Diagnostic Category * - * @param {string} diagnosticCategory Category Name + * @param {string} analysisName Analysis 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 * @@ -1259,14 +1258,13 @@ function _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detec * {Error} 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. + * 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 _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnosticCategory, options, callback) { +function _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analysisName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1276,9 +1274,6 @@ function _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnos 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 apiVersion = '2016-03-01'; // Validate try { @@ -1302,28 +1297,11 @@ function _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnos 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 (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.'); @@ -1337,22 +1315,13 @@ function _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnos // 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'; + 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('{detectorName}', encodeURIComponent(detectorName)); 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(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -1360,7 +1329,7 @@ function _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnos // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -1420,7 +1389,7 @@ function _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnos parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticDetectorResponse']().mapper(); + let resultMapper = new client.models['DiagnosticAnalysis']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1436,19 +1405,27 @@ function _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnos } /** - * @summary Get Diagnostics Categories + * @summary Execute Analysis * - * Get Diagnostics Categories + * Execute Analysis * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} siteName Site Name * - * @param {string} slot Slot 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 * @@ -1459,14 +1436,13 @@ function _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnos * {Error} 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. + * 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 _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, options, callback) { +function _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analysisName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1476,6 +1452,9 @@ function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, op 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 apiVersion = '2016-03-01'; // Validate try { @@ -1499,8 +1478,28 @@ function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, op 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 (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.'); @@ -1514,12 +1513,22 @@ function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, op // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics'; + 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('{slot}', encodeURIComponent(slot)); + 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(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -1527,7 +1536,7 @@ function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, op // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -1587,7 +1596,7 @@ function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, op parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticCategoryCollection']().mapper(); + let resultMapper = new client.models['DiagnosticAnalysis']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1603,9 +1612,9 @@ function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, op } /** - * @summary Get Diagnostics Category + * @summary Get Detectors * - * Get Diagnostics Category + * Get Detectors * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -1614,8 +1623,6 @@ function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, op * * @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 @@ -1628,13 +1635,14 @@ function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, op * {Error} 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. + * 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 _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticCategory, slot, options, callback) { +function _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1670,9 +1678,6 @@ function _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticC 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.'); } @@ -1685,11 +1690,10 @@ function _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticC // 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}'; + 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('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); @@ -1759,7 +1763,7 @@ function _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticC parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticCategory']().mapper(); + let resultMapper = new client.models['DiagnosticDetectorCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1775,9 +1779,9 @@ function _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticC } /** - * @summary Get Site Analyses + * @summary Get Detector * - * Get Site Analyses + * Get Detector * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -1786,7 +1790,7 @@ function _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticC * * @param {string} diagnosticCategory Diagnostic Category * - * @param {string} slot Slot Name + * @param {string} detectorName Detector Name * * @param {object} [options] Optional Parameters. * @@ -1800,14 +1804,14 @@ function _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticC * {Error} 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 + * 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 _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, slot, options, callback) { +function _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detectorName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1843,8 +1847,8 @@ function _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, 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 (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.'); @@ -1858,11 +1862,11 @@ function _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, // 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'; + 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('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{detectorName}', encodeURIComponent(detectorName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); @@ -1932,7 +1936,7 @@ function _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticAnalysisCollection']().mapper(); + let resultMapper = new client.models['DiagnosticDetectorCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1948,23 +1952,27 @@ function _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, } /** - * @summary Get Site Analysis + * @summary Execute Detector * - * Get Site Analysis + * Execute 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} analysisName Analysis Name + * @param {string} detectorName Detector Resource Name * - * @param {string} slot Slot - optional + * @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 * @@ -1975,13 +1983,14 @@ function _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, * {Error} 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. + * 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 _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, analysisName, slot, options, callback) { +function _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnosticCategory, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1991,6 +2000,9 @@ function _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, a 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 apiVersion = '2016-03-01'; // Validate try { @@ -2014,14 +2026,28 @@ function _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, a 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 (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 (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { - throw new Error('slot cannot be null or undefined and it 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.'); @@ -2035,14 +2061,22 @@ function _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, a // 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}'; + 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('{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(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -2050,7 +2084,7 @@ function _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, a // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -2110,7 +2144,7 @@ function _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, a parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticAnalysis']().mapper(); + let resultMapper = new client.models['DiagnosticDetectorResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2126,29 +2160,19 @@ function _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, a } /** - * @summary Execute Analysis + * @summary List Site Detector Responses * - * Execute Analysis + * List Site Detector Responses * * @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 * @@ -2159,13 +2183,14 @@ function _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, a * {Error} 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. + * 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 _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, analysisName, slot, options, callback) { +function _listSiteDetectorResponsesSlot(resourceGroupName, siteName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2175,9 +2200,6 @@ function _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategor 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 apiVersion = '2016-03-01'; // Validate try { @@ -2201,32 +2223,9 @@ function _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategor 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.'); } @@ -2239,23 +2238,12 @@ function _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategor // 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'; + 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('{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(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -2263,7 +2251,7 @@ function _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategor // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -2323,7 +2311,7 @@ function _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategor parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticAnalysis']().mapper(); + let resultMapper = new client.models['DetectorResponseCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2339,39 +2327,44 @@ function _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategor } /** - * @summary Get Detectors + * @summary Get site detector response * - * Get Detectors + * Get site detector response * * @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 Resource Name * * @param {string} slot Slot Name * * @param {object} [options] Optional Parameters. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {date} [options.startTime] Start Time * - * @param {function} callback - The callback. + * @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 DiagnosticDetectorCollection} for more - * information. + * 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 _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, slot, options, callback) { +function _getSiteDetectorResponseSlot(resourceGroupName, siteName, detectorName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2381,6 +2374,9 @@ function _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, 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 apiVersion = '2016-03-01'; // Validate try { @@ -2404,12 +2400,29 @@ function _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, 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 (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.'); } @@ -2422,13 +2435,22 @@ function _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, // 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'; + 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('{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 = []; + 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(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -2496,7 +2518,7 @@ function _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticDetectorCollection']().mapper(); + let resultMapper = new client.models['DetectorResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2512,19 +2534,15 @@ function _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, } /** - * @summary Get Detector + * @summary Get Diagnostics Categories * - * Get Detector + * Get Diagnostics Categories * * @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. @@ -2539,14 +2557,14 @@ function _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, * {Error} 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 + * 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 _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, detectorName, slot, options, callback) { +function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2579,12 +2597,6 @@ function _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, d 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.'); } @@ -2600,11 +2612,9 @@ function _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, d // 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}'; + 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('{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 = []; @@ -2675,7 +2685,7 @@ function _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, d parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticDetectorCollection']().mapper(); + let resultMapper = new client.models['DiagnosticCategoryCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2691,29 +2701,21 @@ function _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, d } /** - * @summary Execute Detector + * @summary Get Diagnostics Category * - * Execute Detector + * Get Diagnostics Category * * @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} diagnosticCategory Diagnostic Category * * @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 * @@ -2724,14 +2726,13 @@ function _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, d * {Error} 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. + * 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 _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, diagnosticCategory, slot, options, callback) { +function _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticCategory, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2741,9 +2742,6 @@ function _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, dia 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 apiVersion = '2016-03-01'; // Validate try { @@ -2767,32 +2765,12 @@ function _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, dia 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.'); } @@ -2805,23 +2783,13 @@ function _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, dia // 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'; + 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('{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(apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); @@ -2829,7 +2797,7 @@ function _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, dia // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -2889,7 +2857,7 @@ function _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, dia parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticDetectorResponse']().mapper(); + let resultMapper = new client.models['DiagnosticCategory']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2905,12 +2873,18 @@ function _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, dia } /** - * @summary Get Diagnostics Categories + * @summary Get Site Analyses * - * Get Diagnostics Categories + * Get Site Analyses * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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. * @@ -2924,14 +2898,14 @@ function _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, dia * {Error} 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 + * 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 _listSiteDiagnosticCategoriesNext(nextPageLink, options, callback) { +function _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2941,10 +2915,37 @@ function _listSiteDiagnosticCategoriesNext(nextPageLink, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2016-03-01'; // Validate try { - if (nextPageLink === 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 (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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -2954,8 +2955,18 @@ function _listSiteDiagnosticCategoriesNext(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.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); @@ -3019,7 +3030,7 @@ function _listSiteDiagnosticCategoriesNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticCategoryCollection']().mapper(); + let resultMapper = new client.models['DiagnosticAnalysisCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3035,12 +3046,20 @@ function _listSiteDiagnosticCategoriesNext(nextPageLink, options, callback) { } /** - * @summary Get Site Analyses + * @summary Get Site Analysis * - * Get Site Analyses + * Get Site Analysis * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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. * @@ -3054,14 +3073,13 @@ function _listSiteDiagnosticCategoriesNext(nextPageLink, 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 DiagnosticAnalysisCollection} for more - * information. + * 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 _listSiteAnalysesNext(nextPageLink, options, callback) { +function _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, analysisName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3071,10 +3089,40 @@ function _listSiteAnalysesNext(nextPageLink, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2016-03-01'; // Validate try { - if (nextPageLink === 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 (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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -3084,12 +3132,23 @@ function _listSiteAnalysesNext(nextPageLink, options, callback) { } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -3149,7 +3208,7 @@ function _listSiteAnalysesNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticAnalysisCollection']().mapper(); + let resultMapper = new client.models['DiagnosticAnalysis']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3165,15 +3224,29 @@ function _listSiteAnalysesNext(nextPageLink, options, callback) { } /** - * @summary Get Detectors + * @summary Execute Analysis * - * Get Detectors + * Execute Analysis * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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 * @@ -3184,14 +3257,13 @@ function _listSiteAnalysesNext(nextPageLink, 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 DiagnosticDetectorCollection} for more - * information. + * 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 _listSiteDetectorsNext(nextPageLink, options, callback) { +function _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, analysisName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3201,10 +3273,60 @@ function _listSiteDetectorsNext(nextPageLink, options, callback) { 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 apiVersion = '2016-03-01'; // Validate try { - if (nextPageLink === 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 (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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -3214,12 +3336,32 @@ function _listSiteDetectorsNext(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.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(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 @@ -3279,7 +3421,7 @@ function _listSiteDetectorsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticDetectorCollection']().mapper(); + let resultMapper = new client.models['DiagnosticAnalysis']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3295,12 +3437,18 @@ function _listSiteDetectorsNext(nextPageLink, options, callback) { } /** - * @summary Get Detector + * @summary Get Detectors * - * Get Detector + * Get Detectors * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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. * @@ -3321,7 +3469,7 @@ function _listSiteDetectorsNext(nextPageLink, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getSiteDetectorNext(nextPageLink, options, callback) { +function _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3331,10 +3479,37 @@ function _getSiteDetectorNext(nextPageLink, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2016-03-01'; // Validate try { - if (nextPageLink === 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 (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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -3344,8 +3519,18 @@ function _getSiteDetectorNext(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.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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } // Create HTTP transport objects let httpRequest = new WebResource(); @@ -3425,12 +3610,20 @@ function _getSiteDetectorNext(nextPageLink, options, callback) { } /** - * @summary Get Diagnostics Categories + * @summary Get Detector * - * Get Diagnostics Categories + * Get Detector * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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. * @@ -3444,14 +3637,14 @@ function _getSiteDetectorNext(nextPageLink, 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 DiagnosticCategoryCollection} for more + * 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 _listSiteDiagnosticCategoriesSlotNext(nextPageLink, options, callback) { +function _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, detectorName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3461,10 +3654,40 @@ function _listSiteDiagnosticCategoriesSlotNext(nextPageLink, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } + let apiVersion = '2016-03-01'; // Validate try { - if (nextPageLink === 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 (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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -3474,19 +3697,30 @@ function _listSiteDiagnosticCategoriesSlotNext(nextPageLink, options, callback) } // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } + 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(apiVersion)); + if (queryParameters.length > 0) { + requestUrl += '?' + queryParameters.join('&'); + } + + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { httpRequest.headers['accept-language'] = this.client.acceptLanguage; } @@ -3539,7 +3773,7 @@ function _listSiteDiagnosticCategoriesSlotNext(nextPageLink, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticCategoryCollection']().mapper(); + let resultMapper = new client.models['DiagnosticDetectorCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3555,15 +3789,29 @@ function _listSiteDiagnosticCategoriesSlotNext(nextPageLink, options, callback) } /** - * @summary Get Site Analyses + * @summary Execute Detector * - * Get Site Analyses + * Execute Detector * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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 * @@ -3574,14 +3822,14 @@ function _listSiteDiagnosticCategoriesSlotNext(nextPageLink, 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 DiagnosticAnalysisCollection} for more + * 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 _listSiteAnalysesSlotNext(nextPageLink, options, callback) { +function _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, diagnosticCategory, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3591,10 +3839,60 @@ function _listSiteAnalysesSlotNext(nextPageLink, options, callback) { 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 apiVersion = '2016-03-01'; // Validate try { - if (nextPageLink === 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 (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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -3604,12 +3902,32 @@ function _listSiteAnalysesSlotNext(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.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(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 @@ -3669,7 +3987,7 @@ function _listSiteAnalysesSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticAnalysisCollection']().mapper(); + let resultMapper = new client.models['DiagnosticDetectorResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3685,9 +4003,9 @@ function _listSiteAnalysesSlotNext(nextPageLink, options, callback) { } /** - * @summary Get Detectors + * @summary List Hosting Environment Detector Responses * - * Get Detectors + * List Hosting Environment Detector Responses * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -3704,14 +4022,14 @@ function _listSiteAnalysesSlotNext(nextPageLink, 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 DiagnosticDetectorCollection} for more + * 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 _listSiteDetectorsSlotNext(nextPageLink, options, callback) { +function _listHostingEnvironmentDetectorResponsesNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3799,7 +4117,7 @@ function _listSiteDetectorsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticDetectorCollection']().mapper(); + let resultMapper = new client.models['DetectorResponseCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3815,9 +4133,9 @@ function _listSiteDetectorsSlotNext(nextPageLink, options, callback) { } /** - * @summary Get Detector + * @summary List Site Detector Responses * - * Get Detector + * List Site Detector Responses * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -3834,14 +4152,14 @@ function _listSiteDetectorsSlotNext(nextPageLink, 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 DiagnosticDetectorCollection} for more + * 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 _getSiteDetectorSlotNext(nextPageLink, options, callback) { +function _listSiteDetectorResponsesNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3929,7 +4247,7 @@ function _getSiteDetectorSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticDetectorCollection']().mapper(); + let resultMapper = new client.models['DetectorResponseCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3944,38 +4262,1619 @@ function _getSiteDetectorSlotNext(nextPageLink, options, callback) { }); } -/** Class representing a Diagnostics. */ -class Diagnostics { - /** - * Create a Diagnostics. - * @param {WebSiteManagementClient} client Reference to the service client. +/** + * @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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['CloudError']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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. */ - constructor(client) { - this.client = client; - 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._listSiteDiagnosticCategoriesSlot = _listSiteDiagnosticCategoriesSlot; - this._getSiteDiagnosticCategorySlot = _getSiteDiagnosticCategorySlot; - this._listSiteAnalysesSlot = _listSiteAnalysesSlot; - this._getSiteAnalysisSlot = _getSiteAnalysisSlot; - this._executeSiteAnalysisSlot = _executeSiteAnalysisSlot; - this._listSiteDetectorsSlot = _listSiteDetectorsSlot; - this._getSiteDetectorSlot = _getSiteDetectorSlot; - this._executeSiteDetectorSlot = _executeSiteDetectorSlot; - this._listSiteDiagnosticCategoriesNext = _listSiteDiagnosticCategoriesNext; - this._listSiteAnalysesNext = _listSiteAnalysesNext; - this._listSiteDetectorsNext = _listSiteDetectorsNext; - this._getSiteDetectorNext = _getSiteDetectorNext; - this._listSiteDiagnosticCategoriesSlotNext = _listSiteDiagnosticCategoriesSlotNext; - this._listSiteAnalysesSlotNext = _listSiteAnalysesSlotNext; - this._listSiteDetectorsSlotNext = _listSiteDetectorsSlotNext; - this._getSiteDetectorSlotNext = _getSiteDetectorSlotNext; + 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); + } } /** @@ -4624,7 +6523,217 @@ class Diagnostics { * * @param {string} diagnosticCategory Diagnostic Category * - * @param {string} detectorName Detector Name + * @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. * @@ -4638,7 +6747,7 @@ class Diagnostics { * * {Promise} A promise is returned * - * @resolve {DiagnosticDetectorCollection} - The deserialized result object. + * @resolve {DetectorResponseCollection} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4647,14 +6756,14 @@ class Diagnostics { * {Error} 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 + * 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. */ - getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detectorName, options, optionalCallback) { + listSiteDetectorResponsesSlot(resourceGroupName, siteName, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4663,21 +6772,21 @@ class Diagnostics { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detectorName, options, (err, result, request, response) => { + self._listSiteDetectorResponsesSlot(resourceGroupName, siteName, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detectorName, options, optionalCallback); + return self._listSiteDetectorResponsesSlot(resourceGroupName, siteName, slot, options, optionalCallback); } } /** - * @summary Execute Detector + * @summary Get site detector response * - * Execute Detector + * Get site detector response * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -4686,7 +6795,7 @@ class Diagnostics { * * @param {string} detectorName Detector Resource Name * - * @param {string} diagnosticCategory Category Name + * @param {string} slot Slot Name * * @param {object} [options] Optional Parameters. * @@ -4701,15 +6810,15 @@ class Diagnostics { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - executeSiteDetectorWithHttpOperationResponse(resourceGroupName, siteName, detectorName, diagnosticCategory, options) { + getSiteDetectorResponseSlotWithHttpOperationResponse(resourceGroupName, siteName, detectorName, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._executeSiteDetector(resourceGroupName, siteName, detectorName, diagnosticCategory, options, (err, result, request, response) => { + 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); } @@ -4720,9 +6829,9 @@ class Diagnostics { } /** - * @summary Execute Detector + * @summary Get site detector response * - * Execute Detector + * Get site detector response * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -4731,7 +6840,7 @@ class Diagnostics { * * @param {string} detectorName Detector Resource Name * - * @param {string} diagnosticCategory Category Name + * @param {string} slot Slot Name * * @param {object} [options] Optional Parameters. * @@ -4751,7 +6860,7 @@ class Diagnostics { * * {Promise} A promise is returned * - * @resolve {DiagnosticDetectorResponse} - The deserialized result object. + * @resolve {DetectorResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4760,14 +6869,13 @@ class Diagnostics { * {Error} 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. + * 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. */ - executeSiteDetector(resourceGroupName, siteName, detectorName, diagnosticCategory, options, optionalCallback) { + getSiteDetectorResponseSlot(resourceGroupName, siteName, detectorName, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4776,14 +6884,14 @@ class Diagnostics { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._executeSiteDetector(resourceGroupName, siteName, detectorName, diagnosticCategory, options, (err, result, request, response) => { + self._getSiteDetectorResponseSlot(resourceGroupName, siteName, detectorName, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._executeSiteDetector(resourceGroupName, siteName, detectorName, diagnosticCategory, options, optionalCallback); + return self._getSiteDetectorResponseSlot(resourceGroupName, siteName, detectorName, slot, options, optionalCallback); } } @@ -5628,6 +7736,184 @@ class Diagnostics { } } + /** + * @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 * @@ -5984,6 +8270,95 @@ class Diagnostics { } } + /** + * @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 * diff --git a/lib/services/websiteManagement2/lib/operations/index.d.ts b/lib/services/websiteManagement2/lib/operations/index.d.ts index f99d619675..6a0a06d829 100644 --- a/lib/services/websiteManagement2/lib/operations/index.d.ts +++ b/lib/services/websiteManagement2/lib/operations/index.d.ts @@ -5180,6 +5180,300 @@ export interface DeletedWebApps { 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 * @@ -5494,25 +5788,168 @@ export interface Diagnostics { /** * @summary Execute Analysis * - * 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 Category Name + * @param {string} diagnosticCategory Diagnostic Category * - * @param {string} analysisName Analysis Resource Name + * @param {string} detectorName Detector 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 * @@ -5523,7 +5960,7 @@ export interface Diagnostics { * * {Promise} A promise is returned. * - * @resolve {DiagnosticAnalysis} - The deserialized result object. + * @resolve {DiagnosticDetectorCollection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5531,57 +5968,74 @@ export interface Diagnostics { * * {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. + * {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. */ - 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; + 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 Get Detectors + * @summary Execute Detector * - * Get Detectors + * Execute 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 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. + * @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>; + executeSiteDetectorWithHttpOperationResponse(resourceGroupName: string, siteName: string, detectorName: string, diagnosticCategory: string, options?: { startTime? : Date, endTime? : Date, timeGrain? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Get Detectors + * @summary Execute Detector * - * Get Detectors + * Execute 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 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 * @@ -5592,7 +6046,7 @@ export interface Diagnostics { * * {Promise} A promise is returned. * - * @resolve {DiagnosticDetectorCollection} - The deserialized result object. + * @resolve {DiagnosticDetectorResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5600,32 +6054,30 @@ export interface Diagnostics { * * {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 + * {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. */ - 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; + 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 Get Detector + * @summary List Site Detector Responses * - * Get Detector + * List Site Detector Responses * * @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. * @@ -5634,25 +6086,23 @@ export interface Diagnostics { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @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>; + listSiteDetectorResponsesSlotWithHttpOperationResponse(resourceGroupName: string, siteName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Get Detector + * @summary List Site Detector Responses * - * Get Detector + * List Site Detector Responses * * @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. * @@ -5666,7 +6116,7 @@ export interface Diagnostics { * * {Promise} A promise is returned. * - * @resolve {DiagnosticDetectorCollection} - The deserialized result object. + * @resolve {DetectorResponseCollection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5674,23 +6124,23 @@ export interface Diagnostics { * * {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 + * {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. */ - 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; + 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 Execute Detector + * @summary Get site detector response * - * Execute Detector + * Get site detector response * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -5699,7 +6149,7 @@ export interface Diagnostics { * * @param {string} detectorName Detector Resource Name * - * @param {string} diagnosticCategory Category Name + * @param {string} slot Slot Name * * @param {object} [options] Optional Parameters. * @@ -5714,16 +6164,16 @@ export interface Diagnostics { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @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>; + getSiteDetectorResponseSlotWithHttpOperationResponse(resourceGroupName: string, siteName: string, detectorName: string, slot: string, options?: { startTime? : Date, endTime? : Date, timeGrain? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Execute Detector + * @summary Get site detector response * - * Execute Detector + * Get site detector response * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -5732,7 +6182,7 @@ export interface Diagnostics { * * @param {string} detectorName Detector Resource Name * - * @param {string} diagnosticCategory Category Name + * @param {string} slot Slot Name * * @param {object} [options] Optional Parameters. * @@ -5752,7 +6202,7 @@ export interface Diagnostics { * * {Promise} A promise is returned. * - * @resolve {DiagnosticDetectorResponse} - The deserialized result object. + * @resolve {DetectorResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -5760,17 +6210,16 @@ export interface Diagnostics { * * {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. + * {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. */ - 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; + 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; /** @@ -6398,6 +6847,130 @@ export interface Diagnostics { 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 * @@ -6646,6 +7219,68 @@ export interface Diagnostics { 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 * From e23f7c97990bb413295adf1508251dcdc0fae49d Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Tue, 1 May 2018 16:13:29 -0700 Subject: [PATCH 4/9] Generated from 78c1d019bfd4816ca21ad4f3cbebe6b9aed3175d (#2766) Fix for https://github.com/Azure/azure-rest-api-specs/issues/2907 --- .../lib/operations/webApps.js | 55 ++++++++++++++++++- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/lib/services/websiteManagement2/lib/operations/webApps.js b/lib/services/websiteManagement2/lib/operations/webApps.js index 2770531df4..b3925de60d 100644 --- a/lib/services/websiteManagement2/lib/operations/webApps.js +++ b/lib/services/websiteManagement2/lib/operations/webApps.js @@ -46100,7 +46100,7 @@ function _getSourceControlSlot(resourceGroupName, name, slot, options, callback) return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -46145,6 +46145,40 @@ function _getSourceControlSlot(resourceGroupName, name, slot, options, callback) 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); }); @@ -59545,7 +59579,7 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -59607,6 +59641,23 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour 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); }); From 10b370e48625b0ab381195545347b096515fda12 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Fri, 4 May 2018 11:17:01 -0700 Subject: [PATCH 5/9] Generated from 803aa2f0154403f9b82544013d0f108a5f0781d2 (#2839) https://github.com/Azure/azure-rest-api-specs/issues/2907 --- .../lib/operations/webApps.js | 55 ++++++++++++++++++- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/lib/services/websiteManagement2/lib/operations/webApps.js b/lib/services/websiteManagement2/lib/operations/webApps.js index b3925de60d..87b187db29 100644 --- a/lib/services/websiteManagement2/lib/operations/webApps.js +++ b/lib/services/websiteManagement2/lib/operations/webApps.js @@ -50853,7 +50853,7 @@ function _getSourceControl(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -50898,6 +50898,40 @@ function _getSourceControl(resourceGroupName, name, options, callback) { 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); }); @@ -59980,7 +60014,7 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -60042,6 +60076,23 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo 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); }); From 6c9840e33edb628fbef2c3fdc943f5b799dc76e7 Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Thu, 17 May 2018 13:42:01 -0700 Subject: [PATCH 6/9] Generated from 730ab2b6121f9802b7eabd6b549d80d446e63d71 (#2873) Update CommonDefinitions.json added ftpsState enum to SiteConfig object --- lib/services/websiteManagement2/package.json | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/services/websiteManagement2/package.json b/lib/services/websiteManagement2/package.json index 423c98b02d..3f43208d97 100644 --- a/lib/services/websiteManagement2/package.json +++ b/lib/services/websiteManagement2/package.json @@ -4,10 +4,13 @@ "description": "WebSiteManagementClient Library with typescript type definitions for node", "version": "3.0.0-preview", "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/webSiteManagementClient.js", "types": "./lib/webSiteManagementClient.d.ts", From c79062b2045509afdd1deed5d1b920b670f5366c Mon Sep 17 00:00:00 2001 From: Azure SDK for Python bot Date: Wed, 18 Jul 2018 12:15:04 -0700 Subject: [PATCH 7/9] Generated from 0ba75505cddaddce442eb2172170ccd408e6cfd5 (#3172) Update default package version for WebSiteManagementClient --- .../lib/models/appServiceEnvironment.js | 27 + .../appServiceEnvironmentPatchResource.js | 27 + .../models/appServiceEnvironmentResource.js | 27 + .../lib/models/appServicePlan.js | 27 +- .../lib/models/appServicePlanCollection.js | 1 + .../lib/models/appServicePlanPatchResource.js | 28 +- .../lib/models/backupRequest.js | 18 - .../lib/models/billingMeter.js | 10 +- .../lib/models/certificate.js | 9 - .../lib/models/certificateOrderAction.js | 10 +- .../lib/models/certificatePatchResource.js | 9 - .../lib/models/cloningInfo.js | 9 - .../lib/models/continuousWebJob.js | 26 +- .../lib/models/continuousWebJobCollection.js | 1 + .../lib/models/csmOperationDescription.js | 1 + .../csmOperationDescriptionProperties.js | 1 + .../lib/models/deletedAppRestoreRequest.js | 108 + .../lib/models/deletedSite.js | 13 +- .../lib/models/deployment.js | 14 +- .../lib/models/diagnosticData.js | 5 +- .../lib/models/functionEnvelope.js | 22 +- .../lib/models/functionSecrets.js | 2 +- .../lib/models/geoRegion.js | 9 - .../websiteManagement2/lib/models/index.d.ts | 922 +- .../websiteManagement2/lib/models/index.js | 29 +- .../lib/models/ipSecurityRestriction.js | 46 + .../lib/models/logSpecification.js | 68 + .../lib/models/managedServiceIdentity.js | 18 +- .../lib/models/metricDefinition.js | 9 - .../lib/models/perfMonSample.js | 8 - .../lib/models/premierAddOn.js | 31 - .../lib/models/premierAddOnOffer.js | 8 - .../lib/models/premierAddOnPatchResource.js | 120 + .../lib/models/privateAccess.js | 104 + .../lib/models/privateAccessSubnet.js | 61 + .../lib/models/privateAccessVirtualNetwork.js | 88 + .../lib/models/processInfo.js | 125 +- .../lib/models/processModuleInfo.js | 16 +- .../lib/models/processThreadInfo.js | 25 +- .../lib/models/recommendation.js | 34 +- .../lib/models/recommendationRule.js | 14 +- .../lib/models/rendering.js | 6 +- .../lib/models/resourceMetricDefinition.js | 22 - .../lib/models/restoreRequest.js | 5 +- .../lib/models/serviceSpecification.js | 16 + .../websiteManagement2/lib/models/site.js | 57 +- .../lib/models/siteAuthSettings.js | 9 + .../lib/models/siteConfig.js | 47 + .../lib/models/siteConfigResource.js | 47 + .../models/siteConfigurationSnapshotInfo.js | 6 +- .../lib/models/siteExtensionInfo.js | 43 +- .../lib/models/siteInstance.js | 2 +- .../lib/models/sitePatchResource.js | 53 +- .../lib/models/slotDifference.js | 8 +- .../lib/models/snapshotRecoverySource.js | 65 + .../lib/models/snapshotRestoreRequest.js | 134 + .../lib/models/sourceControl.js | 8 - .../lib/models/stampCapacity.js | 12 +- .../lib/models/swiftVirtualNetwork.js | 99 + .../lib/models/topLevelDomain.js | 9 - .../lib/models/triggeredJobHistory.js | 6 +- .../lib/models/triggeredJobRun.js | 23 +- .../lib/models/triggeredWebJob.js | 32 +- .../websiteManagement2/lib/models/usage.js | 9 - .../websiteManagement2/lib/models/user.js | 16 +- .../lib/models/validateRequest.js | 9 + .../lib/models/vnetRoute.js | 9 - .../websiteManagement2/lib/models/webJob.js | 22 +- .../operations/appServiceCertificateOrders.js | 255 +- .../lib/operations/appServiceEnvironments.js | 1833 +- .../lib/operations/appServicePlans.js | 516 +- .../certificateRegistrationProvider.js | 24 +- .../lib/operations/certificates.js | 99 +- .../lib/operations/deletedWebApps.js | 24 +- .../lib/operations/diagnostics.js | 429 +- .../operations/domainRegistrationProvider.js | 24 +- .../lib/operations/domains.js | 245 +- .../lib/operations/index.d.ts | 7794 ++-- .../lib/operations/index.js | 2 - .../lib/operations/provider.js | 72 +- .../lib/operations/recommendations.js | 136 +- .../lib/operations/topLevelDomains.js | 63 +- .../lib/operations/webApps.js | 36249 +++++++++------- .../lib/webSiteManagementClient.d.ts | 168 +- .../lib/webSiteManagementClient.js | 769 +- 85 files changed, 31643 insertions(+), 19963 deletions(-) create mode 100644 lib/services/websiteManagement2/lib/models/deletedAppRestoreRequest.js create mode 100644 lib/services/websiteManagement2/lib/models/logSpecification.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/snapshotRecoverySource.js create mode 100644 lib/services/websiteManagement2/lib/models/snapshotRestoreRequest.js create mode 100644 lib/services/websiteManagement2/lib/models/swiftVirtualNetwork.js diff --git a/lib/services/websiteManagement2/lib/models/appServiceEnvironment.js b/lib/services/websiteManagement2/lib/models/appServiceEnvironment.js index af47066e3f..f700716e96 100644 --- a/lib/services/websiteManagement2/lib/models/appServiceEnvironment.js +++ b/lib/services/websiteManagement2/lib/models/appServiceEnvironment.js @@ -97,6 +97,12 @@ class AppServiceEnvironment { * 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() { } @@ -434,6 +440,27 @@ class AppServiceEnvironment { } } } + }, + hasLinuxWorkers: { + required: false, + serializedName: 'hasLinuxWorkers', + type: { + name: 'Boolean' + } + }, + sslCertKeyVaultId: { + required: false, + serializedName: 'sslCertKeyVaultId', + type: { + name: 'String' + } + }, + sslCertKeyVaultSecretName: { + required: false, + serializedName: 'sslCertKeyVaultSecretName', + type: { + name: 'String' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/appServiceEnvironmentPatchResource.js b/lib/services/websiteManagement2/lib/models/appServiceEnvironmentPatchResource.js index 990549c0b2..ab454a36fc 100644 --- a/lib/services/websiteManagement2/lib/models/appServiceEnvironmentPatchResource.js +++ b/lib/services/websiteManagement2/lib/models/appServiceEnvironmentPatchResource.js @@ -99,6 +99,12 @@ class AppServiceEnvironmentPatchResource extends models['ProxyOnlyResource'] { * 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(); @@ -468,6 +474,27 @@ class AppServiceEnvironmentPatchResource extends models['ProxyOnlyResource'] { } } } + }, + 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' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/appServiceEnvironmentResource.js b/lib/services/websiteManagement2/lib/models/appServiceEnvironmentResource.js index 458a7a0309..462a7c2f8b 100644 --- a/lib/services/websiteManagement2/lib/models/appServiceEnvironmentResource.js +++ b/lib/services/websiteManagement2/lib/models/appServiceEnvironmentResource.js @@ -99,6 +99,12 @@ class AppServiceEnvironmentResource extends models['Resource'] { * 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(); @@ -489,6 +495,27 @@ class AppServiceEnvironmentResource extends models['Resource'] { } } } + }, + 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' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/appServicePlan.js b/lib/services/websiteManagement2/lib/models/appServicePlan.js index b8ecc0f0b9..79f4b30d7d 100644 --- a/lib/services/websiteManagement2/lib/models/appServicePlan.js +++ b/lib/services/websiteManagement2/lib/models/appServicePlan.js @@ -20,7 +20,6 @@ const models = require('./index'); class AppServicePlan extends models['Resource'] { /** * Create a AppServicePlan. - * @member {string} appServicePlanName Name for the App Service plan. * @member {string} [workerTierName] Target worker tier assigned to the App * Service plan. * @member {string} [status] App Service plan status. Possible values @@ -49,9 +48,13 @@ class AppServicePlan extends models['Resource'] { * 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] 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 @@ -148,13 +151,6 @@ class AppServicePlan extends models['Resource'] { } } }, - appServicePlanName: { - required: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, workerTierName: { required: false, serializedName: 'properties.workerTierName', @@ -240,6 +236,13 @@ class AppServicePlan extends models['Resource'] { name: 'DateTime' } }, + freeOfferExpirationTime: { + required: false, + serializedName: 'properties.freeOfferExpirationTime', + type: { + name: 'DateTime' + } + }, resourceGroup: { required: false, readOnly: true, @@ -256,6 +259,14 @@ class AppServicePlan extends models['Resource'] { name: 'Boolean' } }, + isXenon: { + required: false, + serializedName: 'properties.isXenon', + defaultValue: false, + type: { + name: 'Boolean' + } + }, targetWorkerCount: { required: false, serializedName: 'properties.targetWorkerCount', diff --git a/lib/services/websiteManagement2/lib/models/appServicePlanCollection.js b/lib/services/websiteManagement2/lib/models/appServicePlanCollection.js index 620bda3ea5..74827eafd6 100644 --- a/lib/services/websiteManagement2/lib/models/appServicePlanCollection.js +++ b/lib/services/websiteManagement2/lib/models/appServicePlanCollection.js @@ -53,6 +53,7 @@ class AppServicePlanCollection extends Array { }, nextLink: { required: false, + readOnly: true, serializedName: 'nextLink', type: { name: 'String' diff --git a/lib/services/websiteManagement2/lib/models/appServicePlanPatchResource.js b/lib/services/websiteManagement2/lib/models/appServicePlanPatchResource.js index e08905aeec..bbeaed4a8f 100644 --- a/lib/services/websiteManagement2/lib/models/appServicePlanPatchResource.js +++ b/lib/services/websiteManagement2/lib/models/appServicePlanPatchResource.js @@ -20,8 +20,6 @@ const models = require('./index'); class AppServicePlanPatchResource extends models['ProxyOnlyResource'] { /** * Create a AppServicePlanPatchResource. - * @member {string} appServicePlanPatchResourceName Name for the App Service - * plan. * @member {string} [workerTierName] Target worker tier assigned to the App * Service plan. * @member {string} [status] App Service plan status. Possible values @@ -50,9 +48,13 @@ class AppServicePlanPatchResource extends models['ProxyOnlyResource'] { * 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] 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 @@ -108,13 +110,6 @@ class AppServicePlanPatchResource extends models['ProxyOnlyResource'] { name: 'String' } }, - appServicePlanPatchResourceName: { - required: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, workerTierName: { required: false, serializedName: 'properties.workerTierName', @@ -200,6 +195,13 @@ class AppServicePlanPatchResource extends models['ProxyOnlyResource'] { name: 'DateTime' } }, + freeOfferExpirationTime: { + required: false, + serializedName: 'properties.freeOfferExpirationTime', + type: { + name: 'DateTime' + } + }, resourceGroup: { required: false, readOnly: true, @@ -216,6 +218,14 @@ class AppServicePlanPatchResource extends models['ProxyOnlyResource'] { name: 'Boolean' } }, + isXenon: { + required: false, + serializedName: 'properties.isXenon', + defaultValue: false, + type: { + name: 'Boolean' + } + }, targetWorkerCount: { required: false, serializedName: 'properties.targetWorkerCount', diff --git a/lib/services/websiteManagement2/lib/models/backupRequest.js b/lib/services/websiteManagement2/lib/models/backupRequest.js index dba65bf110..c7b5da3f97 100644 --- a/lib/services/websiteManagement2/lib/models/backupRequest.js +++ b/lib/services/websiteManagement2/lib/models/backupRequest.js @@ -20,7 +20,6 @@ const models = require('./index'); class BackupRequest extends models['ProxyOnlyResource'] { /** * Create a BackupRequest. - * @member {string} backupRequestName 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. @@ -44,8 +43,6 @@ class BackupRequest extends models['ProxyOnlyResource'] { * @member {date} [backupSchedule.lastExecutionTime] Last time when this * schedule was triggered. * @member {array} [databases] Databases included in the backup. - * @member {string} [backupRequestType] Type of the backup. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' */ constructor() { super(); @@ -96,13 +93,6 @@ class BackupRequest extends models['ProxyOnlyResource'] { name: 'String' } }, - backupRequestName: { - required: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, enabled: { required: false, serializedName: 'properties.enabled', @@ -139,14 +129,6 @@ class BackupRequest extends models['ProxyOnlyResource'] { } } } - }, - backupRequestType: { - required: false, - serializedName: 'properties.type', - type: { - name: 'Enum', - allowedValues: [ 'Default', 'Clone', 'Relocation', 'Snapshot' ] - } } } } diff --git a/lib/services/websiteManagement2/lib/models/billingMeter.js b/lib/services/websiteManagement2/lib/models/billingMeter.js index 14229378b7..aba6effb23 100644 --- a/lib/services/websiteManagement2/lib/models/billingMeter.js +++ b/lib/services/websiteManagement2/lib/models/billingMeter.js @@ -26,7 +26,8 @@ class BillingMeter extends models['ProxyOnlyResource'] { * @member {string} [shortName] Short Name from App Service Azure pricing * Page * @member {string} [friendlyName] Friendly name of the meter - * @member {string} [resourceType] App Service resource type meter used for + * @member {string} [resourceType] App Service ResourceType meter used for + * @member {string} [osType] App Service OS type meter used for */ constructor() { super(); @@ -111,6 +112,13 @@ class BillingMeter extends models['ProxyOnlyResource'] { type: { name: 'String' } + }, + osType: { + required: false, + serializedName: 'properties.osType', + type: { + name: 'String' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/certificate.js b/lib/services/websiteManagement2/lib/models/certificate.js index 200bd1eaf4..f7b9f4da55 100644 --- a/lib/services/websiteManagement2/lib/models/certificate.js +++ b/lib/services/websiteManagement2/lib/models/certificate.js @@ -50,7 +50,6 @@ class Certificate extends models['Resource'] { * 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', * 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', * 'Unknown' - * @member {string} [geoRegion] Region of the certificate. * @member {string} [serverFarmId] Resource ID of the associated App Service * plan, formatted as: * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". @@ -273,14 +272,6 @@ class Certificate extends models['Resource'] { allowedValues: [ 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', 'Unknown' ] } }, - geoRegion: { - required: false, - readOnly: true, - serializedName: 'properties.geoRegion', - type: { - name: 'String' - } - }, serverFarmId: { required: false, serializedName: 'properties.serverFarmId', diff --git a/lib/services/websiteManagement2/lib/models/certificateOrderAction.js b/lib/services/websiteManagement2/lib/models/certificateOrderAction.js index fc3635e0c7..123fb2ad46 100644 --- a/lib/services/websiteManagement2/lib/models/certificateOrderAction.js +++ b/lib/services/websiteManagement2/lib/models/certificateOrderAction.js @@ -20,8 +20,8 @@ const models = require('./index'); class CertificateOrderAction extends models['ProxyOnlyResource'] { /** * Create a CertificateOrderAction. - * @member {string} [certificateOrderActionType] Action type. Possible values - * include: 'CertificateIssued', 'CertificateOrderCanceled', + * @member {string} [actionType] Action type. Possible values include: + * 'CertificateIssued', 'CertificateOrderCanceled', * 'CertificateOrderCreated', 'CertificateRevoked', * 'DomainValidationComplete', 'FraudDetected', 'OrgNameChange', * 'OrgValidationComplete', 'SanDrop', 'FraudCleared', 'CertificateExpired', @@ -78,9 +78,10 @@ class CertificateOrderAction extends models['ProxyOnlyResource'] { name: 'String' } }, - certificateOrderActionType: { + actionType: { required: false, - serializedName: 'properties.type', + readOnly: true, + serializedName: 'properties.actionType', type: { name: 'Enum', allowedValues: [ 'CertificateIssued', 'CertificateOrderCanceled', 'CertificateOrderCreated', 'CertificateRevoked', 'DomainValidationComplete', 'FraudDetected', 'OrgNameChange', 'OrgValidationComplete', 'SanDrop', 'FraudCleared', 'CertificateExpired', 'CertificateExpirationWarning', 'FraudDocumentationRequired', 'Unknown' ] @@ -88,6 +89,7 @@ class CertificateOrderAction extends models['ProxyOnlyResource'] { }, createdAt: { required: false, + readOnly: true, serializedName: 'properties.createdAt', type: { name: 'DateTime' diff --git a/lib/services/websiteManagement2/lib/models/certificatePatchResource.js b/lib/services/websiteManagement2/lib/models/certificatePatchResource.js index e68d49ee1a..708ccf5cf0 100644 --- a/lib/services/websiteManagement2/lib/models/certificatePatchResource.js +++ b/lib/services/websiteManagement2/lib/models/certificatePatchResource.js @@ -50,7 +50,6 @@ class CertificatePatchResource extends models['ProxyOnlyResource'] { * 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', * 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', * 'Unknown' - * @member {string} [geoRegion] Region of the certificate. * @member {string} [serverFarmId] Resource ID of the associated App Service * plan, formatted as: * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". @@ -252,14 +251,6 @@ class CertificatePatchResource extends models['ProxyOnlyResource'] { allowedValues: [ 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', 'Unknown' ] } }, - geoRegion: { - required: false, - readOnly: true, - serializedName: 'properties.geoRegion', - type: { - name: 'String' - } - }, serverFarmId: { required: false, serializedName: 'properties.serverFarmId', diff --git a/lib/services/websiteManagement2/lib/models/cloningInfo.js b/lib/services/websiteManagement2/lib/models/cloningInfo.js index 868a356c16..971b705122 100644 --- a/lib/services/websiteManagement2/lib/models/cloningInfo.js +++ b/lib/services/websiteManagement2/lib/models/cloningInfo.js @@ -46,8 +46,6 @@ class CloningInfo { * @member {string} [trafficManagerProfileName] Name of Traffic Manager * profile to create. This is only needed if Traffic Manager profile does not * already exist. - * @member {boolean} [ignoreQuotas] true if quotas should be - * ignored; otherwise, false. */ constructor() { } @@ -142,13 +140,6 @@ class CloningInfo { type: { name: 'String' } - }, - ignoreQuotas: { - required: false, - serializedName: 'ignoreQuotas', - type: { - name: 'Boolean' - } } } } diff --git a/lib/services/websiteManagement2/lib/models/continuousWebJob.js b/lib/services/websiteManagement2/lib/models/continuousWebJob.js index ffba08bca7..7ae4000f49 100644 --- a/lib/services/websiteManagement2/lib/models/continuousWebJob.js +++ b/lib/services/websiteManagement2/lib/models/continuousWebJob.js @@ -24,12 +24,10 @@ class ContinuousWebJob extends models['ProxyOnlyResource'] { * 'Initializing', 'Starting', 'Running', 'PendingRestart', 'Stopped' * @member {string} [detailedStatus] Detailed status. * @member {string} [logUrl] Log URL. - * @member {string} [continuousWebJobName] Job name. Used as job identifier - * in ARM resource URI. * @member {string} [runCommand] Run command. * @member {string} [url] Job URL. * @member {string} [extraInfoUrl] Extra Info URL. - * @member {string} [jobType] Job type. Possible values include: + * @member {string} [webJobType] Job type. Possible values include: * 'Continuous', 'Triggered' * @member {string} [error] Error information. * @member {boolean} [usingSdk] Using SDK? @@ -94,29 +92,21 @@ class ContinuousWebJob extends models['ProxyOnlyResource'] { }, detailedStatus: { required: false, - serializedName: 'properties.detailedStatus', + serializedName: 'properties.detailed_status', type: { name: 'String' } }, logUrl: { required: false, - serializedName: 'properties.logUrl', - type: { - name: 'String' - } - }, - continuousWebJobName: { - required: false, - readOnly: true, - serializedName: 'properties.name', + serializedName: 'properties.log_url', type: { name: 'String' } }, runCommand: { required: false, - serializedName: 'properties.runCommand', + serializedName: 'properties.run_command', type: { name: 'String' } @@ -130,14 +120,14 @@ class ContinuousWebJob extends models['ProxyOnlyResource'] { }, extraInfoUrl: { required: false, - serializedName: 'properties.extraInfoUrl', + serializedName: 'properties.extra_info_url', type: { name: 'String' } }, - jobType: { + webJobType: { required: false, - serializedName: 'properties.jobType', + serializedName: 'properties.web_job_type', type: { name: 'Enum', allowedValues: [ 'Continuous', 'Triggered' ] @@ -152,7 +142,7 @@ class ContinuousWebJob extends models['ProxyOnlyResource'] { }, usingSdk: { required: false, - serializedName: 'properties.usingSdk', + serializedName: 'properties.using_sdk', type: { name: 'Boolean' } diff --git a/lib/services/websiteManagement2/lib/models/continuousWebJobCollection.js b/lib/services/websiteManagement2/lib/models/continuousWebJobCollection.js index 99a440181a..5d82a581b7 100644 --- a/lib/services/websiteManagement2/lib/models/continuousWebJobCollection.js +++ b/lib/services/websiteManagement2/lib/models/continuousWebJobCollection.js @@ -53,6 +53,7 @@ class ContinuousWebJobCollection extends Array { }, nextLink: { required: false, + readOnly: true, serializedName: 'nextLink', type: { name: 'String' diff --git a/lib/services/websiteManagement2/lib/models/csmOperationDescription.js b/lib/services/websiteManagement2/lib/models/csmOperationDescription.js index 9375a0b953..a1d904e61f 100644 --- a/lib/services/websiteManagement2/lib/models/csmOperationDescription.js +++ b/lib/services/websiteManagement2/lib/models/csmOperationDescription.js @@ -29,6 +29,7 @@ class CsmOperationDescription { * @member {object} [properties] * @member {object} [properties.serviceSpecification] * @member {array} [properties.serviceSpecification.metricSpecifications] + * @member {array} [properties.serviceSpecification.logSpecifications] */ constructor() { } diff --git a/lib/services/websiteManagement2/lib/models/csmOperationDescriptionProperties.js b/lib/services/websiteManagement2/lib/models/csmOperationDescriptionProperties.js index 77631076bc..bf869cb952 100644 --- a/lib/services/websiteManagement2/lib/models/csmOperationDescriptionProperties.js +++ b/lib/services/websiteManagement2/lib/models/csmOperationDescriptionProperties.js @@ -21,6 +21,7 @@ class CsmOperationDescriptionProperties { * Create a CsmOperationDescriptionProperties. * @member {object} [serviceSpecification] * @member {array} [serviceSpecification.metricSpecifications] + * @member {array} [serviceSpecification.logSpecifications] */ constructor() { } 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 index 265245476b..e076b9bc7a 100644 --- a/lib/services/websiteManagement2/lib/models/deletedSite.js +++ b/lib/services/websiteManagement2/lib/models/deletedSite.js @@ -17,12 +17,12 @@ class DeletedSite { /** * Create a DeletedSite. - * @member {number} [id] Numeric id for the deleted site + * @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} [name] Name of the deleted site + * @member {string} [deletedSiteName] Name of the deleted site * @member {string} [slot] Slot of the deleted site */ constructor() { @@ -42,9 +42,10 @@ class DeletedSite { name: 'Composite', className: 'DeletedSite', modelProperties: { - id: { + deletedSiteId: { required: false, - serializedName: 'id', + readOnly: true, + serializedName: 'deletedSiteId', type: { name: 'Number' } @@ -73,10 +74,10 @@ class DeletedSite { name: 'String' } }, - name: { + deletedSiteName: { required: false, readOnly: true, - serializedName: 'name', + serializedName: 'deletedSiteName', type: { name: 'String' } diff --git a/lib/services/websiteManagement2/lib/models/deployment.js b/lib/services/websiteManagement2/lib/models/deployment.js index 052aab349d..f8fdc08349 100644 --- a/lib/services/websiteManagement2/lib/models/deployment.js +++ b/lib/services/websiteManagement2/lib/models/deployment.js @@ -20,7 +20,6 @@ const models = require('./index'); class Deployment extends models['ProxyOnlyResource'] { /** * Create a Deployment. - * @member {string} [deploymentId] Identifier for deployment. * @member {number} [status] Deployment status. * @member {string} [message] Details about deployment status. * @member {string} [author] Who authored the deployment. @@ -81,13 +80,6 @@ class Deployment extends models['ProxyOnlyResource'] { name: 'String' } }, - deploymentId: { - required: false, - serializedName: 'properties.id', - type: { - name: 'String' - } - }, status: { required: false, serializedName: 'properties.status', @@ -118,21 +110,21 @@ class Deployment extends models['ProxyOnlyResource'] { }, authorEmail: { required: false, - serializedName: 'properties.authorEmail', + serializedName: 'properties.author_email', type: { name: 'String' } }, startTime: { required: false, - serializedName: 'properties.startTime', + serializedName: 'properties.start_time', type: { name: 'DateTime' } }, endTime: { required: false, - serializedName: 'properties.endTime', + serializedName: 'properties.end_time', type: { name: 'DateTime' } diff --git a/lib/services/websiteManagement2/lib/models/diagnosticData.js b/lib/services/websiteManagement2/lib/models/diagnosticData.js index e583cf9598..f3b0662a2e 100644 --- a/lib/services/websiteManagement2/lib/models/diagnosticData.js +++ b/lib/services/websiteManagement2/lib/models/diagnosticData.js @@ -25,9 +25,8 @@ class DiagnosticData { * @member {array} [table.rows] Raw row values * @member {object} [renderingProperties] Properties that describe how the * table should be rendered - * @member {string} [renderingProperties.renderingType] Rendering Type. - * Possible values include: 'NoGraph', 'Table', 'TimeSeries', - * 'TimeSeriesPerInstance' + * @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 diff --git a/lib/services/websiteManagement2/lib/models/functionEnvelope.js b/lib/services/websiteManagement2/lib/models/functionEnvelope.js index d7389e080d..de01948153 100644 --- a/lib/services/websiteManagement2/lib/models/functionEnvelope.js +++ b/lib/services/websiteManagement2/lib/models/functionEnvelope.js @@ -20,7 +20,6 @@ const models = require('./index'); class FunctionEnvelope extends models['ProxyOnlyResource'] { /** * Create a FunctionEnvelope. - * @member {string} [functionEnvelopeName] Function name. * @member {string} [functionAppId] Function App ID. * @member {string} [scriptRootPathHref] Script root path URI. * @member {string} [scriptHref] Script URI. @@ -81,46 +80,37 @@ class FunctionEnvelope extends models['ProxyOnlyResource'] { name: 'String' } }, - functionEnvelopeName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, functionAppId: { required: false, - readOnly: true, - serializedName: 'properties.functionAppId', + serializedName: 'properties.function_app_id', type: { name: 'String' } }, scriptRootPathHref: { required: false, - serializedName: 'properties.scriptRootPathHref', + serializedName: 'properties.script_root_path_href', type: { name: 'String' } }, scriptHref: { required: false, - serializedName: 'properties.scriptHref', + serializedName: 'properties.script_href', type: { name: 'String' } }, configHref: { required: false, - serializedName: 'properties.configHref', + serializedName: 'properties.config_href', type: { name: 'String' } }, secretsFileHref: { required: false, - serializedName: 'properties.secretsFileHref', + serializedName: 'properties.secrets_file_href', type: { name: 'String' } @@ -155,7 +145,7 @@ class FunctionEnvelope extends models['ProxyOnlyResource'] { }, testData: { required: false, - serializedName: 'properties.testData', + serializedName: 'properties.test_data', type: { name: 'String' } diff --git a/lib/services/websiteManagement2/lib/models/functionSecrets.js b/lib/services/websiteManagement2/lib/models/functionSecrets.js index 6c33bce188..89769cbd49 100644 --- a/lib/services/websiteManagement2/lib/models/functionSecrets.js +++ b/lib/services/websiteManagement2/lib/models/functionSecrets.js @@ -81,7 +81,7 @@ class FunctionSecrets extends models['ProxyOnlyResource'] { }, triggerUrl: { required: false, - serializedName: 'properties.triggerUrl', + serializedName: 'properties.trigger_url', type: { name: 'String' } diff --git a/lib/services/websiteManagement2/lib/models/geoRegion.js b/lib/services/websiteManagement2/lib/models/geoRegion.js index bf004ffc2e..6488f76da4 100644 --- a/lib/services/websiteManagement2/lib/models/geoRegion.js +++ b/lib/services/websiteManagement2/lib/models/geoRegion.js @@ -20,7 +20,6 @@ const models = require('./index'); class GeoRegion extends models['ProxyOnlyResource'] { /** * Create a GeoRegion. - * @member {string} [geoRegionName] Region name. * @member {string} [description] Region description. * @member {string} [displayName] Display name for region. */ @@ -73,14 +72,6 @@ class GeoRegion extends models['ProxyOnlyResource'] { name: 'String' } }, - geoRegionName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, description: { required: false, readOnly: true, diff --git a/lib/services/websiteManagement2/lib/models/index.d.ts b/lib/services/websiteManagement2/lib/models/index.d.ts index 1ad4b42f71..9687aabe5c 100644 --- a/lib/services/websiteManagement2/lib/models/index.d.ts +++ b/lib/services/websiteManagement2/lib/models/index.d.ts @@ -344,18 +344,18 @@ export interface CertificateEmail extends ProxyOnlyResource { * @constructor * Certificate order action. * - * @member {string} [certificateOrderActionType] Action type. Possible values - * include: 'CertificateIssued', 'CertificateOrderCanceled', - * 'CertificateOrderCreated', 'CertificateRevoked', 'DomainValidationComplete', - * 'FraudDetected', 'OrgNameChange', 'OrgValidationComplete', 'SanDrop', - * 'FraudCleared', 'CertificateExpired', 'CertificateExpirationWarning', + * @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 { - certificateOrderActionType?: string; - createdAt?: Date; + readonly actionType?: string; + readonly createdAt?: Date; } /** @@ -429,8 +429,6 @@ export interface SiteSealRequest { * Virtual Network route contract used to pass routing information for a * Virtual Network. * - * @member {string} [vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. * @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. @@ -446,7 +444,6 @@ export interface SiteSealRequest { * Virtual Network. Possible values include: 'DEFAULT', 'INHERITED', 'STATIC' */ export interface VnetRoute extends ProxyOnlyResource { - vnetRouteName?: string; startAddress?: string; endAddress?: string; routeType?: string; @@ -501,71 +498,31 @@ export interface VnetGateway extends ProxyOnlyResource { * @constructor * User crendentials used for publishing activity. * - * @member {string} [userName] Username * @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 { - userName?: string; publishingUserName: string; publishingPassword?: string; publishingPasswordHash?: string; publishingPasswordHashSalt?: string; + scmUri?: string; } /** * @class - * Initializes a new instance of the SnapshotRecoveryTarget class. - * @constructor - * Specifies the web app that snapshot contents will be written to. - * - * @member {string} [location] Geographical location of the target web app, - * e.g. SouthEastAsia, SouthCentralUS - * @member {string} [id] ARM resource ID of the target 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 SnapshotRecoveryTarget { - location?: string; - id?: string; -} - -/** - * @class - * Initializes a new instance of the SnapshotRecoveryRequest class. + * Initializes a new instance of the Snapshot class. * @constructor - * Details about app recovery operation. + * A snapshot of an app. * - * @member {string} [snapshotTime] Point in time in which the app recovery - * should be attempted, formatted as a DateTime string. - * @member {object} [recoveryTarget] Specifies the web app that snapshot - * contents will be written to. - * @member {string} [recoveryTarget.location] Geographical location of the - * target web app, e.g. SouthEastAsia, SouthCentralUS - * @member {string} [recoveryTarget.id] ARM resource ID of the target 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 recovery 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. + * @member {string} [time] The time the snapshot was taken. */ -export interface SnapshotRecoveryRequest extends ProxyOnlyResource { - snapshotTime?: string; - recoveryTarget?: SnapshotRecoveryTarget; - overwrite: boolean; - recoverConfiguration?: boolean; - ignoreConflictingHostNames?: boolean; +export interface Snapshot extends ProxyOnlyResource { + readonly time?: string; } /** @@ -582,45 +539,24 @@ export interface ResourceMetricAvailability { readonly retention?: 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 ResourceMetricDefinition class. * @constructor * Metadata for the metrics. * - * @member {object} [resourceMetricDefinitionName] Name of the metric. - * @member {string} [resourceMetricDefinitionName.value] metric name value. - * @member {string} [resourceMetricDefinitionName.localizedValue] Localized - * metric name value. * @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 {string} [resourceMetricDefinitionId] Resource ID. * @member {object} [properties] Resource metric definition properties. */ export interface ResourceMetricDefinition extends ProxyOnlyResource { - readonly resourceMetricDefinitionName?: ResourceMetricName; readonly unit?: string; readonly primaryAggregationType?: string; readonly metricAvailabilities?: ResourceMetricAvailability[]; readonly resourceUri?: string; - readonly resourceMetricDefinitionId?: string; readonly properties?: { [propertyName: string]: string }; } @@ -716,14 +652,17 @@ export interface HybridConnection extends ProxyOnlyResource { * Managed service identity. * * @member {string} [type] Type of managed service identity. Possible values - * include: 'SystemAssigned' + * 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[]; } /** @@ -780,8 +719,6 @@ export interface SlotSwapStatus { * @member {string} [trafficManagerProfileName] Name of Traffic Manager profile * to create. This is only needed if Traffic Manager profile does not already * exist. - * @member {boolean} [ignoreQuotas] true if quotas should be - * ignored; otherwise, false. */ export interface CloningInfo { correlationId?: string; @@ -794,7 +731,6 @@ export interface CloningInfo { configureLoadBalancing?: boolean; trafficManagerProfileId?: string; trafficManagerProfileName?: string; - ignoreQuotas?: boolean; } /** @@ -820,12 +756,27 @@ export interface HostingEnvironmentProfile { * 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; } /** @@ -1187,6 +1138,7 @@ export interface NameValuePair { * @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 @@ -1297,12 +1249,19 @@ export interface NameValuePair { * @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; @@ -1312,6 +1271,7 @@ export interface SiteConfig { pythonVersion?: string; nodeVersion?: string; linuxFxVersion?: string; + windowsFxVersion?: string; requestTracingEnabled?: boolean; requestTracingExpirationTime?: Date; remoteDebuggingEnabled?: boolean; @@ -1347,9 +1307,13 @@ export interface SiteConfig { apiDefinition?: ApiDefinitionInfo; autoSwapSlotName?: string; localMySqlEnabled?: boolean; + managedServiceIdentityId?: number; + xManagedServiceIdentityId?: number; ipSecurityRestrictions?: IpSecurityRestriction[]; http20Enabled?: boolean; minTlsVersion?: string; + ftpsState?: string; + reservedInstanceCount?: number; } /** @@ -1405,6 +1369,7 @@ export interface HostNameSslState { * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". * @member {boolean} [reserved] true if reserved; otherwise, * false. Default value: false . + * @member {boolean} [isXenon] 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. @@ -1415,6 +1380,8 @@ export interface HostNameSslState { * @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 @@ -1536,6 +1503,10 @@ export interface HostNameSslState { * @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 @@ -1543,6 +1514,11 @@ export interface HostNameSslState { * @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) @@ -1613,29 +1589,6 @@ export interface HostNameSslState { * @member {string} [cloningInfo.trafficManagerProfileName] Name of Traffic * Manager profile to create. This is only needed if Traffic Manager profile * does not already exist. - * @member {boolean} [cloningInfo.ignoreQuotas] true if quotas - * should be ignored; otherwise, false. - * @member {object} [snapshotInfo] If specified during app creation, the app is - * created from a previous snapshot. - * @member {string} [snapshotInfo.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * @member {object} [snapshotInfo.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * @member {string} [snapshotInfo.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * @member {string} [snapshotInfo.recoveryTarget.id] ARM resource ID of the - * target 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} [snapshotInfo.overwrite] If true the recovery - * operation can overwrite source app; otherwise, false. - * @member {boolean} [snapshotInfo.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * @member {boolean} [snapshotInfo.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. * @member {string} [resourceGroup] Name of the resource group the app belongs * to. Read-only. * @member {boolean} [isDefaultContainer] true if the app is a @@ -1654,10 +1607,12 @@ export interface HostNameSslState { * http requests * @member {object} [identity] * @member {string} [identity.type] Type of managed service identity. Possible - * values include: 'SystemAssigned' + * 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; @@ -1670,6 +1625,7 @@ export interface Site extends Resource { hostNameSslStates?: HostNameSslState[]; serverFarmId?: string; reserved?: boolean; + isXenon?: boolean; readonly lastModifiedTimeUtc?: Date; siteConfig?: SiteConfig; readonly trafficManagerHostNames?: string[]; @@ -1686,7 +1642,6 @@ export interface Site extends Resource { readonly suspendedTill?: Date; readonly maxNumberOfWorkers?: number; cloningInfo?: CloningInfo; - snapshotInfo?: SnapshotRecoveryRequest; readonly resourceGroup?: string; readonly isDefaultContainer?: boolean; readonly defaultHostName?: string; @@ -1776,7 +1731,6 @@ export interface SkuDescription { * @constructor * App Service plan. * - * @member {string} appServicePlanName Name for the 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: @@ -1804,9 +1758,13 @@ export interface SkuDescription { * 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] 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 @@ -1834,7 +1792,6 @@ export interface SkuDescription { * manager enabled? */ export interface AppServicePlan extends Resource { - appServicePlanName: string; workerTierName?: string; readonly status?: string; readonly subscription?: string; @@ -1846,14 +1803,78 @@ export interface AppServicePlan extends Resource { readonly numberOfSites?: number; isSpot?: boolean; spotExpirationTime?: Date; + freeOfferExpirationTime?: Date; readonly resourceGroup?: string; reserved?: boolean; + isXenon?: 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. @@ -1866,6 +1887,22 @@ 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. @@ -1947,9 +1984,11 @@ export interface MetricSpecification { * Resource metrics service provided by Microsoft.Insights resource provider. * * @member {array} [metricSpecifications] + * @member {array} [logSpecifications] */ export interface ServiceSpecification { metricSpecifications?: MetricSpecification[]; + logSpecifications?: LogSpecification[]; } /** @@ -1960,6 +1999,7 @@ export interface ServiceSpecification { * * @member {object} [serviceSpecification] * @member {array} [serviceSpecification.metricSpecifications] + * @member {array} [serviceSpecification.logSpecifications] */ export interface CsmOperationDescriptionProperties { serviceSpecification?: ServiceSpecification; @@ -1999,6 +2039,7 @@ export interface CsmOperationDisplay { * @member {object} [properties] * @member {object} [properties.serviceSpecification] * @member {array} [properties.serviceSpecification.metricSpecifications] + * @member {array} [properties.serviceSpecification.logSpecifications] */ export interface CsmOperationDescription { name?: string; @@ -2498,21 +2539,6 @@ export interface DomainRecommendationSearchParameters { maxDomainRecommendations?: number; } -/** - * @class - * Initializes a new instance of the ErrorResponse class. - * @constructor - * Error Response. - * - * @member {string} [code] Error code. - * @member {string} [message] Error message indicating why the operation - * failed. - */ -export interface ErrorResponse { - code?: string; - message?: string; -} - /** * @class * Initializes a new instance of the TldLegalAgreement class. @@ -2537,12 +2563,10 @@ export interface TldLegalAgreement { * @constructor * A top level domain object. * - * @member {string} [domainName] Name of the top level domain. * @member {boolean} [privacy] If true, then the top level domain * supports domain privacy; otherwise, false. */ export interface TopLevelDomain extends ProxyOnlyResource { - readonly domainName?: string; privacy?: boolean; } @@ -2600,7 +2624,6 @@ export interface TopLevelDomainAgreementOption { * 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', * 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', * 'Unknown' - * @member {string} [geoRegion] Region of the certificate. * @member {string} [serverFarmId] Resource ID of the associated App Service * plan, formatted as: * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". @@ -2624,7 +2647,6 @@ export interface Certificate extends Resource { keyVaultId?: string; keyVaultSecretName?: string; readonly keyVaultSecretStatus?: string; - readonly geoRegion?: string; serverFarmId?: string; } @@ -2664,7 +2686,6 @@ export interface Certificate extends Resource { * 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', * 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', * 'Unknown' - * @member {string} [geoRegion] Region of the certificate. * @member {string} [serverFarmId] Resource ID of the associated App Service * plan, formatted as: * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". @@ -2688,7 +2709,6 @@ export interface CertificatePatchResource extends ProxyOnlyResource { keyVaultId?: string; keyVaultSecretName?: string; readonly keyVaultSecretStatus?: string; - readonly geoRegion?: string; serverFarmId?: string; } @@ -2766,7 +2786,7 @@ export interface VirtualIPMapping { * @member {string} [computeMode] Shared/dedicated workers. Possible values * include: 'Shared', 'Dedicated', 'Dynamic' * @member {string} [workerSize] Size of the machines. Possible values include: - * 'Default', 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3' + * 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', 'Default' * @member {number} [workerSizeId] Size ID of machines: * 0 - Small * 1 - Medium @@ -2777,6 +2797,7 @@ export interface VirtualIPMapping { * @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; @@ -2789,6 +2810,7 @@ export interface StampCapacity { excludeFromCapacityAllocation?: boolean; isApplicableForAllComputeModes?: boolean; siteMode?: string; + isLinux?: boolean; } /** @@ -2893,6 +2915,12 @@ export interface NetworkAccessControlEntry { * 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; @@ -2931,6 +2959,9 @@ export interface AppServiceEnvironment { dynamicCacheEnabled?: boolean; clusterSettings?: NameValuePair[]; userWhitelistedIpRanges?: string[]; + hasLinuxWorkers?: boolean; + sslCertKeyVaultId?: string; + sslCertKeyVaultSecretName?: string; } /** @@ -2969,6 +3000,29 @@ export interface CsmUsageQuota { name?: LocalizableString; } +/** + * @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 + */ +export interface DeletedSite { + readonly deletedSiteId?: number; + readonly deletedTimestamp?: string; + readonly subscription?: string; + readonly resourceGroup?: string; + readonly deletedSiteName?: string; + readonly slot?: string; +} + /** * @class * Initializes a new instance of the ErrorEntity class. @@ -2991,68 +3045,6 @@ export interface ErrorEntity { message?: string; } -/** - * @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 Operation class. @@ -3081,6 +3073,20 @@ export interface Operation { 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. @@ -3149,29 +3155,6 @@ export interface ResourceMetric { readonly properties?: ResourceMetricProperty[]; } -/** - * @class - * Initializes a new instance of the DeletedSite class. - * @constructor - * A deleted app. - * - * @member {number} [id] 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} [name] Name of the deleted site - * @member {string} [slot] Slot of the deleted site - */ -export interface DeletedSite { - id?: number; - readonly deletedTimestamp?: string; - readonly subscription?: string; - readonly resourceGroup?: string; - readonly name?: string; - readonly slot?: string; -} - /** * @class * Initializes a new instance of the Solution class. @@ -3448,14 +3431,14 @@ export interface DetectorInfo { * @constructor * Instructions for rendering the data * - * @member {string} [renderingType] Rendering Type. Possible values include: - * 'NoGraph', 'Table', 'TimeSeries', 'TimeSeriesPerInstance' + * @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 { - renderingType?: string; + type?: string; title?: string; description?: string; } @@ -3472,9 +3455,8 @@ export interface Rendering { * @member {array} [table.rows] Raw row values * @member {object} [renderingProperties] Properties that describe how the * table should be rendered - * @member {string} [renderingProperties.renderingType] Rendering Type. - * Possible values include: 'NoGraph', 'Table', 'TimeSeries', - * 'TimeSeriesPerInstance' + * @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 @@ -3661,9 +3643,13 @@ export interface ApplicationStack { * @member {string} [channels] List of channels that this recommendation can * apply. Possible values include: 'Notification', 'Api', 'Email', 'Webhook', * 'All' - * @member {array} [tags] The list of category tags that this recommendation - * belongs to. + * @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 @@ -3693,8 +3679,10 @@ export interface Recommendation extends ProxyOnlyResource { message?: string; level?: string; channels?: string; - tags?: string[]; + readonly categoryTags?: string[]; actionName?: string; + enabled?: number; + states?: string[]; startTime?: Date; endTime?: Date; nextNotificationTime?: Date; @@ -3713,7 +3701,7 @@ export interface Recommendation extends ProxyOnlyResource { * @constructor * Represents a recommendation rule that the recommendation engine can perform. * - * @member {string} [recommendationRuleName] Unique name of the rule. + * @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 @@ -3728,7 +3716,8 @@ export interface Recommendation extends ProxyOnlyResource { * @member {string} [channels] List of available channels that this rule * applies. Possible values include: 'Notification', 'Api', 'Email', 'Webhook', * 'All' - * @member {array} [tags] An array of category tags that the rule contains. + * @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. @@ -3739,7 +3728,7 @@ export interface Recommendation extends ProxyOnlyResource { * associated with the rule. Applicable to dynamic rule only. */ export interface RecommendationRule extends ProxyOnlyResource { - recommendationRuleName?: string; + recommendationName?: string; displayName?: string; message?: string; recommendationId?: string; @@ -3747,29 +3736,13 @@ export interface RecommendationRule extends ProxyOnlyResource { actionName?: string; level?: string; channels?: string; - tags?: string[]; + readonly categoryTags?: string[]; isDynamic?: boolean; extensionName?: string; bladeName?: string; forwardLink?: string; } -/** - * @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 BillingMeter class. @@ -3781,7 +3754,8 @@ export interface ResourceHealthMetadata extends ProxyOnlyResource { * @member {string} [billingLocation] Azure Location of billable resource * @member {string} [shortName] Short Name from App Service Azure pricing Page * @member {string} [friendlyName] Friendly name of the meter - * @member {string} [resourceType] App Service resource type meter used for + * @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; @@ -3789,6 +3763,7 @@ export interface BillingMeter extends ProxyOnlyResource { shortName?: string; friendlyName?: string; resourceType?: string; + osType?: string; } /** @@ -3812,12 +3787,10 @@ export interface CsmMoveResourceEnvelope { * @constructor * Geographical region. * - * @member {string} [geoRegionName] Region name. * @member {string} [description] Region description. * @member {string} [displayName] Display name for region. */ export interface GeoRegion extends ProxyOnlyResource { - readonly geoRegionName?: string; readonly description?: string; readonly displayName?: string; } @@ -3897,7 +3870,6 @@ export interface GlobalCsmSkuDescription { * @member {string} [sku] Premier add on SKU. * @member {string} [product] Premier add on offer Product. * @member {string} [vendor] Premier add on offer Vendor. - * @member {string} [premierAddOnOfferName] Premier add on offer Name. * @member {boolean} [promoCodeRequired] true if promotion code is * required; otherwise, false. * @member {number} [quota] Premier add on offer Quota. @@ -3913,7 +3885,6 @@ export interface PremierAddOnOffer extends ProxyOnlyResource { sku?: string; product?: string; vendor?: string; - premierAddOnOfferName?: string; promoCodeRequired?: boolean; quota?: number; webHostingPlanRestrictions?: string; @@ -3987,14 +3958,12 @@ export interface SkuInfos { * @constructor * The source control OAuth token. * - * @member {string} [sourceControlName] Name or source control type. * @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 { - sourceControlName?: string; token?: string; tokenSecret?: string; refreshToken?: string; @@ -4022,6 +3991,8 @@ export interface SourceControl extends ProxyOnlyResource { * 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; @@ -4033,6 +4004,7 @@ export interface ValidateRequest { isSpot?: boolean; capacity?: number; hostingEnvironment?: string; + isXenon?: boolean; } /** @@ -4320,7 +4292,6 @@ export interface BackupSchedule { * @constructor * Description of a backup which will be performed. * - * @member {string} backupRequestName 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. @@ -4343,16 +4314,12 @@ export interface BackupSchedule { * @member {date} [backupSchedule.lastExecutionTime] Last time when this * schedule was triggered. * @member {array} [databases] Databases included in the backup. - * @member {string} [backupRequestType] Type of the backup. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' */ export interface BackupRequest extends ProxyOnlyResource { - backupRequestName: string; enabled?: boolean; storageAccountUrl: string; backupSchedule?: BackupSchedule; databases?: DatabaseBackupSetting[]; - backupRequestType?: string; } /** @@ -4393,13 +4360,11 @@ export interface ConnectionStringDictionary extends ProxyOnlyResource { * 'Initializing', 'Starting', 'Running', 'PendingRestart', 'Stopped' * @member {string} [detailedStatus] Detailed status. * @member {string} [logUrl] Log URL. - * @member {string} [continuousWebJobName] Job name. Used as job identifier in - * ARM resource URI. * @member {string} [runCommand] Run command. * @member {string} [url] Job URL. * @member {string} [extraInfoUrl] Extra Info URL. - * @member {string} [jobType] Job type. Possible values include: 'Continuous', - * 'Triggered' + * @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. @@ -4408,11 +4373,10 @@ export interface ContinuousWebJob extends ProxyOnlyResource { status?: string; detailedStatus?: string; logUrl?: string; - readonly continuousWebJobName?: string; runCommand?: string; url?: string; extraInfoUrl?: string; - jobType?: string; + webJobType?: string; error?: string; usingSdk?: boolean; settings?: { [propertyName: string]: any }; @@ -4503,13 +4467,33 @@ export interface CustomHostnameAnalysisResult extends ProxyOnlyResource { 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 {string} [deploymentId] Identifier for deployment. * @member {number} [status] Deployment status. * @member {string} [message] Details about deployment status. * @member {string} [author] Who authored the deployment. @@ -4522,7 +4506,6 @@ export interface CustomHostnameAnalysisResult extends ProxyOnlyResource { * @member {string} [details] Details on deployment. */ export interface Deployment extends ProxyOnlyResource { - deploymentId?: string; status?: number; message?: string; author?: string; @@ -4575,7 +4558,6 @@ export interface FileSystemHttpLogsConfig { * @constructor * Web Job Information. * - * @member {string} [functionEnvelopeName] Function name. * @member {string} [functionAppId] Function App ID. * @member {string} [scriptRootPathHref] Script root path URI. * @member {string} [scriptHref] Script URI. @@ -4588,8 +4570,7 @@ export interface FileSystemHttpLogsConfig { * Portal. */ export interface FunctionEnvelope extends ProxyOnlyResource { - readonly functionEnvelopeName?: string; - readonly functionAppId?: string; + functionAppId?: string; scriptRootPathHref?: string; scriptHref?: string; configHref?: string; @@ -4867,13 +4848,11 @@ export interface NetworkFeatures extends ProxyOnlyResource { * @member {string} [instanceName] Name of the server on which the measurement * is made. * @member {number} [value] Value of counter at a certain time. - * @member {number} [coreCount] Core Count of worker. Not a data member */ export interface PerfMonSample { time?: Date; instanceName?: string; value?: number; - coreCount?: number; } /** @@ -4928,9 +4907,6 @@ export interface PerfMonResponse { * @member {string} [sku] Premier add on SKU. * @member {string} [product] Premier add on Product. * @member {string} [vendor] Premier add on Vendor. - * @member {string} [premierAddOnName] Premier add on Name. - * @member {string} [premierAddOnLocation] Premier add on Location. - * @member {object} [premierAddOnTags] Premier add on Tags. * @member {string} [marketplacePublisher] Premier add on Marketplace * publisher. * @member {string} [marketplaceOffer] Premier add on Marketplace offer. @@ -4939,20 +4915,88 @@ export interface PremierAddOn extends Resource { sku?: string; product?: string; vendor?: string; - premierAddOnName?: string; - premierAddOnLocation?: string; - premierAddOnTags?: { [propertyName: string]: 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} [processThreadInfoId] ARM Identifier for deployment. + * @member {number} [identifier] Site extension ID. * @member {string} [href] HRef URI. * @member {string} [process] Process URI. * @member {string} [startAddress] Start address. @@ -4967,7 +5011,7 @@ export interface PremierAddOn extends Resource { * @member {string} [waitReason] Wait reason. */ export interface ProcessThreadInfo extends ProxyOnlyResource { - processThreadInfoId?: number; + readonly identifier?: number; href?: string; process?: string; startAddress?: string; @@ -5021,10 +5065,10 @@ export interface ProcessModuleInfo extends ProxyOnlyResource { * @constructor * Process Information. * - * @member {number} [processInfoId] ARM Identifier for deployment. - * @member {string} [processInfoName] Deployment name. + * @member {number} [identifier] ARM Identifier for deployment. + * @member {string} [deploymentName] Deployment name. * @member {string} [href] HRef URI. - * @member {string} [miniDump] Minidump 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). @@ -5040,29 +5084,29 @@ export interface ProcessModuleInfo extends ProxyOnlyResource { * @member {number} [moduleCount] Module count. * @member {number} [threadCount] Thread count. * @member {date} [startTime] Start time. - * @member {string} [totalProcessorTime] Total CPU time. - * @member {string} [userProcessorTime] User CPU time. - * @member {string} [privilegedProcessorTime] Privileged CPU time. - * @member {number} [workingSet64] Working set. - * @member {number} [peakWorkingSet64] Peak working set. - * @member {number} [privateMemorySize64] Private memory size. - * @member {number} [virtualMemorySize64] Virtual memory size. - * @member {number} [peakVirtualMemorySize64] Peak virtual memory usage. - * @member {number} [pagedSystemMemorySize64] Paged system memory. - * @member {number} [nonpagedSystemMemorySize64] Non-paged system memory. - * @member {number} [pagedMemorySize64] Paged memory. - * @member {number} [peakPagedMemorySize64] Peak paged memory. + * @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 {boolean} [isWebjob] Is this a Web Job? * @member {string} [description] Description of process. */ export interface ProcessInfo extends ProxyOnlyResource { - processInfoId?: number; - processInfoName?: string; + readonly identifier?: number; + deploymentName?: string; href?: string; - miniDump?: string; + minidump?: string; isProfileRunning?: boolean; isIisProfileRunning?: boolean; iisProfileTimeoutInSeconds?: number; @@ -5078,22 +5122,22 @@ export interface ProcessInfo extends ProxyOnlyResource { moduleCount?: number; threadCount?: number; startTime?: Date; - totalProcessorTime?: string; - userProcessorTime?: string; - privilegedProcessorTime?: string; - workingSet64?: number; - peakWorkingSet64?: number; - privateMemorySize64?: number; - virtualMemorySize64?: number; - peakVirtualMemorySize64?: number; - pagedSystemMemorySize64?: number; - nonpagedSystemMemorySize64?: number; - pagedMemorySize64?: number; - peakPagedMemorySize64?: number; + 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; + isWebjob?: boolean; description?: string; } @@ -5139,7 +5183,8 @@ export interface PublicCertificate extends ProxyOnlyResource { * @member {string} [appServicePlan] Specify app service plan that will own * restored site. * @member {string} [operationType] Operation type. Possible values include: - * 'Default', 'Clone', 'Relocation', 'Snapshot'. Default value: 'Default' . + * 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS'. Default value: + * 'Default' . * @member {boolean} [adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, * false. @@ -5160,19 +5205,6 @@ export interface RestoreRequest extends ProxyOnlyResource { hostingEnvironment?: string; } -/** - * @class - * Initializes a new instance of the RestoreResponse class. - * @constructor - * Response for an app restore request. - * - * @member {string} [operationId] When server starts the restore process, it - * will return an operation ID identifying that particular restore operation. - */ -export interface RestoreResponse extends ProxyOnlyResource { - readonly operationId?: string; -} - /** * @class * Initializes a new instance of the SiteAuthSettings class. @@ -5232,6 +5264,8 @@ export interface RestoreResponse extends ProxyOnlyResource { * 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 @@ -5307,6 +5341,7 @@ export interface SiteAuthSettings extends ProxyOnlyResource { clientId?: string; clientSecret?: string; issuer?: string; + validateIssuer?: boolean; allowedAudiences?: string[]; additionalLoginParams?: string[]; googleClientId?: string; @@ -5373,6 +5408,7 @@ export interface SiteCloneability { * @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 @@ -5483,12 +5519,19 @@ export interface SiteCloneability { * @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; @@ -5498,6 +5541,7 @@ export interface SiteConfigResource extends ProxyOnlyResource { pythonVersion?: string; nodeVersion?: string; linuxFxVersion?: string; + windowsFxVersion?: string; requestTracingEnabled?: boolean; requestTracingExpirationTime?: Date; remoteDebuggingEnabled?: boolean; @@ -5533,9 +5577,13 @@ export interface SiteConfigResource extends ProxyOnlyResource { apiDefinition?: ApiDefinitionInfo; autoSwapSlotName?: string; localMySqlEnabled?: boolean; + managedServiceIdentityId?: number; + xManagedServiceIdentityId?: number; ipSecurityRestrictions?: IpSecurityRestriction[]; http20Enabled?: boolean; minTlsVersion?: string; + ftpsState?: string; + reservedInstanceCount?: number; } /** @@ -5545,11 +5593,11 @@ export interface SiteConfigResource extends ProxyOnlyResource { * A snapshot of a web app configuration. * * @member {date} [time] The time the snapshot was taken. - * @member {number} [siteConfigurationSnapshotInfoId] The id of the snapshot + * @member {number} [snapshotId] The id of the snapshot */ export interface SiteConfigurationSnapshotInfo extends ProxyOnlyResource { readonly time?: Date; - readonly siteConfigurationSnapshotInfoId?: number; + readonly snapshotId?: number; } /** @@ -5558,10 +5606,10 @@ export interface SiteConfigurationSnapshotInfo extends ProxyOnlyResource { * @constructor * Site Extension Information. * - * @member {string} [siteExtensionInfoId] Site extension ID. - * @member {string} [title] Site extension title. - * @member {string} [siteExtensionInfoType] Site extension type. Possible - * values include: 'Gallery', 'WebRoot' + * @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. @@ -5571,7 +5619,8 @@ export interface SiteConfigurationSnapshotInfo extends ProxyOnlyResource { * @member {string} [licenseUrl] License URL. * @member {string} [feedUrl] Feed URL. * @member {array} [authors] List of authors. - * @member {string} [installationArgs] Installer command line parameters. + * @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 @@ -5582,9 +5631,9 @@ export interface SiteConfigurationSnapshotInfo extends ProxyOnlyResource { * @member {string} [comment] Site Extension comment. */ export interface SiteExtensionInfo extends ProxyOnlyResource { - siteExtensionInfoId?: string; + extensionId?: string; title?: string; - siteExtensionInfoType?: string; + extensionType?: string; summary?: string; description?: string; version?: string; @@ -5594,7 +5643,7 @@ export interface SiteExtensionInfo extends ProxyOnlyResource { licenseUrl?: string; feedUrl?: string; authors?: string[]; - installationArgs?: string; + installerCommandLineParams?: string; publishedDateTime?: Date; downloadCount?: number; localIsLatestVersion?: boolean; @@ -5708,6 +5757,7 @@ export interface SiteLogsConfig extends ProxyOnlyResource { * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". * @member {boolean} [reserved] true if reserved; otherwise, * false. Default value: false . + * @member {boolean} [isXenon] 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. @@ -5718,6 +5768,8 @@ export interface SiteLogsConfig extends ProxyOnlyResource { * @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 @@ -5839,6 +5891,10 @@ export interface SiteLogsConfig extends ProxyOnlyResource { * @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 @@ -5846,6 +5902,11 @@ export interface SiteLogsConfig extends ProxyOnlyResource { * @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) @@ -5916,29 +5977,6 @@ export interface SiteLogsConfig extends ProxyOnlyResource { * @member {string} [cloningInfo.trafficManagerProfileName] Name of Traffic * Manager profile to create. This is only needed if Traffic Manager profile * does not already exist. - * @member {boolean} [cloningInfo.ignoreQuotas] true if quotas - * should be ignored; otherwise, false. - * @member {object} [snapshotInfo] If specified during app creation, the app is - * created from a previous snapshot. - * @member {string} [snapshotInfo.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * @member {object} [snapshotInfo.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * @member {string} [snapshotInfo.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * @member {string} [snapshotInfo.recoveryTarget.id] ARM resource ID of the - * target 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} [snapshotInfo.overwrite] If true the recovery - * operation can overwrite source app; otherwise, false. - * @member {boolean} [snapshotInfo.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * @member {boolean} [snapshotInfo.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. * @member {string} [resourceGroup] Name of the resource group the app belongs * to. Read-only. * @member {boolean} [isDefaultContainer] true if the app is a @@ -5967,6 +6005,7 @@ export interface SitePatchResource extends ProxyOnlyResource { hostNameSslStates?: HostNameSslState[]; serverFarmId?: string; reserved?: boolean; + isXenon?: boolean; readonly lastModifiedTimeUtc?: Date; siteConfig?: SiteConfig; readonly trafficManagerHostNames?: string[]; @@ -5983,7 +6022,6 @@ export interface SitePatchResource extends ProxyOnlyResource { readonly suspendedTill?: Date; readonly maxNumberOfWorkers?: number; cloningInfo?: CloningInfo; - snapshotInfo?: SnapshotRecoveryRequest; readonly resourceGroup?: string; readonly isDefaultContainer?: boolean; readonly defaultHostName?: string; @@ -6054,8 +6092,8 @@ export interface SlotConfigNamesResource extends ProxyOnlyResource { * @constructor * A setting difference between two deployment slots of an app. * - * @member {string} [slotDifferenceType] Type of the difference: Information, - * Warning or Error. + * @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 @@ -6068,7 +6106,7 @@ export interface SlotConfigNamesResource extends ProxyOnlyResource { * @member {string} [description] Description of the setting difference. */ export interface SlotDifference extends ProxyOnlyResource { - readonly slotDifferenceType?: string; + readonly level?: string; readonly settingType?: string; readonly diffRule?: string; readonly settingName?: string; @@ -6079,14 +6117,55 @@ export interface SlotDifference extends ProxyOnlyResource { /** * @class - * Initializes a new instance of the Snapshot class. + * Initializes a new instance of the SnapshotRecoverySource class. * @constructor - * A snapshot of an app. + * Specifies the web app that snapshot contents will be retrieved from. * - * @member {string} [time] The time the snapshot was taken. + * @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 Snapshot extends ProxyOnlyResource { - readonly time?: string; +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; } /** @@ -6136,14 +6215,32 @@ 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} [triggeredJobRunId] Job ID. - * @member {string} [triggeredJobRunName] Job name. + * @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. @@ -6156,8 +6253,8 @@ export interface StringDictionary extends ProxyOnlyResource { * @member {string} [trigger] Job trigger. */ export interface TriggeredJobRun extends ProxyOnlyResource { - triggeredJobRunId?: string; - readonly triggeredJobRunName?: string; + webJobId?: string; + webJobName?: string; status?: string; startTime?: Date; endTime?: Date; @@ -6176,10 +6273,10 @@ export interface TriggeredJobRun extends ProxyOnlyResource { * Triggered Web Job History. List of Triggered Web Job Run Information * elements. * - * @member {array} [triggeredJobRuns] List of triggered web job runs. + * @member {array} [runs] List of triggered web job runs. */ export interface TriggeredJobHistory extends ProxyOnlyResource { - triggeredJobRuns?: TriggeredJobRun[]; + runs?: TriggeredJobRun[]; } /** @@ -6189,8 +6286,8 @@ export interface TriggeredJobHistory extends ProxyOnlyResource { * Triggered Web Job Information. * * @member {object} [latestRun] Latest job run information. - * @member {string} [latestRun.triggeredJobRunId] Job ID. - * @member {string} [latestRun.triggeredJobRunName] Job name. + * @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. @@ -6203,13 +6300,11 @@ export interface TriggeredJobHistory extends ProxyOnlyResource { * @member {string} [latestRun.trigger] Job trigger. * @member {string} [historyUrl] History URL. * @member {string} [schedulerLogsUrl] Scheduler Logs URL. - * @member {string} [triggeredWebJobName] Job name. Used as job identifier in - * ARM resource URI. * @member {string} [runCommand] Run command. * @member {string} [url] Job URL. * @member {string} [extraInfoUrl] Extra Info URL. - * @member {string} [jobType] Job type. Possible values include: 'Continuous', - * 'Triggered' + * @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. @@ -6218,11 +6313,10 @@ export interface TriggeredWebJob extends ProxyOnlyResource { latestRun?: TriggeredJobRun; historyUrl?: string; schedulerLogsUrl?: string; - readonly triggeredWebJobName?: string; runCommand?: string; url?: string; extraInfoUrl?: string; - jobType?: string; + webJobType?: string; error?: string; usingSdk?: boolean; settings?: { [propertyName: string]: any }; @@ -6234,23 +6328,20 @@ export interface TriggeredWebJob extends ProxyOnlyResource { * @constructor * Web Job Information. * - * @member {string} [webJobName] Job name. Used as job identifier in ARM - * resource URI. * @member {string} [runCommand] Run command. * @member {string} [url] Job URL. * @member {string} [extraInfoUrl] Extra Info URL. - * @member {string} [jobType] Job type. Possible values include: 'Continuous', - * 'Triggered' + * @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 { - readonly webJobName?: string; runCommand?: string; url?: string; extraInfoUrl?: string; - jobType?: string; + webJobType?: string; error?: string; usingSdk?: boolean; settings?: { [propertyName: string]: any }; @@ -6360,6 +6451,12 @@ export interface AddressResponse { * 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; @@ -6398,6 +6495,9 @@ export interface AppServiceEnvironmentResource extends Resource { dynamicCacheEnabled?: boolean; clusterSettings?: NameValuePair[]; userWhitelistedIpRanges?: string[]; + hasLinuxWorkers?: boolean; + sslCertKeyVaultId?: string; + sslCertKeyVaultSecretName?: string; } /** @@ -6484,6 +6584,12 @@ export interface AppServiceEnvironmentResource extends Resource { * 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; @@ -6522,6 +6628,9 @@ export interface AppServiceEnvironmentPatchResource extends ProxyOnlyResource { dynamicCacheEnabled?: boolean; clusterSettings?: NameValuePair[]; userWhitelistedIpRanges?: string[]; + hasLinuxWorkers?: boolean; + sslCertKeyVaultId?: string; + sslCertKeyVaultSecretName?: string; } /** @@ -6558,7 +6667,6 @@ export interface MetricAvailabilily { * @constructor * Metadata for a metric. * - * @member {string} [metricDefinitionName] Name of the metric. * @member {string} [unit] Unit of the metric. * @member {string} [primaryAggregationType] Primary aggregation type. * @member {array} [metricAvailabilities] List of time grains supported for the @@ -6566,7 +6674,6 @@ export interface MetricAvailabilily { * @member {string} [displayName] Friendly name shown in the UI. */ export interface MetricDefinition extends ProxyOnlyResource { - readonly metricDefinitionName?: string; readonly unit?: string; readonly primaryAggregationType?: string; readonly metricAvailabilities?: MetricAvailabilily[]; @@ -6623,7 +6730,6 @@ export interface SkuInfo { * Usage of the quota resource. * * @member {string} [displayName] Friendly name shown in the UI. - * @member {string} [usageName] Name of the quota. * @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. @@ -6635,7 +6741,6 @@ export interface SkuInfo { */ export interface Usage extends ProxyOnlyResource { readonly displayName?: string; - readonly usageName?: string; readonly resourceName?: string; readonly unit?: string; readonly currentValue?: number; @@ -6695,8 +6800,6 @@ export interface WorkerPoolResource extends ProxyOnlyResource { * @constructor * ARM resource for a app service plan. * - * @member {string} appServicePlanPatchResourceName Name for the 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: @@ -6724,9 +6827,13 @@ export interface WorkerPoolResource extends ProxyOnlyResource { * 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] 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 @@ -6734,7 +6841,6 @@ export interface WorkerPoolResource extends ProxyOnlyResource { * 'InProgress', 'Deleting' */ export interface AppServicePlanPatchResource extends ProxyOnlyResource { - appServicePlanPatchResourceName: string; workerTierName?: string; readonly status?: string; readonly subscription?: string; @@ -6746,8 +6852,10 @@ export interface AppServicePlanPatchResource extends ProxyOnlyResource { readonly numberOfSites?: number; isSpot?: boolean; spotExpirationTime?: Date; + freeOfferExpirationTime?: Date; readonly resourceGroup?: string; reserved?: boolean; + isXenon?: boolean; targetWorkerCount?: number; targetWorkerSizeId?: number; readonly provisioningState?: string; @@ -6963,25 +7071,25 @@ export interface RecommendationCollection extends Array { /** * @class - * Initializes a new instance of the ResourceHealthMetadataCollection class. + * Initializes a new instance of the SourceControlCollection class. * @constructor - * Collection of resource health metadata. + * Collection of source controls. * * @member {string} [nextLink] Link to next page of resources. */ -export interface ResourceHealthMetadataCollection extends Array { +export interface SourceControlCollection extends Array { readonly nextLink?: string; } /** * @class - * Initializes a new instance of the SourceControlCollection class. + * Initializes a new instance of the BillingMeterCollection class. * @constructor - * Collection of source controls. + * Collection of Billing Meters * * @member {string} [nextLink] Link to next page of resources. */ -export interface SourceControlCollection extends Array { +export interface BillingMeterCollection extends Array { readonly nextLink?: string; } @@ -7021,18 +7129,6 @@ export interface PremierAddOnOfferCollection extends Array { readonly nextLink?: string; } -/** - * @class - * Initializes a new instance of the BillingMeterCollection class. - * @constructor - * Collection of Billing Meters - * - * @member {string} [nextLink] Link to next page of resources. - */ -export interface BillingMeterCollection extends Array { - readonly nextLink?: string; -} - /** * @class * Initializes a new instance of the WebAppCollection class. @@ -7091,7 +7187,7 @@ export interface SiteConfigurationSnapshotInfoCollection extends Array { - nextLink?: string; + readonly nextLink?: string; } /** @@ -7380,7 +7476,7 @@ export interface UsageCollection extends Array { * @member {string} [nextLink] Link to next page of resources. */ export interface AppServicePlanCollection extends Array { - nextLink?: string; + readonly nextLink?: string; } /** diff --git a/lib/services/websiteManagement2/lib/models/index.js b/lib/services/websiteManagement2/lib/models/index.js index 2e4f391d06..af3e9c3c98 100644 --- a/lib/services/websiteManagement2/lib/models/index.js +++ b/lib/services/websiteManagement2/lib/models/index.js @@ -36,10 +36,8 @@ exports.VnetRoute = require('./vnetRoute'); exports.VnetInfo = require('./vnetInfo'); exports.VnetGateway = require('./vnetGateway'); exports.User = require('./user'); -exports.SnapshotRecoveryTarget = require('./snapshotRecoveryTarget'); -exports.SnapshotRecoveryRequest = require('./snapshotRecoveryRequest'); +exports.Snapshot = require('./snapshot'); exports.ResourceMetricAvailability = require('./resourceMetricAvailability'); -exports.ResourceMetricName = require('./resourceMetricName'); exports.ResourceMetricDefinition = require('./resourceMetricDefinition'); exports.PushSettings = require('./pushSettings'); exports.Identifier = require('./identifier'); @@ -75,7 +73,11 @@ 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'); @@ -93,7 +95,6 @@ exports.DomainControlCenterSsoRequest = require('./domainControlCenterSsoRequest exports.DomainOwnershipIdentifier = require('./domainOwnershipIdentifier'); exports.DomainPatchResource = require('./domainPatchResource'); exports.DomainRecommendationSearchParameters = require('./domainRecommendationSearchParameters'); -exports.ErrorResponse = require('./errorResponse'); exports.TldLegalAgreement = require('./tldLegalAgreement'); exports.TopLevelDomain = require('./topLevelDomain'); exports.TopLevelDomainAgreementOption = require('./topLevelDomainAgreementOption'); @@ -107,15 +108,13 @@ exports.NetworkAccessControlEntry = require('./networkAccessControlEntry'); exports.AppServiceEnvironment = require('./appServiceEnvironment'); exports.LocalizableString = require('./localizableString'); exports.CsmUsageQuota = require('./csmUsageQuota'); +exports.DeletedSite = require('./deletedSite'); exports.ErrorEntity = require('./errorEntity'); -exports.DefaultErrorResponseErrorDetailsItem = require('./defaultErrorResponseErrorDetailsItem'); -exports.DefaultErrorResponseError = require('./defaultErrorResponseError'); -exports.DefaultErrorResponse = require('./defaultErrorResponse'); exports.Operation = require('./operation'); +exports.ResourceMetricName = require('./resourceMetricName'); exports.ResourceMetricProperty = require('./resourceMetricProperty'); exports.ResourceMetricValue = require('./resourceMetricValue'); exports.ResourceMetric = require('./resourceMetric'); -exports.DeletedSite = require('./deletedSite'); exports.Solution = require('./solution'); exports.DetectorAbnormalTimePeriod = require('./detectorAbnormalTimePeriod'); exports.AbnormalTimePeriod = require('./abnormalTimePeriod'); @@ -140,7 +139,6 @@ exports.StackMajorVersion = require('./stackMajorVersion'); exports.ApplicationStack = require('./applicationStack'); exports.Recommendation = require('./recommendation'); exports.RecommendationRule = require('./recommendationRule'); -exports.ResourceHealthMetadata = require('./resourceHealthMetadata'); exports.BillingMeter = require('./billingMeter'); exports.CsmMoveResourceEnvelope = require('./csmMoveResourceEnvelope'); exports.GeoRegion = require('./geoRegion'); @@ -173,6 +171,7 @@ 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'); @@ -192,12 +191,15 @@ 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.RestoreResponse = require('./restoreResponse'); exports.SiteAuthSettings = require('./siteAuthSettings'); exports.SiteCloneabilityCriterion = require('./siteCloneabilityCriterion'); exports.SiteCloneability = require('./siteCloneability'); @@ -211,10 +213,12 @@ exports.SitePhpErrorLogFlag = require('./sitePhpErrorLogFlag'); exports.SiteSourceControl = require('./siteSourceControl'); exports.SlotConfigNamesResource = require('./slotConfigNamesResource'); exports.SlotDifference = require('./slotDifference'); -exports.Snapshot = require('./snapshot'); +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'); @@ -246,12 +250,11 @@ exports.DiagnosticAnalysisCollection = require('./diagnosticAnalysisCollection') exports.DiagnosticDetectorCollection = require('./diagnosticDetectorCollection'); exports.ApplicationStackCollection = require('./applicationStackCollection'); exports.RecommendationCollection = require('./recommendationCollection'); -exports.ResourceHealthMetadataCollection = require('./resourceHealthMetadataCollection'); exports.SourceControlCollection = require('./sourceControlCollection'); +exports.BillingMeterCollection = require('./billingMeterCollection'); exports.GeoRegionCollection = require('./geoRegionCollection'); exports.IdentifierCollection = require('./identifierCollection'); exports.PremierAddOnOfferCollection = require('./premierAddOnOfferCollection'); -exports.BillingMeterCollection = require('./billingMeterCollection'); exports.WebAppCollection = require('./webAppCollection'); exports.BackupItemCollection = require('./backupItemCollection'); exports.SiteConfigResourceCollection = require('./siteConfigResourceCollection'); diff --git a/lib/services/websiteManagement2/lib/models/ipSecurityRestriction.js b/lib/services/websiteManagement2/lib/models/ipSecurityRestriction.js index c9589edfc8..7442dc0ebd 100644 --- a/lib/services/websiteManagement2/lib/models/ipSecurityRestriction.js +++ b/lib/services/websiteManagement2/lib/models/ipSecurityRestriction.js @@ -19,8 +19,18 @@ 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() { } @@ -52,6 +62,42 @@ class IpSecurityRestriction { 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' + } } } } 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/managedServiceIdentity.js b/lib/services/websiteManagement2/lib/models/managedServiceIdentity.js index 1b38e8c693..1729031497 100644 --- a/lib/services/websiteManagement2/lib/models/managedServiceIdentity.js +++ b/lib/services/websiteManagement2/lib/models/managedServiceIdentity.js @@ -18,9 +18,11 @@ class ManagedServiceIdentity { /** * Create a ManagedServiceIdentity. * @member {string} [type] Type of managed service identity. Possible values - * include: 'SystemAssigned' + * 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() { } @@ -61,6 +63,20 @@ class ManagedServiceIdentity { type: { name: 'String' } + }, + identityIds: { + required: false, + serializedName: 'identityIds', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } } } } diff --git a/lib/services/websiteManagement2/lib/models/metricDefinition.js b/lib/services/websiteManagement2/lib/models/metricDefinition.js index 7ef23aa4c1..e42fa83b2a 100644 --- a/lib/services/websiteManagement2/lib/models/metricDefinition.js +++ b/lib/services/websiteManagement2/lib/models/metricDefinition.js @@ -20,7 +20,6 @@ const models = require('./index'); class MetricDefinition extends models['ProxyOnlyResource'] { /** * Create a MetricDefinition. - * @member {string} [metricDefinitionName] Name of the metric. * @member {string} [unit] Unit of the metric. * @member {string} [primaryAggregationType] Primary aggregation type. * @member {array} [metricAvailabilities] List of time grains supported for @@ -76,14 +75,6 @@ class MetricDefinition extends models['ProxyOnlyResource'] { name: 'String' } }, - metricDefinitionName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, unit: { required: false, readOnly: true, diff --git a/lib/services/websiteManagement2/lib/models/perfMonSample.js b/lib/services/websiteManagement2/lib/models/perfMonSample.js index f7882a7d2e..e88148d9b9 100644 --- a/lib/services/websiteManagement2/lib/models/perfMonSample.js +++ b/lib/services/websiteManagement2/lib/models/perfMonSample.js @@ -21,7 +21,6 @@ class PerfMonSample { * @member {string} [instanceName] Name of the server on which the * measurement is made. * @member {number} [value] Value of counter at a certain time. - * @member {number} [coreCount] Core Count of worker. Not a data member */ constructor() { } @@ -60,13 +59,6 @@ class PerfMonSample { type: { name: 'Number' } - }, - coreCount: { - required: false, - serializedName: 'coreCount', - type: { - name: 'Number' - } } } } diff --git a/lib/services/websiteManagement2/lib/models/premierAddOn.js b/lib/services/websiteManagement2/lib/models/premierAddOn.js index ac3d6c9e2f..c0db87d43b 100644 --- a/lib/services/websiteManagement2/lib/models/premierAddOn.js +++ b/lib/services/websiteManagement2/lib/models/premierAddOn.js @@ -23,9 +23,6 @@ class PremierAddOn extends models['Resource'] { * @member {string} [sku] Premier add on SKU. * @member {string} [product] Premier add on Product. * @member {string} [vendor] Premier add on Vendor. - * @member {string} [premierAddOnName] Premier add on Name. - * @member {string} [premierAddOnLocation] Premier add on Location. - * @member {object} [premierAddOnTags] Premier add on Tags. * @member {string} [marketplacePublisher] Premier add on Marketplace * publisher. * @member {string} [marketplaceOffer] Premier add on Marketplace offer. @@ -121,34 +118,6 @@ class PremierAddOn extends models['Resource'] { name: 'String' } }, - premierAddOnName: { - required: false, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, - premierAddOnLocation: { - required: false, - serializedName: 'properties.location', - type: { - name: 'String' - } - }, - premierAddOnTags: { - required: false, - serializedName: 'properties.tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, marketplacePublisher: { required: false, serializedName: 'properties.marketplacePublisher', diff --git a/lib/services/websiteManagement2/lib/models/premierAddOnOffer.js b/lib/services/websiteManagement2/lib/models/premierAddOnOffer.js index 2252e8969a..919328a6d8 100644 --- a/lib/services/websiteManagement2/lib/models/premierAddOnOffer.js +++ b/lib/services/websiteManagement2/lib/models/premierAddOnOffer.js @@ -23,7 +23,6 @@ class PremierAddOnOffer extends models['ProxyOnlyResource'] { * @member {string} [sku] Premier add on SKU. * @member {string} [product] Premier add on offer Product. * @member {string} [vendor] Premier add on offer Vendor. - * @member {string} [premierAddOnOfferName] Premier add on offer Name. * @member {boolean} [promoCodeRequired] true if promotion code * is required; otherwise, false. * @member {number} [quota] Premier add on offer Quota. @@ -105,13 +104,6 @@ class PremierAddOnOffer extends models['ProxyOnlyResource'] { name: 'String' } }, - premierAddOnOfferName: { - required: false, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, promoCodeRequired: { required: false, serializedName: 'properties.promoCodeRequired', 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..635dd40054 --- /dev/null +++ b/lib/services/websiteManagement2/lib/models/privateAccessVirtualNetwork.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'); + +/** + * 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 index 094583fabf..1fc4d90c98 100644 --- a/lib/services/websiteManagement2/lib/models/processInfo.js +++ b/lib/services/websiteManagement2/lib/models/processInfo.js @@ -20,10 +20,10 @@ const models = require('./index'); class ProcessInfo extends models['ProxyOnlyResource'] { /** * Create a ProcessInfo. - * @member {number} [processInfoId] ARM Identifier for deployment. - * @member {string} [processInfoName] Deployment name. + * @member {number} [identifier] ARM Identifier for deployment. + * @member {string} [deploymentName] Deployment name. * @member {string} [href] HRef URI. - * @member {string} [miniDump] Minidump 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 @@ -40,22 +40,22 @@ class ProcessInfo extends models['ProxyOnlyResource'] { * @member {number} [moduleCount] Module count. * @member {number} [threadCount] Thread count. * @member {date} [startTime] Start time. - * @member {string} [totalProcessorTime] Total CPU time. - * @member {string} [userProcessorTime] User CPU time. - * @member {string} [privilegedProcessorTime] Privileged CPU time. - * @member {number} [workingSet64] Working set. - * @member {number} [peakWorkingSet64] Peak working set. - * @member {number} [privateMemorySize64] Private memory size. - * @member {number} [virtualMemorySize64] Virtual memory size. - * @member {number} [peakVirtualMemorySize64] Peak virtual memory usage. - * @member {number} [pagedSystemMemorySize64] Paged system memory. - * @member {number} [nonpagedSystemMemorySize64] Non-paged system memory. - * @member {number} [pagedMemorySize64] Paged memory. - * @member {number} [peakPagedMemorySize64] Peak paged memory. + * @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 {boolean} [isWebjob] Is this a Web Job? * @member {string} [description] Description of process. */ constructor() { @@ -107,16 +107,17 @@ class ProcessInfo extends models['ProxyOnlyResource'] { name: 'String' } }, - processInfoId: { + identifier: { required: false, - serializedName: 'properties.id', + readOnly: true, + serializedName: 'properties.identifier', type: { name: 'Number' } }, - processInfoName: { + deploymentName: { required: false, - serializedName: 'properties.name', + serializedName: 'properties.deployment_name', type: { name: 'String' } @@ -128,30 +129,30 @@ class ProcessInfo extends models['ProxyOnlyResource'] { name: 'String' } }, - miniDump: { + minidump: { required: false, - serializedName: 'properties.miniDump', + serializedName: 'properties.minidump', type: { name: 'String' } }, isProfileRunning: { required: false, - serializedName: 'properties.isProfileRunning', + serializedName: 'properties.is_profile_running', type: { name: 'Boolean' } }, isIisProfileRunning: { required: false, - serializedName: 'properties.isIisProfileRunning', + serializedName: 'properties.is_iis_profile_running', type: { name: 'Boolean' } }, iisProfileTimeoutInSeconds: { required: false, - serializedName: 'properties.iisProfileTimeoutInSeconds', + serializedName: 'properties.iis_profile_timeout_in_seconds', type: { name: 'Number' } @@ -194,7 +195,7 @@ class ProcessInfo extends models['ProxyOnlyResource'] { }, openFileHandles: { required: false, - serializedName: 'properties.openFileHandles', + serializedName: 'properties.open_file_handles', type: { name: 'Sequence', element: { @@ -223,147 +224,147 @@ class ProcessInfo extends models['ProxyOnlyResource'] { }, fileName: { required: false, - serializedName: 'properties.fileName', + serializedName: 'properties.file_name', type: { name: 'String' } }, commandLine: { required: false, - serializedName: 'properties.commandLine', + serializedName: 'properties.command_line', type: { name: 'String' } }, userName: { required: false, - serializedName: 'properties.userName', + serializedName: 'properties.user_name', type: { name: 'String' } }, handleCount: { required: false, - serializedName: 'properties.handleCount', + serializedName: 'properties.handle_count', type: { name: 'Number' } }, moduleCount: { required: false, - serializedName: 'properties.moduleCount', + serializedName: 'properties.module_count', type: { name: 'Number' } }, threadCount: { required: false, - serializedName: 'properties.threadCount', + serializedName: 'properties.thread_count', type: { name: 'Number' } }, startTime: { required: false, - serializedName: 'properties.startTime', + serializedName: 'properties.start_time', type: { name: 'DateTime' } }, - totalProcessorTime: { + totalCpuTime: { required: false, - serializedName: 'properties.totalProcessorTime', + serializedName: 'properties.total_cpu_time', type: { name: 'String' } }, - userProcessorTime: { + userCpuTime: { required: false, - serializedName: 'properties.userProcessorTime', + serializedName: 'properties.user_cpu_time', type: { name: 'String' } }, - privilegedProcessorTime: { + privilegedCpuTime: { required: false, - serializedName: 'properties.privilegedProcessorTime', + serializedName: 'properties.privileged_cpu_time', type: { name: 'String' } }, - workingSet64: { + workingSet: { required: false, - serializedName: 'properties.workingSet64', + serializedName: 'properties.working_set', type: { name: 'Number' } }, - peakWorkingSet64: { + peakWorkingSet: { required: false, - serializedName: 'properties.peakWorkingSet64', + serializedName: 'properties.peak_working_set', type: { name: 'Number' } }, - privateMemorySize64: { + privateMemory: { required: false, - serializedName: 'properties.privateMemorySize64', + serializedName: 'properties.private_memory', type: { name: 'Number' } }, - virtualMemorySize64: { + virtualMemory: { required: false, - serializedName: 'properties.virtualMemorySize64', + serializedName: 'properties.virtual_memory', type: { name: 'Number' } }, - peakVirtualMemorySize64: { + peakVirtualMemory: { required: false, - serializedName: 'properties.peakVirtualMemorySize64', + serializedName: 'properties.peak_virtual_memory', type: { name: 'Number' } }, - pagedSystemMemorySize64: { + pagedSystemMemory: { required: false, - serializedName: 'properties.pagedSystemMemorySize64', + serializedName: 'properties.paged_system_memory', type: { name: 'Number' } }, - nonpagedSystemMemorySize64: { + nonPagedSystemMemory: { required: false, - serializedName: 'properties.nonpagedSystemMemorySize64', + serializedName: 'properties.non_paged_system_memory', type: { name: 'Number' } }, - pagedMemorySize64: { + pagedMemory: { required: false, - serializedName: 'properties.pagedMemorySize64', + serializedName: 'properties.paged_memory', type: { name: 'Number' } }, - peakPagedMemorySize64: { + peakPagedMemory: { required: false, - serializedName: 'properties.peakPagedMemorySize64', + serializedName: 'properties.peak_paged_memory', type: { name: 'Number' } }, timeStamp: { required: false, - serializedName: 'properties.timeStamp', + serializedName: 'properties.time_stamp', type: { name: 'DateTime' } }, environmentVariables: { required: false, - serializedName: 'properties.environmentVariables', + serializedName: 'properties.environment_variables', type: { name: 'Dictionary', value: { @@ -377,14 +378,14 @@ class ProcessInfo extends models['ProxyOnlyResource'] { }, isScmSite: { required: false, - serializedName: 'properties.isScmSite', + serializedName: 'properties.is_scm_site', type: { name: 'Boolean' } }, - isWebJob: { + isWebjob: { required: false, - serializedName: 'properties.isWebJob', + serializedName: 'properties.is_webjob', type: { name: 'Boolean' } diff --git a/lib/services/websiteManagement2/lib/models/processModuleInfo.js b/lib/services/websiteManagement2/lib/models/processModuleInfo.js index 54334a64cf..610d4bf843 100644 --- a/lib/services/websiteManagement2/lib/models/processModuleInfo.js +++ b/lib/services/websiteManagement2/lib/models/processModuleInfo.js @@ -84,14 +84,14 @@ class ProcessModuleInfo extends models['ProxyOnlyResource'] { }, baseAddress: { required: false, - serializedName: 'properties.baseAddress', + serializedName: 'properties.base_address', type: { name: 'String' } }, fileName: { required: false, - serializedName: 'properties.fileName', + serializedName: 'properties.file_name', type: { name: 'String' } @@ -105,28 +105,28 @@ class ProcessModuleInfo extends models['ProxyOnlyResource'] { }, filePath: { required: false, - serializedName: 'properties.filePath', + serializedName: 'properties.file_path', type: { name: 'String' } }, moduleMemorySize: { required: false, - serializedName: 'properties.moduleMemorySize', + serializedName: 'properties.module_memory_size', type: { name: 'Number' } }, fileVersion: { required: false, - serializedName: 'properties.fileVersion', + serializedName: 'properties.file_version', type: { name: 'String' } }, fileDescription: { required: false, - serializedName: 'properties.fileDescription', + serializedName: 'properties.file_description', type: { name: 'String' } @@ -140,14 +140,14 @@ class ProcessModuleInfo extends models['ProxyOnlyResource'] { }, productVersion: { required: false, - serializedName: 'properties.productVersion', + serializedName: 'properties.product_version', type: { name: 'String' } }, isDebug: { required: false, - serializedName: 'properties.isDebug', + serializedName: 'properties.is_debug', type: { name: 'Boolean' } diff --git a/lib/services/websiteManagement2/lib/models/processThreadInfo.js b/lib/services/websiteManagement2/lib/models/processThreadInfo.js index ec227556b0..3594604e66 100644 --- a/lib/services/websiteManagement2/lib/models/processThreadInfo.js +++ b/lib/services/websiteManagement2/lib/models/processThreadInfo.js @@ -20,7 +20,7 @@ const models = require('./index'); class ProcessThreadInfo extends models['ProxyOnlyResource'] { /** * Create a ProcessThreadInfo. - * @member {number} [processThreadInfoId] ARM Identifier for deployment. + * @member {number} [identifier] Site extension ID. * @member {string} [href] HRef URI. * @member {string} [process] Process URI. * @member {string} [startAddress] Start address. @@ -83,9 +83,10 @@ class ProcessThreadInfo extends models['ProxyOnlyResource'] { name: 'String' } }, - processThreadInfoId: { + identifier: { required: false, - serializedName: 'properties.id', + readOnly: true, + serializedName: 'properties.identifier', type: { name: 'Number' } @@ -106,56 +107,56 @@ class ProcessThreadInfo extends models['ProxyOnlyResource'] { }, startAddress: { required: false, - serializedName: 'properties.startAddress', + serializedName: 'properties.start_address', type: { name: 'String' } }, currentPriority: { required: false, - serializedName: 'properties.currentPriority', + serializedName: 'properties.current_priority', type: { name: 'Number' } }, priorityLevel: { required: false, - serializedName: 'properties.priorityLevel', + serializedName: 'properties.priority_level', type: { name: 'String' } }, basePriority: { required: false, - serializedName: 'properties.basePriority', + serializedName: 'properties.base_priority', type: { name: 'Number' } }, startTime: { required: false, - serializedName: 'properties.startTime', + serializedName: 'properties.start_time', type: { name: 'DateTime' } }, totalProcessorTime: { required: false, - serializedName: 'properties.totalProcessorTime', + serializedName: 'properties.total_processor_time', type: { name: 'String' } }, userProcessorTime: { required: false, - serializedName: 'properties.userProcessorTime', + serializedName: 'properties.user_processor_time', type: { name: 'String' } }, priviledgedProcessorTime: { required: false, - serializedName: 'properties.priviledgedProcessorTime', + serializedName: 'properties.priviledged_processor_time', type: { name: 'String' } @@ -169,7 +170,7 @@ class ProcessThreadInfo extends models['ProxyOnlyResource'] { }, waitReason: { required: false, - serializedName: 'properties.waitReason', + serializedName: 'properties.wait_reason', type: { name: 'String' } diff --git a/lib/services/websiteManagement2/lib/models/recommendation.js b/lib/services/websiteManagement2/lib/models/recommendation.js index 665993eaba..8f61433673 100644 --- a/lib/services/websiteManagement2/lib/models/recommendation.js +++ b/lib/services/websiteManagement2/lib/models/recommendation.js @@ -38,9 +38,13 @@ class Recommendation extends models['ProxyOnlyResource'] { * @member {string} [channels] List of channels that this recommendation can * apply. Possible values include: 'Notification', 'Api', 'Email', 'Webhook', * 'All' - * @member {array} [tags] The list of category tags that this recommendation - * belongs to. + * @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 @@ -174,9 +178,10 @@ class Recommendation extends models['ProxyOnlyResource'] { allowedValues: [ 'Notification', 'Api', 'Email', 'Webhook', 'All' ] } }, - tags: { + categoryTags: { required: false, - serializedName: 'properties.tags', + readOnly: true, + serializedName: 'properties.categoryTags', type: { name: 'Sequence', element: { @@ -195,6 +200,27 @@ class Recommendation extends models['ProxyOnlyResource'] { 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', diff --git a/lib/services/websiteManagement2/lib/models/recommendationRule.js b/lib/services/websiteManagement2/lib/models/recommendationRule.js index 6e35b0c290..98fedcaa74 100644 --- a/lib/services/websiteManagement2/lib/models/recommendationRule.js +++ b/lib/services/websiteManagement2/lib/models/recommendationRule.js @@ -20,7 +20,7 @@ const models = require('./index'); class RecommendationRule extends models['ProxyOnlyResource'] { /** * Create a RecommendationRule. - * @member {string} [recommendationRuleName] Unique name of the rule. + * @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 @@ -35,7 +35,8 @@ class RecommendationRule extends models['ProxyOnlyResource'] { * @member {string} [channels] List of available channels that this rule * applies. Possible values include: 'Notification', 'Api', 'Email', * 'Webhook', 'All' - * @member {array} [tags] An array of category tags that the rule contains. + * @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. @@ -94,9 +95,9 @@ class RecommendationRule extends models['ProxyOnlyResource'] { name: 'String' } }, - recommendationRuleName: { + recommendationName: { required: false, - serializedName: 'properties.name', + serializedName: 'properties.recommendationName', type: { name: 'String' } @@ -152,9 +153,10 @@ class RecommendationRule extends models['ProxyOnlyResource'] { allowedValues: [ 'Notification', 'Api', 'Email', 'Webhook', 'All' ] } }, - tags: { + categoryTags: { required: false, - serializedName: 'properties.tags', + readOnly: true, + serializedName: 'properties.categoryTags', type: { name: 'Sequence', element: { diff --git a/lib/services/websiteManagement2/lib/models/rendering.js b/lib/services/websiteManagement2/lib/models/rendering.js index 09e9783dbb..a2dd117840 100644 --- a/lib/services/websiteManagement2/lib/models/rendering.js +++ b/lib/services/websiteManagement2/lib/models/rendering.js @@ -17,7 +17,7 @@ class Rendering { /** * Create a Rendering. - * @member {string} [renderingType] Rendering Type. Possible values include: + * @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 @@ -40,9 +40,9 @@ class Rendering { name: 'Composite', className: 'Rendering', modelProperties: { - renderingType: { + type: { required: false, - serializedName: 'renderingType', + serializedName: 'type', type: { name: 'Enum', allowedValues: [ 'NoGraph', 'Table', 'TimeSeries', 'TimeSeriesPerInstance' ] diff --git a/lib/services/websiteManagement2/lib/models/resourceMetricDefinition.js b/lib/services/websiteManagement2/lib/models/resourceMetricDefinition.js index 86464c5423..8dbe89e1bf 100644 --- a/lib/services/websiteManagement2/lib/models/resourceMetricDefinition.js +++ b/lib/services/websiteManagement2/lib/models/resourceMetricDefinition.js @@ -20,16 +20,11 @@ const models = require('./index'); class ResourceMetricDefinition extends models['ProxyOnlyResource'] { /** * Create a ResourceMetricDefinition. - * @member {object} [resourceMetricDefinitionName] Name of the metric. - * @member {string} [resourceMetricDefinitionName.value] metric name value. - * @member {string} [resourceMetricDefinitionName.localizedValue] Localized - * metric name value. * @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 {string} [resourceMetricDefinitionId] Resource ID. * @member {object} [properties] Resource metric definition properties. */ constructor() { @@ -81,15 +76,6 @@ class ResourceMetricDefinition extends models['ProxyOnlyResource'] { name: 'String' } }, - resourceMetricDefinitionName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'Composite', - className: 'ResourceMetricName' - } - }, unit: { required: false, readOnly: true, @@ -130,14 +116,6 @@ class ResourceMetricDefinition extends models['ProxyOnlyResource'] { name: 'String' } }, - resourceMetricDefinitionId: { - required: false, - readOnly: true, - serializedName: 'properties.id', - type: { - name: 'String' - } - }, properties: { required: false, readOnly: true, diff --git a/lib/services/websiteManagement2/lib/models/restoreRequest.js b/lib/services/websiteManagement2/lib/models/restoreRequest.js index ed24bafc6a..7ae8aa728c 100644 --- a/lib/services/websiteManagement2/lib/models/restoreRequest.js +++ b/lib/services/websiteManagement2/lib/models/restoreRequest.js @@ -39,7 +39,8 @@ class RestoreRequest extends models['ProxyOnlyResource'] { * @member {string} [appServicePlan] Specify app service plan that will own * restored site. * @member {string} [operationType] Operation type. Possible values include: - * 'Default', 'Clone', 'Relocation', 'Snapshot'. Default value: 'Default' . + * 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS'. Default value: + * 'Default' . * @member {boolean} [adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, * false. @@ -167,7 +168,7 @@ class RestoreRequest extends models['ProxyOnlyResource'] { defaultValue: 'Default', type: { name: 'Enum', - allowedValues: [ 'Default', 'Clone', 'Relocation', 'Snapshot' ] + allowedValues: [ 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' ] } }, adjustConnectionStrings: { diff --git a/lib/services/websiteManagement2/lib/models/serviceSpecification.js b/lib/services/websiteManagement2/lib/models/serviceSpecification.js index ebb2a7b9a3..77a9cb816e 100644 --- a/lib/services/websiteManagement2/lib/models/serviceSpecification.js +++ b/lib/services/websiteManagement2/lib/models/serviceSpecification.js @@ -20,6 +20,7 @@ class ServiceSpecification { /** * Create a ServiceSpecification. * @member {array} [metricSpecifications] + * @member {array} [logSpecifications] */ constructor() { } @@ -52,6 +53,21 @@ class ServiceSpecification { } } } + }, + logSpecifications: { + required: false, + serializedName: 'logSpecifications', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'LogSpecificationElementType', + type: { + name: 'Composite', + className: 'LogSpecification' + } + } + } } } } diff --git a/lib/services/websiteManagement2/lib/models/site.js b/lib/services/websiteManagement2/lib/models/site.js index daa121c8ae..154c30bf71 100644 --- a/lib/services/websiteManagement2/lib/models/site.js +++ b/lib/services/websiteManagement2/lib/models/site.js @@ -42,6 +42,7 @@ class Site extends models['Resource'] { * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". * @member {boolean} [reserved] true if reserved; otherwise, * false. Default value: false . + * @member {boolean} [isXenon] 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. @@ -53,6 +54,8 @@ class Site extends models['Resource'] { * @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 @@ -179,6 +182,10 @@ class Site extends models['Resource'] { * @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 @@ -186,6 +193,11 @@ class Site extends models['Resource'] { * @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 @@ -257,31 +269,6 @@ class Site extends models['Resource'] { * @member {string} [cloningInfo.trafficManagerProfileName] Name of Traffic * Manager profile to create. This is only needed if Traffic Manager profile * does not already exist. - * @member {boolean} [cloningInfo.ignoreQuotas] true if quotas - * should be ignored; otherwise, false. - * @member {object} [snapshotInfo] If specified during app creation, the app - * is created from a previous snapshot. - * @member {string} [snapshotInfo.snapshotTime] Point in time in which the - * app recovery should be attempted, formatted as a DateTime string. - * @member {object} [snapshotInfo.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * @member {string} [snapshotInfo.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * @member {string} [snapshotInfo.recoveryTarget.id] ARM resource ID of the - * target 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} [snapshotInfo.overwrite] If true the - * recovery operation can overwrite source app; otherwise, - * false. - * @member {boolean} [snapshotInfo.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * @member {boolean} [snapshotInfo.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. * @member {string} [resourceGroup] Name of the resource group the app * belongs to. Read-only. * @member {boolean} [isDefaultContainer] true if the app is a @@ -300,10 +287,12 @@ class Site extends models['Resource'] { * http requests * @member {object} [identity] * @member {string} [identity.type] Type of managed service identity. - * Possible values include: 'SystemAssigned' + * 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(); @@ -476,6 +465,14 @@ class Site extends models['Resource'] { name: 'Boolean' } }, + isXenon: { + required: false, + serializedName: 'properties.isXenon', + defaultValue: false, + type: { + name: 'Boolean' + } + }, lastModifiedTimeUtc: { required: false, readOnly: true, @@ -606,14 +603,6 @@ class Site extends models['Resource'] { className: 'CloningInfo' } }, - snapshotInfo: { - required: false, - serializedName: 'properties.snapshotInfo', - type: { - name: 'Composite', - className: 'SnapshotRecoveryRequest' - } - }, resourceGroup: { required: false, readOnly: true, diff --git a/lib/services/websiteManagement2/lib/models/siteAuthSettings.js b/lib/services/websiteManagement2/lib/models/siteAuthSettings.js index 977f86f4dc..f35b25393d 100644 --- a/lib/services/websiteManagement2/lib/models/siteAuthSettings.js +++ b/lib/services/websiteManagement2/lib/models/siteAuthSettings.js @@ -74,6 +74,8 @@ class SiteAuthSettings extends models['ProxyOnlyResource'] { * 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 @@ -266,6 +268,13 @@ class SiteAuthSettings extends models['ProxyOnlyResource'] { name: 'String' } }, + validateIssuer: { + required: false, + serializedName: 'properties.validateIssuer', + type: { + name: 'Boolean' + } + }, allowedAudiences: { required: false, serializedName: 'properties.allowedAudiences', diff --git a/lib/services/websiteManagement2/lib/models/siteConfig.js b/lib/services/websiteManagement2/lib/models/siteConfig.js index 6dd3a24a75..9d2438791d 100644 --- a/lib/services/websiteManagement2/lib/models/siteConfig.js +++ b/lib/services/websiteManagement2/lib/models/siteConfig.js @@ -27,6 +27,7 @@ class SiteConfig { * @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 @@ -140,12 +141,19 @@ class SiteConfig { * @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() { } @@ -221,6 +229,13 @@ class SiteConfig { name: 'String' } }, + windowsFxVersion: { + required: false, + serializedName: 'windowsFxVersion', + type: { + name: 'String' + } + }, requestTracingEnabled: { required: false, serializedName: 'requestTracingEnabled', @@ -509,6 +524,20 @@ class SiteConfig { name: 'Boolean' } }, + managedServiceIdentityId: { + required: false, + serializedName: 'managedServiceIdentityId', + type: { + name: 'Number' + } + }, + xManagedServiceIdentityId: { + required: false, + serializedName: 'xManagedServiceIdentityId', + type: { + name: 'Number' + } + }, ipSecurityRestrictions: { required: false, serializedName: 'ipSecurityRestrictions', @@ -538,6 +567,24 @@ class SiteConfig { type: { name: 'String' } + }, + ftpsState: { + required: false, + serializedName: 'ftpsState', + type: { + name: 'String' + } + }, + reservedInstanceCount: { + required: false, + serializedName: 'reservedInstanceCount', + constraints: { + InclusiveMaximum: 10, + InclusiveMinimum: 0 + }, + type: { + name: 'Number' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/siteConfigResource.js b/lib/services/websiteManagement2/lib/models/siteConfigResource.js index 247ba84dc6..c4f86d257f 100644 --- a/lib/services/websiteManagement2/lib/models/siteConfigResource.js +++ b/lib/services/websiteManagement2/lib/models/siteConfigResource.js @@ -28,6 +28,7 @@ class SiteConfigResource extends models['ProxyOnlyResource'] { * @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 @@ -141,12 +142,19 @@ class SiteConfigResource extends models['ProxyOnlyResource'] { * @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(); @@ -254,6 +262,13 @@ class SiteConfigResource extends models['ProxyOnlyResource'] { name: 'String' } }, + windowsFxVersion: { + required: false, + serializedName: 'properties.windowsFxVersion', + type: { + name: 'String' + } + }, requestTracingEnabled: { required: false, serializedName: 'properties.requestTracingEnabled', @@ -542,6 +557,20 @@ class SiteConfigResource extends models['ProxyOnlyResource'] { 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', @@ -571,6 +600,24 @@ class SiteConfigResource extends models['ProxyOnlyResource'] { 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' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/siteConfigurationSnapshotInfo.js b/lib/services/websiteManagement2/lib/models/siteConfigurationSnapshotInfo.js index ab201777eb..1317cb4e81 100644 --- a/lib/services/websiteManagement2/lib/models/siteConfigurationSnapshotInfo.js +++ b/lib/services/websiteManagement2/lib/models/siteConfigurationSnapshotInfo.js @@ -21,7 +21,7 @@ class SiteConfigurationSnapshotInfo extends models['ProxyOnlyResource'] { /** * Create a SiteConfigurationSnapshotInfo. * @member {date} [time] The time the snapshot was taken. - * @member {number} [siteConfigurationSnapshotInfoId] The id of the snapshot + * @member {number} [snapshotId] The id of the snapshot */ constructor() { super(); @@ -80,10 +80,10 @@ class SiteConfigurationSnapshotInfo extends models['ProxyOnlyResource'] { name: 'DateTime' } }, - siteConfigurationSnapshotInfoId: { + snapshotId: { required: false, readOnly: true, - serializedName: 'properties.id', + serializedName: 'properties.snapshotId', type: { name: 'Number' } diff --git a/lib/services/websiteManagement2/lib/models/siteExtensionInfo.js b/lib/services/websiteManagement2/lib/models/siteExtensionInfo.js index 8cd1cf009f..a0293ee225 100644 --- a/lib/services/websiteManagement2/lib/models/siteExtensionInfo.js +++ b/lib/services/websiteManagement2/lib/models/siteExtensionInfo.js @@ -20,10 +20,10 @@ const models = require('./index'); class SiteExtensionInfo extends models['ProxyOnlyResource'] { /** * Create a SiteExtensionInfo. - * @member {string} [siteExtensionInfoId] Site extension ID. - * @member {string} [title] Site extension title. - * @member {string} [siteExtensionInfoType] Site extension type. Possible - * values include: 'Gallery', 'WebRoot' + * @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. @@ -33,7 +33,8 @@ class SiteExtensionInfo extends models['ProxyOnlyResource'] { * @member {string} [licenseUrl] License URL. * @member {string} [feedUrl] Feed URL. * @member {array} [authors] List of authors. - * @member {string} [installationArgs] Installer command line parameters. + * @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 @@ -92,9 +93,9 @@ class SiteExtensionInfo extends models['ProxyOnlyResource'] { name: 'String' } }, - siteExtensionInfoId: { + extensionId: { required: false, - serializedName: 'properties.id', + serializedName: 'properties.extension_id', type: { name: 'String' } @@ -106,9 +107,9 @@ class SiteExtensionInfo extends models['ProxyOnlyResource'] { name: 'String' } }, - siteExtensionInfoType: { + extensionType: { required: false, - serializedName: 'properties.type', + serializedName: 'properties.extension_type', type: { name: 'Enum', allowedValues: [ 'Gallery', 'WebRoot' ] @@ -137,35 +138,35 @@ class SiteExtensionInfo extends models['ProxyOnlyResource'] { }, extensionUrl: { required: false, - serializedName: 'properties.extensionUrl', + serializedName: 'properties.extension_url', type: { name: 'String' } }, projectUrl: { required: false, - serializedName: 'properties.projectUrl', + serializedName: 'properties.project_url', type: { name: 'String' } }, iconUrl: { required: false, - serializedName: 'properties.iconUrl', + serializedName: 'properties.icon_url', type: { name: 'String' } }, licenseUrl: { required: false, - serializedName: 'properties.licenseUrl', + serializedName: 'properties.license_url', type: { name: 'String' } }, feedUrl: { required: false, - serializedName: 'properties.feedUrl', + serializedName: 'properties.feed_url', type: { name: 'String' } @@ -184,44 +185,44 @@ class SiteExtensionInfo extends models['ProxyOnlyResource'] { } } }, - installationArgs: { + installerCommandLineParams: { required: false, - serializedName: 'properties.installationArgs', + serializedName: 'properties.installer_command_line_params', type: { name: 'String' } }, publishedDateTime: { required: false, - serializedName: 'properties.publishedDateTime', + serializedName: 'properties.published_date_time', type: { name: 'DateTime' } }, downloadCount: { required: false, - serializedName: 'properties.downloadCount', + serializedName: 'properties.download_count', type: { name: 'Number' } }, localIsLatestVersion: { required: false, - serializedName: 'properties.localIsLatestVersion', + serializedName: 'properties.local_is_latest_version', type: { name: 'Boolean' } }, localPath: { required: false, - serializedName: 'properties.localPath', + serializedName: 'properties.local_path', type: { name: 'String' } }, installedDateTime: { required: false, - serializedName: 'properties.installedDateTime', + serializedName: 'properties.installed_date_time', type: { name: 'DateTime' } diff --git a/lib/services/websiteManagement2/lib/models/siteInstance.js b/lib/services/websiteManagement2/lib/models/siteInstance.js index 850f9772ca..72635c8844 100644 --- a/lib/services/websiteManagement2/lib/models/siteInstance.js +++ b/lib/services/websiteManagement2/lib/models/siteInstance.js @@ -74,7 +74,7 @@ class SiteInstance extends models['ProxyOnlyResource'] { siteInstanceName: { required: false, readOnly: true, - serializedName: 'properties.name', + serializedName: 'properties.siteInstanceName', type: { name: 'String' } diff --git a/lib/services/websiteManagement2/lib/models/sitePatchResource.js b/lib/services/websiteManagement2/lib/models/sitePatchResource.js index 91322a206d..575bc5a043 100644 --- a/lib/services/websiteManagement2/lib/models/sitePatchResource.js +++ b/lib/services/websiteManagement2/lib/models/sitePatchResource.js @@ -42,6 +42,7 @@ class SitePatchResource extends models['ProxyOnlyResource'] { * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". * @member {boolean} [reserved] true if reserved; otherwise, * false. Default value: false . + * @member {boolean} [isXenon] 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. @@ -53,6 +54,8 @@ class SitePatchResource extends models['ProxyOnlyResource'] { * @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 @@ -179,6 +182,10 @@ class SitePatchResource extends models['ProxyOnlyResource'] { * @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 @@ -186,6 +193,11 @@ class SitePatchResource extends models['ProxyOnlyResource'] { * @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 @@ -257,31 +269,6 @@ class SitePatchResource extends models['ProxyOnlyResource'] { * @member {string} [cloningInfo.trafficManagerProfileName] Name of Traffic * Manager profile to create. This is only needed if Traffic Manager profile * does not already exist. - * @member {boolean} [cloningInfo.ignoreQuotas] true if quotas - * should be ignored; otherwise, false. - * @member {object} [snapshotInfo] If specified during app creation, the app - * is created from a previous snapshot. - * @member {string} [snapshotInfo.snapshotTime] Point in time in which the - * app recovery should be attempted, formatted as a DateTime string. - * @member {object} [snapshotInfo.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * @member {string} [snapshotInfo.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * @member {string} [snapshotInfo.recoveryTarget.id] ARM resource ID of the - * target 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} [snapshotInfo.overwrite] If true the - * recovery operation can overwrite source app; otherwise, - * false. - * @member {boolean} [snapshotInfo.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * @member {boolean} [snapshotInfo.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. * @member {string} [resourceGroup] Name of the resource group the app * belongs to. Read-only. * @member {boolean} [isDefaultContainer] true if the app is a @@ -449,6 +436,14 @@ class SitePatchResource extends models['ProxyOnlyResource'] { name: 'Boolean' } }, + isXenon: { + required: false, + serializedName: 'properties.isXenon', + defaultValue: false, + type: { + name: 'Boolean' + } + }, lastModifiedTimeUtc: { required: false, readOnly: true, @@ -579,14 +574,6 @@ class SitePatchResource extends models['ProxyOnlyResource'] { className: 'CloningInfo' } }, - snapshotInfo: { - required: false, - serializedName: 'properties.snapshotInfo', - type: { - name: 'Composite', - className: 'SnapshotRecoveryRequest' - } - }, resourceGroup: { required: false, readOnly: true, diff --git a/lib/services/websiteManagement2/lib/models/slotDifference.js b/lib/services/websiteManagement2/lib/models/slotDifference.js index f20bdff1da..49d154fc4c 100644 --- a/lib/services/websiteManagement2/lib/models/slotDifference.js +++ b/lib/services/websiteManagement2/lib/models/slotDifference.js @@ -20,8 +20,8 @@ const models = require('./index'); class SlotDifference extends models['ProxyOnlyResource'] { /** * Create a SlotDifference. - * @member {string} [slotDifferenceType] Type of the difference: Information, - * Warning or Error. + * @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 @@ -82,10 +82,10 @@ class SlotDifference extends models['ProxyOnlyResource'] { name: 'String' } }, - slotDifferenceType: { + level: { required: false, readOnly: true, - serializedName: 'properties.type', + serializedName: 'properties.level', type: { name: 'String' } 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/sourceControl.js b/lib/services/websiteManagement2/lib/models/sourceControl.js index 0c0d72a318..3e7a294e88 100644 --- a/lib/services/websiteManagement2/lib/models/sourceControl.js +++ b/lib/services/websiteManagement2/lib/models/sourceControl.js @@ -20,7 +20,6 @@ const models = require('./index'); class SourceControl extends models['ProxyOnlyResource'] { /** * Create a SourceControl. - * @member {string} [sourceControlName] Name or source control type. * @member {string} [token] OAuth access token. * @member {string} [tokenSecret] OAuth access token secret. * @member {string} [refreshToken] OAuth refresh token. @@ -75,13 +74,6 @@ class SourceControl extends models['ProxyOnlyResource'] { name: 'String' } }, - sourceControlName: { - required: false, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, token: { required: false, serializedName: 'properties.token', diff --git a/lib/services/websiteManagement2/lib/models/stampCapacity.js b/lib/services/websiteManagement2/lib/models/stampCapacity.js index 8cb844d445..9227735918 100644 --- a/lib/services/websiteManagement2/lib/models/stampCapacity.js +++ b/lib/services/websiteManagement2/lib/models/stampCapacity.js @@ -26,7 +26,7 @@ class StampCapacity { * @member {string} [computeMode] Shared/dedicated workers. Possible values * include: 'Shared', 'Dedicated', 'Dynamic' * @member {string} [workerSize] Size of the machines. Possible values - * include: 'Default', 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3' + * include: 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', 'Default' * @member {number} [workerSizeId] Size ID of machines: * 0 - Small * 1 - Medium @@ -37,6 +37,7 @@ class StampCapacity { * @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() { } @@ -96,7 +97,7 @@ class StampCapacity { serializedName: 'workerSize', type: { name: 'Enum', - allowedValues: [ 'Default', 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3' ] + allowedValues: [ 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', 'Default' ] } }, workerSizeId: { @@ -126,6 +127,13 @@ class StampCapacity { type: { name: 'String' } + }, + isLinux: { + required: false, + serializedName: 'isLinux', + type: { + name: 'Boolean' + } } } } 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/topLevelDomain.js b/lib/services/websiteManagement2/lib/models/topLevelDomain.js index 76d8577eaf..d5e0a3c95c 100644 --- a/lib/services/websiteManagement2/lib/models/topLevelDomain.js +++ b/lib/services/websiteManagement2/lib/models/topLevelDomain.js @@ -20,7 +20,6 @@ const models = require('./index'); class TopLevelDomain extends models['ProxyOnlyResource'] { /** * Create a TopLevelDomain. - * @member {string} [domainName] Name of the top level domain. * @member {boolean} [privacy] If true, then the top level * domain supports domain privacy; otherwise, false. */ @@ -73,14 +72,6 @@ class TopLevelDomain extends models['ProxyOnlyResource'] { name: 'String' } }, - domainName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, privacy: { required: false, serializedName: 'properties.privacy', diff --git a/lib/services/websiteManagement2/lib/models/triggeredJobHistory.js b/lib/services/websiteManagement2/lib/models/triggeredJobHistory.js index dda09c1cae..7623db0417 100644 --- a/lib/services/websiteManagement2/lib/models/triggeredJobHistory.js +++ b/lib/services/websiteManagement2/lib/models/triggeredJobHistory.js @@ -21,7 +21,7 @@ const models = require('./index'); class TriggeredJobHistory extends models['ProxyOnlyResource'] { /** * Create a TriggeredJobHistory. - * @member {array} [triggeredJobRuns] List of triggered web job runs. + * @member {array} [runs] List of triggered web job runs. */ constructor() { super(); @@ -72,9 +72,9 @@ class TriggeredJobHistory extends models['ProxyOnlyResource'] { name: 'String' } }, - triggeredJobRuns: { + runs: { required: false, - serializedName: 'properties.triggeredJobRuns', + serializedName: 'properties.runs', type: { name: 'Sequence', element: { diff --git a/lib/services/websiteManagement2/lib/models/triggeredJobRun.js b/lib/services/websiteManagement2/lib/models/triggeredJobRun.js index dafb649e30..ef4774b6e4 100644 --- a/lib/services/websiteManagement2/lib/models/triggeredJobRun.js +++ b/lib/services/websiteManagement2/lib/models/triggeredJobRun.js @@ -20,8 +20,8 @@ const models = require('./index'); class TriggeredJobRun extends models['ProxyOnlyResource'] { /** * Create a TriggeredJobRun. - * @member {string} [triggeredJobRunId] Job ID. - * @member {string} [triggeredJobRunName] Job name. + * @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. @@ -82,17 +82,16 @@ class TriggeredJobRun extends models['ProxyOnlyResource'] { name: 'String' } }, - triggeredJobRunId: { + webJobId: { required: false, - serializedName: 'properties.id', + serializedName: 'properties.web_job_id', type: { name: 'String' } }, - triggeredJobRunName: { + webJobName: { required: false, - readOnly: true, - serializedName: 'properties.name', + serializedName: 'properties.web_job_name', type: { name: 'String' } @@ -107,14 +106,14 @@ class TriggeredJobRun extends models['ProxyOnlyResource'] { }, startTime: { required: false, - serializedName: 'properties.startTime', + serializedName: 'properties.start_time', type: { name: 'DateTime' } }, endTime: { required: false, - serializedName: 'properties.endTime', + serializedName: 'properties.end_time', type: { name: 'DateTime' } @@ -128,14 +127,14 @@ class TriggeredJobRun extends models['ProxyOnlyResource'] { }, outputUrl: { required: false, - serializedName: 'properties.outputUrl', + serializedName: 'properties.output_url', type: { name: 'String' } }, errorUrl: { required: false, - serializedName: 'properties.errorUrl', + serializedName: 'properties.error_url', type: { name: 'String' } @@ -149,7 +148,7 @@ class TriggeredJobRun extends models['ProxyOnlyResource'] { }, jobName: { required: false, - serializedName: 'properties.jobName', + serializedName: 'properties.job_name', type: { name: 'String' } diff --git a/lib/services/websiteManagement2/lib/models/triggeredWebJob.js b/lib/services/websiteManagement2/lib/models/triggeredWebJob.js index 076ffffe05..b062eb3eb4 100644 --- a/lib/services/websiteManagement2/lib/models/triggeredWebJob.js +++ b/lib/services/websiteManagement2/lib/models/triggeredWebJob.js @@ -21,8 +21,8 @@ class TriggeredWebJob extends models['ProxyOnlyResource'] { /** * Create a TriggeredWebJob. * @member {object} [latestRun] Latest job run information. - * @member {string} [latestRun.triggeredJobRunId] Job ID. - * @member {string} [latestRun.triggeredJobRunName] Job name. + * @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. @@ -35,12 +35,10 @@ class TriggeredWebJob extends models['ProxyOnlyResource'] { * @member {string} [latestRun.trigger] Job trigger. * @member {string} [historyUrl] History URL. * @member {string} [schedulerLogsUrl] Scheduler Logs URL. - * @member {string} [triggeredWebJobName] Job name. Used as job identifier in - * ARM resource URI. * @member {string} [runCommand] Run command. * @member {string} [url] Job URL. * @member {string} [extraInfoUrl] Extra Info URL. - * @member {string} [jobType] Job type. Possible values include: + * @member {string} [webJobType] Job type. Possible values include: * 'Continuous', 'Triggered' * @member {string} [error] Error information. * @member {boolean} [usingSdk] Using SDK? @@ -97,7 +95,7 @@ class TriggeredWebJob extends models['ProxyOnlyResource'] { }, latestRun: { required: false, - serializedName: 'properties.latestRun', + serializedName: 'properties.latest_run', type: { name: 'Composite', className: 'TriggeredJobRun' @@ -105,29 +103,21 @@ class TriggeredWebJob extends models['ProxyOnlyResource'] { }, historyUrl: { required: false, - serializedName: 'properties.historyUrl', + serializedName: 'properties.history_url', type: { name: 'String' } }, schedulerLogsUrl: { required: false, - serializedName: 'properties.schedulerLogsUrl', - type: { - name: 'String' - } - }, - triggeredWebJobName: { - required: false, - readOnly: true, - serializedName: 'properties.name', + serializedName: 'properties.scheduler_logs_url', type: { name: 'String' } }, runCommand: { required: false, - serializedName: 'properties.runCommand', + serializedName: 'properties.run_command', type: { name: 'String' } @@ -141,14 +131,14 @@ class TriggeredWebJob extends models['ProxyOnlyResource'] { }, extraInfoUrl: { required: false, - serializedName: 'properties.extraInfoUrl', + serializedName: 'properties.extra_info_url', type: { name: 'String' } }, - jobType: { + webJobType: { required: false, - serializedName: 'properties.jobType', + serializedName: 'properties.web_job_type', type: { name: 'Enum', allowedValues: [ 'Continuous', 'Triggered' ] @@ -163,7 +153,7 @@ class TriggeredWebJob extends models['ProxyOnlyResource'] { }, usingSdk: { required: false, - serializedName: 'properties.usingSdk', + serializedName: 'properties.using_sdk', type: { name: 'Boolean' } diff --git a/lib/services/websiteManagement2/lib/models/usage.js b/lib/services/websiteManagement2/lib/models/usage.js index a8bb508dd5..b030fdbfde 100644 --- a/lib/services/websiteManagement2/lib/models/usage.js +++ b/lib/services/websiteManagement2/lib/models/usage.js @@ -21,7 +21,6 @@ class Usage extends models['ProxyOnlyResource'] { /** * Create a Usage. * @member {string} [displayName] Friendly name shown in the UI. - * @member {string} [usageName] Name of the quota. * @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. @@ -88,14 +87,6 @@ class Usage extends models['ProxyOnlyResource'] { name: 'String' } }, - usageName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, resourceName: { required: false, readOnly: true, diff --git a/lib/services/websiteManagement2/lib/models/user.js b/lib/services/websiteManagement2/lib/models/user.js index 8f3d0fbad6..ec8071fce3 100644 --- a/lib/services/websiteManagement2/lib/models/user.js +++ b/lib/services/websiteManagement2/lib/models/user.js @@ -20,13 +20,13 @@ const models = require('./index'); class User extends models['ProxyOnlyResource'] { /** * Create a User. - * @member {string} [userName] Username * @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(); @@ -77,13 +77,6 @@ class User extends models['ProxyOnlyResource'] { name: 'String' } }, - userName: { - required: false, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, publishingUserName: { required: true, serializedName: 'properties.publishingUserName', @@ -111,6 +104,13 @@ class User extends models['ProxyOnlyResource'] { type: { name: 'String' } + }, + scmUri: { + required: false, + serializedName: 'properties.scmUri', + type: { + name: 'String' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/validateRequest.js b/lib/services/websiteManagement2/lib/models/validateRequest.js index 479983a00f..3ca18ee528 100644 --- a/lib/services/websiteManagement2/lib/models/validateRequest.js +++ b/lib/services/websiteManagement2/lib/models/validateRequest.js @@ -33,6 +33,8 @@ class ValidateRequest { * (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() { } @@ -116,6 +118,13 @@ class ValidateRequest { type: { name: 'String' } + }, + isXenon: { + required: false, + serializedName: 'properties.isXenon', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/vnetRoute.js b/lib/services/websiteManagement2/lib/models/vnetRoute.js index 5df4cf5959..5dfe8a762e 100644 --- a/lib/services/websiteManagement2/lib/models/vnetRoute.js +++ b/lib/services/websiteManagement2/lib/models/vnetRoute.js @@ -21,8 +21,6 @@ const models = require('./index'); class VnetRoute extends models['ProxyOnlyResource'] { /** * Create a VnetRoute. - * @member {string} [vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. * @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. @@ -86,13 +84,6 @@ class VnetRoute extends models['ProxyOnlyResource'] { name: 'String' } }, - vnetRouteName: { - required: false, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, startAddress: { required: false, serializedName: 'properties.startAddress', diff --git a/lib/services/websiteManagement2/lib/models/webJob.js b/lib/services/websiteManagement2/lib/models/webJob.js index 8f2ed44730..071625ad9b 100644 --- a/lib/services/websiteManagement2/lib/models/webJob.js +++ b/lib/services/websiteManagement2/lib/models/webJob.js @@ -20,12 +20,10 @@ const models = require('./index'); class WebJob extends models['ProxyOnlyResource'] { /** * Create a WebJob. - * @member {string} [webJobName] Job name. Used as job identifier in ARM - * resource URI. * @member {string} [runCommand] Run command. * @member {string} [url] Job URL. * @member {string} [extraInfoUrl] Extra Info URL. - * @member {string} [jobType] Job type. Possible values include: + * @member {string} [webJobType] Job type. Possible values include: * 'Continuous', 'Triggered' * @member {string} [error] Error information. * @member {boolean} [usingSdk] Using SDK? @@ -80,17 +78,9 @@ class WebJob extends models['ProxyOnlyResource'] { name: 'String' } }, - webJobName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, runCommand: { required: false, - serializedName: 'properties.runCommand', + serializedName: 'properties.run_command', type: { name: 'String' } @@ -104,14 +94,14 @@ class WebJob extends models['ProxyOnlyResource'] { }, extraInfoUrl: { required: false, - serializedName: 'properties.extraInfoUrl', + serializedName: 'properties.extra_info_url', type: { name: 'String' } }, - jobType: { + webJobType: { required: false, - serializedName: 'properties.jobType', + serializedName: 'properties.web_job_type', type: { name: 'Enum', allowedValues: [ 'Continuous', 'Triggered' ] @@ -126,7 +116,7 @@ class WebJob extends models['ProxyOnlyResource'] { }, usingSdk: { required: false, - serializedName: 'properties.usingSdk', + serializedName: 'properties.using_sdk', type: { name: 'Boolean' } diff --git a/lib/services/websiteManagement2/lib/operations/appServiceCertificateOrders.js b/lib/services/websiteManagement2/lib/operations/appServiceCertificateOrders.js index 66ac67f507..c61d1b4c3d 100644 --- a/lib/services/websiteManagement2/lib/operations/appServiceCertificateOrders.js +++ b/lib/services/websiteManagement2/lib/operations/appServiceCertificateOrders.js @@ -48,12 +48,14 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -66,7 +68,7 @@ function _list(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -108,12 +110,13 @@ function _list(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -211,7 +214,6 @@ function _validatePurchaseInformation(appServiceCertificateOrder, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (appServiceCertificateOrder === null || appServiceCertificateOrder === undefined) { @@ -220,6 +222,9 @@ function _validatePurchaseInformation(appServiceCertificateOrder, options, callb if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -232,7 +237,7 @@ function _validatePurchaseInformation(appServiceCertificateOrder, options, callb 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -348,7 +353,6 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -371,6 +375,9 @@ function _listByResourceGroup(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -384,7 +391,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('&'); } @@ -426,12 +433,13 @@ function _listByResourceGroup(resourceGroupName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -505,7 +513,6 @@ function _get(resourceGroupName, certificateOrderName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -531,6 +538,9 @@ function _get(resourceGroupName, certificateOrderName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -545,7 +555,7 @@ function _get(resourceGroupName, certificateOrderName, options, callback) { requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); 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('&'); } @@ -587,12 +597,13 @@ function _get(resourceGroupName, certificateOrderName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -777,7 +788,6 @@ function _deleteMethod(resourceGroupName, certificateOrderName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -803,6 +813,9 @@ function _deleteMethod(resourceGroupName, certificateOrderName, options, callbac if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -817,7 +830,7 @@ function _deleteMethod(resourceGroupName, certificateOrderName, options, callbac requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); 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('&'); } @@ -948,7 +961,6 @@ function _update(resourceGroupName, certificateOrderName, certificateDistinguish if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -977,6 +989,9 @@ function _update(resourceGroupName, certificateOrderName, certificateDistinguish if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -991,7 +1006,7 @@ function _update(resourceGroupName, certificateOrderName, certificateDistinguish requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); 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('&'); } @@ -1047,12 +1062,13 @@ function _update(resourceGroupName, certificateOrderName, certificateDistinguish try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1143,7 +1159,6 @@ function _listCertificates(resourceGroupName, certificateOrderName, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1169,6 +1184,9 @@ function _listCertificates(resourceGroupName, certificateOrderName, options, cal if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1183,7 +1201,7 @@ function _listCertificates(resourceGroupName, certificateOrderName, options, cal requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); 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('&'); } @@ -1225,12 +1243,13 @@ function _listCertificates(resourceGroupName, certificateOrderName, options, cal try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1306,7 +1325,6 @@ function _getCertificate(resourceGroupName, certificateOrderName, name, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1335,6 +1353,9 @@ function _getCertificate(resourceGroupName, certificateOrderName, name, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1350,7 +1371,7 @@ function _getCertificate(resourceGroupName, certificateOrderName, name, options, requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1392,12 +1413,13 @@ function _getCertificate(resourceGroupName, certificateOrderName, name, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1569,7 +1591,6 @@ function _deleteCertificate(resourceGroupName, certificateOrderName, name, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1598,6 +1619,9 @@ function _deleteCertificate(resourceGroupName, certificateOrderName, name, optio if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1613,7 +1637,7 @@ function _deleteCertificate(resourceGroupName, certificateOrderName, name, optio requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1729,7 +1753,6 @@ function _updateCertificate(resourceGroupName, certificateOrderName, name, keyVa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1761,6 +1784,9 @@ function _updateCertificate(resourceGroupName, certificateOrderName, name, keyVa if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1776,7 +1802,7 @@ function _updateCertificate(resourceGroupName, certificateOrderName, name, keyVa requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1832,12 +1858,13 @@ function _updateCertificate(resourceGroupName, certificateOrderName, name, keyVa try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1944,7 +1971,6 @@ function _reissue(resourceGroupName, certificateOrderName, reissueCertificateOrd if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1973,6 +1999,9 @@ function _reissue(resourceGroupName, certificateOrderName, reissueCertificateOrd if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1987,7 +2016,7 @@ function _reissue(resourceGroupName, certificateOrderName, reissueCertificateOrd requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); 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('&'); } @@ -2116,7 +2145,6 @@ function _renew(resourceGroupName, certificateOrderName, renewCertificateOrderRe if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2145,6 +2173,9 @@ function _renew(resourceGroupName, certificateOrderName, renewCertificateOrderRe if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2159,7 +2190,7 @@ function _renew(resourceGroupName, certificateOrderName, renewCertificateOrderRe requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); 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('&'); } @@ -2275,7 +2306,6 @@ function _resendEmail(resourceGroupName, certificateOrderName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2301,6 +2331,9 @@ function _resendEmail(resourceGroupName, certificateOrderName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2315,7 +2348,7 @@ function _resendEmail(resourceGroupName, certificateOrderName, options, callback requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); 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('&'); } @@ -2420,7 +2453,6 @@ function _resendRequestEmails(resourceGroupName, certificateOrderName, options, throw new Error('callback cannot be null.'); } let name = (options && options.name !== undefined) ? options.name : undefined; - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2446,6 +2478,9 @@ function _resendRequestEmails(resourceGroupName, certificateOrderName, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof 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.'); } @@ -2468,7 +2503,7 @@ function _resendRequestEmails(resourceGroupName, certificateOrderName, options, requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); 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('&'); } @@ -2592,7 +2627,6 @@ function _retrieveSiteSeal(resourceGroupName, certificateOrderName, siteSealRequ if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2621,6 +2655,9 @@ function _retrieveSiteSeal(resourceGroupName, certificateOrderName, siteSealRequ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2635,7 +2672,7 @@ function _retrieveSiteSeal(resourceGroupName, certificateOrderName, siteSealRequ requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); 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('&'); } @@ -2691,12 +2728,13 @@ function _retrieveSiteSeal(resourceGroupName, certificateOrderName, siteSealRequ try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2768,7 +2806,6 @@ function _verifyDomainOwnership(resourceGroupName, certificateOrderName, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2794,6 +2831,9 @@ function _verifyDomainOwnership(resourceGroupName, certificateOrderName, options if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2808,7 +2848,7 @@ function _verifyDomainOwnership(resourceGroupName, certificateOrderName, options requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); 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('&'); } @@ -2910,7 +2950,6 @@ function _retrieveCertificateActions(resourceGroupName, name, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2936,6 +2975,9 @@ function _retrieveCertificateActions(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2950,7 +2992,7 @@ function _retrieveCertificateActions(resourceGroupName, name, options, callback) requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -2992,12 +3034,13 @@ function _retrieveCertificateActions(resourceGroupName, name, options, callback) try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3083,7 +3126,6 @@ function _retrieveCertificateEmailHistory(resourceGroupName, name, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3109,6 +3151,9 @@ function _retrieveCertificateEmailHistory(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3123,7 +3168,7 @@ function _retrieveCertificateEmailHistory(resourceGroupName, name, options, call requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -3165,12 +3210,13 @@ function _retrieveCertificateEmailHistory(resourceGroupName, name, options, call try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3289,7 +3335,6 @@ function _beginCreateOrUpdate(resourceGroupName, certificateOrderName, certifica if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3318,6 +3363,9 @@ function _beginCreateOrUpdate(resourceGroupName, certificateOrderName, certifica if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3332,7 +3380,7 @@ function _beginCreateOrUpdate(resourceGroupName, certificateOrderName, certifica requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); 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('&'); } @@ -3388,12 +3436,13 @@ function _beginCreateOrUpdate(resourceGroupName, certificateOrderName, certifica try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3500,7 +3549,6 @@ function _beginCreateOrUpdateCertificate(resourceGroupName, certificateOrderName if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3532,6 +3580,9 @@ function _beginCreateOrUpdateCertificate(resourceGroupName, certificateOrderName if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3547,7 +3598,7 @@ function _beginCreateOrUpdateCertificate(resourceGroupName, certificateOrderName requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -3603,12 +3654,13 @@ function _beginCreateOrUpdateCertificate(resourceGroupName, certificateOrderName try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3750,12 +3802,13 @@ function _listNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3880,12 +3933,13 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4010,12 +4064,13 @@ function _listCertificatesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { diff --git a/lib/services/websiteManagement2/lib/operations/appServiceEnvironments.js b/lib/services/websiteManagement2/lib/operations/appServiceEnvironments.js index ad008a5ab6..4e8dcefbed 100644 --- a/lib/services/websiteManagement2/lib/operations/appServiceEnvironments.js +++ b/lib/services/websiteManagement2/lib/operations/appServiceEnvironments.js @@ -48,12 +48,14 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -66,7 +68,7 @@ function _list(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -108,12 +110,13 @@ function _list(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -185,7 +188,6 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -208,6 +210,9 @@ function _listByResourceGroup(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -221,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('&'); } @@ -263,12 +268,13 @@ function _listByResourceGroup(resourceGroupName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -342,7 +348,6 @@ function _get(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -368,6 +373,9 @@ function _get(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -382,7 +390,7 @@ function _get(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -424,12 +432,13 @@ function _get(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -549,6 +558,15 @@ function _get(resourceGroupName, name, options, callback) { * @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. @@ -780,6 +798,15 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * @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. @@ -811,7 +838,6 @@ function _update(resourceGroupName, name, hostingEnvironmentEnvelope, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -840,6 +866,9 @@ function _update(resourceGroupName, name, hostingEnvironmentEnvelope, options, c if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -854,7 +883,7 @@ function _update(resourceGroupName, name, hostingEnvironmentEnvelope, options, c requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1008,7 +1037,6 @@ function _listCapacities(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1034,6 +1062,9 @@ function _listCapacities(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1048,7 +1079,7 @@ function _listCapacities(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1090,12 +1121,13 @@ function _listCapacities(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1168,7 +1200,6 @@ function _listVips(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1194,6 +1225,9 @@ function _listVips(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1208,7 +1242,7 @@ function _listVips(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1250,12 +1284,13 @@ function _listVips(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1290,6 +1325,93 @@ function _listVips(resourceGroupName, name, options, callback) { }); } + +/** + * @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. * @@ -1327,7 +1449,6 @@ function _listDiagnostics(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1353,6 +1474,9 @@ function _listDiagnostics(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1367,7 +1491,7 @@ function _listDiagnostics(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1409,12 +1533,13 @@ function _listDiagnostics(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1504,7 +1629,6 @@ function _getDiagnosticsItem(resourceGroupName, name, diagnosticsName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1533,6 +1657,9 @@ function _getDiagnosticsItem(resourceGroupName, name, diagnosticsName, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1548,7 +1675,7 @@ function _getDiagnosticsItem(resourceGroupName, name, diagnosticsName, options, requestUrl = requestUrl.replace('{diagnosticsName}', encodeURIComponent(diagnosticsName)); 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('&'); } @@ -1590,12 +1717,13 @@ function _getDiagnosticsItem(resourceGroupName, name, diagnosticsName, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1668,7 +1796,6 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1694,6 +1821,9 @@ function _listMetricDefinitions(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1708,7 +1838,7 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1750,12 +1880,13 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1840,7 +1971,6 @@ function _listMetrics(resourceGroupName, name, options, callback) { } let details = (options && options.details !== undefined) ? options.details : undefined; let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1872,6 +2002,9 @@ function _listMetrics(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1892,7 +2025,7 @@ function _listMetrics(resourceGroupName, name, 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('&'); } @@ -1934,12 +2067,13 @@ function _listMetrics(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2012,7 +2146,6 @@ function _listMultiRolePools(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2038,6 +2171,9 @@ function _listMultiRolePools(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2052,7 +2188,7 @@ function _listMultiRolePools(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -2094,12 +2230,13 @@ function _listMultiRolePools(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2172,7 +2309,6 @@ function _getMultiRolePool(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2198,6 +2334,9 @@ function _getMultiRolePool(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2212,7 +2351,7 @@ function _getMultiRolePool(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -2254,12 +2393,13 @@ function _getMultiRolePool(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2517,7 +2657,6 @@ function _updateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2546,6 +2685,9 @@ function _updateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, op if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2560,7 +2702,7 @@ function _updateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, op requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -2716,7 +2858,6 @@ function _listMultiRolePoolInstanceMetricDefinitions(resourceGroupName, name, in if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2745,6 +2886,9 @@ function _listMultiRolePoolInstanceMetricDefinitions(resourceGroupName, name, in if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2760,7 +2904,7 @@ function _listMultiRolePoolInstanceMetricDefinitions(resourceGroupName, name, in requestUrl = requestUrl.replace('{instance}', encodeURIComponent(instance)); 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('&'); } @@ -2802,12 +2946,13 @@ function _listMultiRolePoolInstanceMetricDefinitions(resourceGroupName, name, in try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2889,7 +3034,6 @@ function _listMultiRolePoolInstanceMetrics(resourceGroupName, name, instance, op throw new Error('callback cannot be null.'); } let details = (options && options.details !== undefined) ? options.details : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2921,6 +3065,9 @@ function _listMultiRolePoolInstanceMetrics(resourceGroupName, name, instance, op if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2939,7 +3086,7 @@ function _listMultiRolePoolInstanceMetrics(resourceGroupName, name, instance, op if (details !== null && details !== undefined) { queryParameters.push('details=' + encodeURIComponent(details.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2981,12 +3128,13 @@ function _listMultiRolePoolInstanceMetrics(resourceGroupName, name, instance, op try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3061,7 +3209,6 @@ function _listMultiRoleMetricDefinitions(resourceGroupName, name, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3087,6 +3234,9 @@ function _listMultiRoleMetricDefinitions(resourceGroupName, name, options, callb if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3101,7 +3251,7 @@ function _listMultiRoleMetricDefinitions(resourceGroupName, name, options, callb requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -3143,12 +3293,13 @@ function _listMultiRoleMetricDefinitions(resourceGroupName, name, options, callb try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3242,7 +3393,6 @@ function _listMultiRoleMetrics(resourceGroupName, name, options, callback) { 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; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3283,6 +3433,9 @@ function _listMultiRoleMetrics(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3312,7 +3465,7 @@ function _listMultiRoleMetrics(resourceGroupName, name, 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('&'); } @@ -3354,12 +3507,13 @@ function _listMultiRoleMetrics(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3432,7 +3586,6 @@ function _listMultiRolePoolSkus(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3458,6 +3611,9 @@ function _listMultiRolePoolSkus(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3472,7 +3628,7 @@ function _listMultiRolePoolSkus(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -3514,12 +3670,13 @@ function _listMultiRolePoolSkus(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3593,7 +3750,6 @@ function _listMultiRoleUsages(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3619,6 +3775,9 @@ function _listMultiRoleUsages(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3633,7 +3792,7 @@ function _listMultiRoleUsages(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -3675,12 +3834,13 @@ function _listMultiRoleUsages(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3753,7 +3913,6 @@ function _listOperations(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3779,6 +3938,9 @@ function _listOperations(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3793,7 +3955,7 @@ function _listOperations(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -3835,12 +3997,13 @@ function _listOperations(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3926,7 +4089,6 @@ function _reboot(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3952,6 +4114,9 @@ function _reboot(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3966,7 +4131,7 @@ function _reboot(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -4151,7 +4316,6 @@ function _listAppServicePlans(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4177,6 +4341,9 @@ function _listAppServicePlans(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4191,7 +4358,7 @@ function _listAppServicePlans(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -4233,12 +4400,13 @@ function _listAppServicePlans(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4315,7 +4483,6 @@ function _listWebApps(resourceGroupName, name, options, callback) { throw new Error('callback cannot be null.'); } let propertiesToInclude = (options && options.propertiesToInclude !== undefined) ? options.propertiesToInclude : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4344,6 +4511,9 @@ function _listWebApps(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4361,7 +4531,7 @@ function _listWebApps(resourceGroupName, name, options, callback) { if (propertiesToInclude !== null && propertiesToInclude !== undefined) { queryParameters.push('propertiesToInclude=' + encodeURIComponent(propertiesToInclude)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4403,12 +4573,13 @@ function _listWebApps(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4570,7 +4741,6 @@ function _listUsages(resourceGroupName, name, options, callback) { throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4599,6 +4769,9 @@ function _listUsages(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4616,7 +4789,7 @@ function _listUsages(resourceGroupName, name, 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('&'); } @@ -4658,12 +4831,13 @@ function _listUsages(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4736,7 +4910,6 @@ function _listWorkerPools(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4762,6 +4935,9 @@ function _listWorkerPools(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4776,7 +4952,7 @@ function _listWorkerPools(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -4818,12 +4994,13 @@ function _listWorkerPools(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4898,7 +5075,6 @@ function _getWorkerPool(resourceGroupName, name, workerPoolName, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4927,6 +5103,9 @@ function _getWorkerPool(resourceGroupName, name, workerPoolName, options, callba if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4942,7 +5121,7 @@ function _getWorkerPool(resourceGroupName, name, workerPoolName, options, callba requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); 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('&'); } @@ -4984,12 +5163,13 @@ function _getWorkerPool(resourceGroupName, name, workerPoolName, options, callba try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5251,7 +5431,6 @@ function _updateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEn if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5283,6 +5462,9 @@ function _updateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEn if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -5298,7 +5480,7 @@ function _updateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEn requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); 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('&'); } @@ -5456,7 +5638,6 @@ function _listWorkerPoolInstanceMetricDefinitions(resourceGroupName, name, worke if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5488,6 +5669,9 @@ function _listWorkerPoolInstanceMetricDefinitions(resourceGroupName, name, worke if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -5504,7 +5688,7 @@ function _listWorkerPoolInstanceMetricDefinitions(resourceGroupName, name, worke requestUrl = requestUrl.replace('{instance}', encodeURIComponent(instance)); 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('&'); } @@ -5546,12 +5730,13 @@ function _listWorkerPoolInstanceMetricDefinitions(resourceGroupName, name, worke try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5642,7 +5827,6 @@ function _listWorkerPoolInstanceMetrics(resourceGroupName, name, workerPoolName, } let details = (options && options.details !== undefined) ? options.details : undefined; let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5680,6 +5864,9 @@ function _listWorkerPoolInstanceMetrics(resourceGroupName, name, workerPoolName, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -5702,7 +5889,7 @@ function _listWorkerPoolInstanceMetrics(resourceGroupName, name, workerPoolName, 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('&'); } @@ -5744,12 +5931,13 @@ function _listWorkerPoolInstanceMetrics(resourceGroupName, name, workerPoolName, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5826,7 +6014,6 @@ function _listWebWorkerMetricDefinitions(resourceGroupName, name, workerPoolName if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5855,6 +6042,9 @@ function _listWebWorkerMetricDefinitions(resourceGroupName, name, workerPoolName if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -5870,7 +6060,7 @@ function _listWebWorkerMetricDefinitions(resourceGroupName, name, workerPoolName requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); 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('&'); } @@ -5912,12 +6102,13 @@ function _listWebWorkerMetricDefinitions(resourceGroupName, name, workerPoolName try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6006,7 +6197,6 @@ function _listWebWorkerMetrics(resourceGroupName, name, workerPoolName, options, } let details = (options && options.details !== undefined) ? options.details : undefined; let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6041,6 +6231,9 @@ function _listWebWorkerMetrics(resourceGroupName, name, workerPoolName, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -6062,7 +6255,7 @@ function _listWebWorkerMetrics(resourceGroupName, name, workerPoolName, options, 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('&'); } @@ -6104,12 +6297,13 @@ function _listWebWorkerMetrics(resourceGroupName, name, workerPoolName, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6184,7 +6378,6 @@ function _listWorkerPoolSkus(resourceGroupName, name, workerPoolName, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6213,6 +6406,9 @@ function _listWorkerPoolSkus(resourceGroupName, name, workerPoolName, options, c if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -6228,7 +6424,7 @@ function _listWorkerPoolSkus(resourceGroupName, name, workerPoolName, options, c requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); 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('&'); } @@ -6270,12 +6466,13 @@ function _listWorkerPoolSkus(resourceGroupName, name, workerPoolName, options, c try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6350,7 +6547,6 @@ function _listWebWorkerUsages(resourceGroupName, name, workerPoolName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6379,6 +6575,9 @@ function _listWebWorkerUsages(resourceGroupName, name, workerPoolName, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -6394,7 +6593,7 @@ function _listWebWorkerUsages(resourceGroupName, name, workerPoolName, options, requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); 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('&'); } @@ -6436,12 +6635,13 @@ function _listWebWorkerUsages(resourceGroupName, name, workerPoolName, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6560,6 +6760,15 @@ function _listWebWorkerUsages(resourceGroupName, name, workerPoolName, options, * @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. @@ -6595,7 +6804,6 @@ function _beginCreateOrUpdate(resourceGroupName, name, hostingEnvironmentEnvelop if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6624,6 +6832,9 @@ function _beginCreateOrUpdate(resourceGroupName, name, hostingEnvironmentEnvelop if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -6638,7 +6849,7 @@ function _beginCreateOrUpdate(resourceGroupName, name, hostingEnvironmentEnvelop requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -6793,7 +7004,6 @@ function _beginDeleteMethod(resourceGroupName, name, options, callback) { throw new Error('callback cannot be null.'); } let forceDelete = (options && options.forceDelete !== undefined) ? options.forceDelete : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6822,6 +7032,9 @@ function _beginDeleteMethod(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -6839,7 +7052,7 @@ function _beginDeleteMethod(resourceGroupName, name, options, callback) { if (forceDelete !== null && forceDelete !== undefined) { queryParameters.push('forceDelete=' + encodeURIComponent(forceDelete.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -6905,30 +7118,233 @@ function _beginDeleteMethod(resourceGroupName, name, options, callback) { } /** - * @summary Create or update a multi-role pool. + * @summary Move an App Service Environment to a different VNET. * - * Create or update a multi-role pool. + * 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} multiRolePoolEnvelope Properties of the multi-role pool. + * @param {object} vnetInfo Details for the new virtual network. * - * @param {number} [multiRolePoolEnvelope.workerSizeId] Worker size ID for - * referencing this worker pool. + * @param {string} [vnetInfo.id] Resource id of the Virtual Network. * - * @param {string} [multiRolePoolEnvelope.computeMode] Shared or dedicated app - * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * @param {string} [vnetInfo.subnet] Subnet within the Virtual Network. * - * @param {string} [multiRolePoolEnvelope.workerSize] VM size of the worker - * pool instances. + * @param {object} [options] Optional Parameters. * - * @param {number} [multiRolePoolEnvelope.workerCount] Number of instances in - * the worker pool. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [multiRolePoolEnvelope.sku] + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} 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. * @@ -6994,7 +7410,6 @@ function _beginCreateOrUpdateMultiRolePool(resourceGroupName, name, multiRolePoo if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7023,6 +7438,9 @@ function _beginCreateOrUpdateMultiRolePool(resourceGroupName, name, multiRolePoo if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -7037,7 +7455,7 @@ function _beginCreateOrUpdateMultiRolePool(resourceGroupName, name, multiRolePoo requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -7188,7 +7606,6 @@ function _beginResume(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7214,6 +7631,9 @@ function _beginResume(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -7228,7 +7648,7 @@ function _beginResume(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -7270,12 +7690,13 @@ function _beginResume(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -7365,7 +7786,6 @@ function _beginSuspend(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7391,6 +7811,9 @@ function _beginSuspend(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -7405,7 +7828,7 @@ function _beginSuspend(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -7447,12 +7870,13 @@ function _beginSuspend(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -7596,7 +8020,6 @@ function _beginCreateOrUpdateWorkerPool(resourceGroupName, name, workerPoolName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7628,6 +8051,9 @@ function _beginCreateOrUpdateWorkerPool(resourceGroupName, name, workerPoolName, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -7643,7 +8069,7 @@ function _beginCreateOrUpdateWorkerPool(resourceGroupName, name, workerPoolName, requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); 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('&'); } @@ -7846,12 +8272,13 @@ function _listNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -7976,12 +8403,13 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -8108,12 +8536,13 @@ function _listCapacitiesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -8148,6 +8577,85 @@ function _listCapacitiesNext(nextPageLink, options, callback) { }); } + +/** + * @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. * @@ -8238,12 +8746,13 @@ function _listMetricsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -8367,12 +8876,13 @@ function _listMultiRolePoolsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -8499,12 +9009,13 @@ function _listMultiRolePoolInstanceMetricDefinitionsNext(nextPageLink, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -8631,12 +9142,13 @@ function _listMultiRolePoolInstanceMetricsNext(nextPageLink, options, callback) try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -8762,12 +9274,13 @@ function _listMultiRoleMetricDefinitionsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -8892,12 +9405,13 @@ function _listMultiRoleMetricsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -9021,12 +9535,13 @@ function _listMultiRolePoolSkusNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -9151,12 +9666,13 @@ function _listMultiRoleUsagesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -9360,12 +9876,13 @@ function _listAppServicePlansNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -9489,12 +10006,13 @@ function _listWebAppsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -9628,14 +10146,144 @@ function _suspendNext(nextPageLink, 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 CsmUsageQuotaCollection} for more - * information. + * 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 _listUsagesNext(nextPageLink, options, callback) { +function _listWorkerPoolsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9698,12 +10346,13 @@ function _listUsagesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -9723,7 +10372,7 @@ function _listUsagesNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['CsmUsageQuotaCollection']().mapper(); + let resultMapper = new client.models['WorkerPoolCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -9739,9 +10388,11 @@ function _listUsagesNext(nextPageLink, options, callback) { } /** - * @summary Get all worker pools of an App Service Environment. + * @summary Get metric definitions for a specific instance of a worker pool of + * an App Service Environment. * - * Get all worker pools 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. @@ -9758,13 +10409,14 @@ function _listUsagesNext(nextPageLink, 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 WorkerPoolCollection} for more information. + * 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 _listWorkerPoolsNext(nextPageLink, options, callback) { +function _listWorkerPoolInstanceMetricDefinitionsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9827,12 +10479,13 @@ function _listWorkerPoolsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -9852,7 +10505,7 @@ function _listWorkerPoolsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WorkerPoolCollection']().mapper(); + let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -9868,12 +10521,12 @@ function _listWorkerPoolsNext(nextPageLink, options, callback) { } /** - * @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 + * @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. * @@ -9889,14 +10542,14 @@ function _listWorkerPoolsNext(nextPageLink, 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 ResourceMetricDefinitionCollection} for more + * 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 _listWorkerPoolInstanceMetricDefinitionsNext(nextPageLink, options, callback) { +function _listWorkerPoolInstanceMetricsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9959,12 +10612,13 @@ function _listWorkerPoolInstanceMetricDefinitionsNext(nextPageLink, options, cal try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -9984,7 +10638,7 @@ function _listWorkerPoolInstanceMetricDefinitionsNext(nextPageLink, options, cal parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); + let resultMapper = new client.models['ResourceMetricCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10000,12 +10654,11 @@ function _listWorkerPoolInstanceMetricDefinitionsNext(nextPageLink, options, cal } /** - * @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 + * @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. * @@ -10021,14 +10674,14 @@ function _listWorkerPoolInstanceMetricDefinitionsNext(nextPageLink, 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 ResourceMetricCollection} for more + * 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 _listWorkerPoolInstanceMetricsNext(nextPageLink, options, callback) { +function _listWebWorkerMetricDefinitionsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10091,12 +10744,13 @@ function _listWorkerPoolInstanceMetricsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -10116,7 +10770,7 @@ function _listWorkerPoolInstanceMetricsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricCollection']().mapper(); + let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10132,10 +10786,11 @@ function _listWorkerPoolInstanceMetricsNext(nextPageLink, options, callback) { } /** - * @summary Get metric definitions for a worker pool of an App Service - * Environment. + * @summary Get metrics for a worker pool of a AppServiceEnvironment (App + * Service Environment). * - * Get metric definitions for a worker pool of an 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. @@ -10152,14 +10807,14 @@ function _listWorkerPoolInstanceMetricsNext(nextPageLink, 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 ResourceMetricDefinitionCollection} for more + * 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 _listWebWorkerMetricDefinitionsNext(nextPageLink, options, callback) { +function _listWebWorkerMetricsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10222,12 +10877,13 @@ function _listWebWorkerMetricDefinitionsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -10247,7 +10903,7 @@ function _listWebWorkerMetricDefinitionsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); + let resultMapper = new client.models['ResourceMetricCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10263,11 +10919,9 @@ function _listWebWorkerMetricDefinitionsNext(nextPageLink, options, callback) { } /** - * @summary Get metrics for a worker pool of a AppServiceEnvironment (App - * Service Environment). + * @summary Get available SKUs for scaling a worker pool. * - * Get metrics for a worker pool of a AppServiceEnvironment (App Service - * Environment). + * Get available SKUs for scaling a worker pool. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -10284,14 +10938,13 @@ function _listWebWorkerMetricDefinitionsNext(nextPageLink, 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 ResourceMetricCollection} for more - * information. + * 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 _listWebWorkerMetricsNext(nextPageLink, options, callback) { +function _listWorkerPoolSkusNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10354,12 +11007,13 @@ function _listWebWorkerMetricsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -10379,7 +11033,7 @@ function _listWebWorkerMetricsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricCollection']().mapper(); + let resultMapper = new client.models['SkuInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10395,9 +11049,9 @@ function _listWebWorkerMetricsNext(nextPageLink, options, callback) { } /** - * @summary Get available SKUs for scaling a worker pool. + * @summary Get usage metrics for a worker pool of an App Service Environment. * - * Get available SKUs for scaling a worker pool. + * 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. @@ -10414,13 +11068,13 @@ function _listWebWorkerMetricsNext(nextPageLink, 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 SkuInfoCollection} for more information. + * 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 _listWorkerPoolSkusNext(nextPageLink, options, callback) { +function _listWebWorkerUsagesNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10483,12 +11137,13 @@ function _listWorkerPoolSkusNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -10508,7 +11163,7 @@ function _listWorkerPoolSkusNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SkuInfoCollection']().mapper(); + let resultMapper = new client.models['UsageCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10524,9 +11179,9 @@ function _listWorkerPoolSkusNext(nextPageLink, options, callback) { } /** - * @summary Get usage metrics for a worker pool of an App Service Environment. + * @summary Move an App Service Environment to a different VNET. * - * Get usage metrics for a worker pool of an App Service Environment. + * Move an App Service Environment to a different VNET. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -10543,13 +11198,13 @@ function _listWorkerPoolSkusNext(nextPageLink, 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 UsageCollection} for more information. + * 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 _listWebWorkerUsagesNext(nextPageLink, options, callback) { +function _beginChangeVnetNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10577,7 +11232,7 @@ function _listWebWorkerUsagesNext(nextPageLink, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -10602,7 +11257,7 @@ function _listWebWorkerUsagesNext(nextPageLink, options, callback) { 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); @@ -10612,12 +11267,13 @@ function _listWebWorkerUsagesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -10637,7 +11293,7 @@ function _listWebWorkerUsagesNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['UsageCollection']().mapper(); + let resultMapper = new client.models['WebAppCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10647,6 +11303,23 @@ function _listWebWorkerUsagesNext(nextPageLink, options, callback) { 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); }); @@ -10741,12 +11414,13 @@ function _beginResumeNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -10887,12 +11561,13 @@ function _beginSuspendNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -10960,6 +11635,7 @@ class AppServiceEnvironments { this._update = _update; this._listCapacities = _listCapacities; this._listVips = _listVips; + this._changeVnet = _changeVnet; this._listDiagnostics = _listDiagnostics; this._getDiagnosticsItem = _getDiagnosticsItem; this._listMetricDefinitions = _listMetricDefinitions; @@ -10993,6 +11669,7 @@ class AppServiceEnvironments { this._listWebWorkerUsages = _listWebWorkerUsages; this._beginCreateOrUpdate = _beginCreateOrUpdate; this._beginDeleteMethod = _beginDeleteMethod; + this._beginChangeVnet = _beginChangeVnet; this._beginCreateOrUpdateMultiRolePool = _beginCreateOrUpdateMultiRolePool; this._beginResume = _beginResume; this._beginSuspend = _beginSuspend; @@ -11000,6 +11677,7 @@ class AppServiceEnvironments { this._listNext = _listNext; this._listByResourceGroupNext = _listByResourceGroupNext; this._listCapacitiesNext = _listCapacitiesNext; + this._changeVnetNext = _changeVnetNext; this._listMetricsNext = _listMetricsNext; this._listMultiRolePoolsNext = _listMultiRolePoolsNext; this._listMultiRolePoolInstanceMetricDefinitionsNext = _listMultiRolePoolInstanceMetricDefinitionsNext; @@ -11020,6 +11698,7 @@ class AppServiceEnvironments { this._listWebWorkerMetricsNext = _listWebWorkerMetricsNext; this._listWorkerPoolSkusNext = _listWorkerPoolSkusNext; this._listWebWorkerUsagesNext = _listWebWorkerUsagesNext; + this._beginChangeVnetNext = _beginChangeVnetNext; this._beginResumeNext = _beginResumeNext; this._beginSuspendNext = _beginSuspendNext; } @@ -11373,6 +12052,15 @@ class AppServiceEnvironments { * @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. @@ -11488,6 +12176,15 @@ class AppServiceEnvironments { * @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. @@ -11725,6 +12422,15 @@ class AppServiceEnvironments { * @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. @@ -11836,6 +12542,15 @@ class AppServiceEnvironments { * @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. @@ -12055,7 +12770,111 @@ class AppServiceEnvironments { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listVips(resourceGroupName, name, options, optionalCallback) { + 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') { @@ -12064,14 +12883,14 @@ class AppServiceEnvironments { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listVips(resourceGroupName, name, options, (err, result, request, response) => { + self._changeVnet(resourceGroupName, name, vnetInfo, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listVips(resourceGroupName, name, options, optionalCallback); + return self._changeVnet(resourceGroupName, name, vnetInfo, options, optionalCallback); } } @@ -15628,6 +16447,15 @@ class AppServiceEnvironments { * @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. @@ -15743,6 +16571,15 @@ class AppServiceEnvironments { * @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. @@ -15896,6 +16733,110 @@ class AppServiceEnvironments { } } + /** + * @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. * @@ -16747,6 +17688,94 @@ class AppServiceEnvironments { } } + /** + * @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. * @@ -18544,6 +19573,94 @@ class AppServiceEnvironments { } } + /** + * @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. * diff --git a/lib/services/websiteManagement2/lib/operations/appServicePlans.js b/lib/services/websiteManagement2/lib/operations/appServicePlans.js index 418daf0d0c..edd4f486a6 100644 --- a/lib/services/websiteManagement2/lib/operations/appServicePlans.js +++ b/lib/services/websiteManagement2/lib/operations/appServicePlans.js @@ -54,7 +54,6 @@ function _list(options, callback) { throw new Error('callback cannot be null.'); } let detailed = (options && options.detailed !== undefined) ? options.detailed : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (detailed !== null && detailed !== undefined && typeof detailed !== 'boolean') { @@ -63,6 +62,9 @@ function _list(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -78,7 +80,7 @@ function _list(options, callback) { if (detailed !== null && detailed !== undefined) { queryParameters.push('detailed=' + encodeURIComponent(detailed.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -120,12 +122,13 @@ function _list(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -197,7 +200,6 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -220,6 +222,9 @@ function _listByResourceGroup(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -233,7 +238,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('&'); } @@ -275,12 +280,13 @@ function _listByResourceGroup(resourceGroupName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -353,7 +359,6 @@ function _get(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -379,6 +384,9 @@ function _get(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -393,7 +401,7 @@ function _get(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -488,9 +496,6 @@ function _get(resourceGroupName, name, options, callback) { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -514,9 +519,15 @@ function _get(resourceGroupName, name, options, callback) { * @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] 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. @@ -668,7 +679,6 @@ function _deleteMethod(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -694,6 +704,9 @@ function _deleteMethod(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -708,7 +721,7 @@ function _deleteMethod(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -785,9 +798,6 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanPatchResourceName Name for the - * App Service plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -811,9 +821,15 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * @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] 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. @@ -848,7 +864,6 @@ function _update(resourceGroupName, name, appServicePlan, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -877,6 +892,9 @@ function _update(resourceGroupName, name, appServicePlan, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -891,7 +909,7 @@ function _update(resourceGroupName, name, appServicePlan, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -947,12 +965,13 @@ function _update(resourceGroupName, name, appServicePlan, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1041,7 +1060,6 @@ function _listCapabilities(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1067,6 +1085,9 @@ function _listCapabilities(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1081,7 +1102,7 @@ function _listCapabilities(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1123,12 +1144,13 @@ function _listCapabilities(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1219,7 +1241,6 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1251,6 +1272,9 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1267,7 +1291,7 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); 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('&'); } @@ -1309,12 +1333,13 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1390,7 +1415,6 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1422,6 +1446,9 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1438,7 +1465,7 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); 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('&'); } @@ -1545,7 +1572,6 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1577,6 +1603,9 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1593,7 +1622,7 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); 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('&'); } @@ -1635,12 +1664,13 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1717,7 +1747,6 @@ function _listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1749,6 +1778,9 @@ function _listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1765,7 +1797,7 @@ function _listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); 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('&'); } @@ -1807,12 +1839,13 @@ function _listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1887,7 +1920,6 @@ function _getHybridConnectionPlanLimit(resourceGroupName, name, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1913,6 +1945,9 @@ function _getHybridConnectionPlanLimit(resourceGroupName, name, options, callbac if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1927,7 +1962,7 @@ function _getHybridConnectionPlanLimit(resourceGroupName, name, options, callbac requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1969,12 +2004,13 @@ function _getHybridConnectionPlanLimit(resourceGroupName, name, options, callbac try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2048,7 +2084,6 @@ function _listHybridConnections(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2074,6 +2109,9 @@ function _listHybridConnections(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2088,7 +2126,7 @@ function _listHybridConnections(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -2130,12 +2168,13 @@ function _listHybridConnections(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2211,7 +2250,6 @@ function _listMetricDefintions(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2237,6 +2275,9 @@ function _listMetricDefintions(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2251,7 +2292,7 @@ function _listMetricDefintions(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -2293,12 +2334,13 @@ function _listMetricDefintions(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2383,7 +2425,6 @@ function _listMetrics(resourceGroupName, name, options, callback) { } let details = (options && options.details !== undefined) ? options.details : undefined; let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2415,6 +2456,9 @@ function _listMetrics(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2435,7 +2479,7 @@ function _listMetrics(resourceGroupName, name, 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('&'); } @@ -2477,12 +2521,13 @@ function _listMetrics(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2560,7 +2605,6 @@ function _restartWebApps(resourceGroupName, name, options, callback) { throw new Error('callback cannot be null.'); } let softRestart = (options && options.softRestart !== undefined) ? options.softRestart : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2589,6 +2633,9 @@ function _restartWebApps(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2606,7 +2653,7 @@ function _restartWebApps(resourceGroupName, name, options, callback) { if (softRestart !== null && softRestart !== undefined) { queryParameters.push('softRestart=' + encodeURIComponent(softRestart.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2723,7 +2770,6 @@ function _listWebApps(resourceGroupName, name, options, callback) { 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; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2758,6 +2804,9 @@ function _listWebApps(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2781,7 +2830,7 @@ function _listWebApps(resourceGroupName, name, options, callback) { if (top !== null && top !== undefined) { queryParameters.push('$top=' + encodeURIComponent(top)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2823,12 +2872,13 @@ function _listWebApps(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2900,7 +2950,6 @@ function _getServerFarmSkus(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2926,6 +2975,9 @@ function _getServerFarmSkus(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2940,7 +2992,7 @@ function _getServerFarmSkus(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -2982,12 +3034,13 @@ function _getServerFarmSkus(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3072,7 +3125,6 @@ function _listUsages(resourceGroupName, name, options, callback) { throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3101,6 +3153,9 @@ function _listUsages(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3118,7 +3173,7 @@ function _listUsages(resourceGroupName, name, 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('&'); } @@ -3160,12 +3215,13 @@ function _listUsages(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3237,7 +3293,6 @@ function _listVnets(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3263,6 +3318,9 @@ function _listVnets(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3277,7 +3335,7 @@ function _listVnets(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -3319,12 +3377,13 @@ function _listVnets(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3413,7 +3472,6 @@ function _getVnetFromServerFarm(resourceGroupName, name, vnetName, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3442,6 +3500,9 @@ function _getVnetFromServerFarm(resourceGroupName, name, vnetName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3457,7 +3518,7 @@ function _getVnetFromServerFarm(resourceGroupName, name, vnetName, options, call requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); 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('&'); } @@ -3582,7 +3643,6 @@ function _getVnetGateway(resourceGroupName, name, vnetName, gatewayName, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3614,6 +3674,9 @@ function _getVnetGateway(resourceGroupName, name, vnetName, gatewayName, options if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3630,7 +3693,7 @@ function _getVnetGateway(resourceGroupName, name, vnetName, gatewayName, options requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); 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('&'); } @@ -3672,12 +3735,13 @@ function _getVnetGateway(resourceGroupName, name, vnetName, gatewayName, options try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3764,7 +3828,6 @@ function _updateVnetGateway(resourceGroupName, name, vnetName, gatewayName, conn if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3799,6 +3862,9 @@ function _updateVnetGateway(resourceGroupName, name, vnetName, gatewayName, conn if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3815,7 +3881,7 @@ function _updateVnetGateway(resourceGroupName, name, vnetName, gatewayName, conn requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); 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('&'); } @@ -3871,12 +3937,13 @@ function _updateVnetGateway(resourceGroupName, name, vnetName, gatewayName, conn try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3952,7 +4019,6 @@ function _listRoutesForVnet(resourceGroupName, name, vnetName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3981,6 +4047,9 @@ function _listRoutesForVnet(resourceGroupName, name, vnetName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3996,7 +4065,7 @@ function _listRoutesForVnet(resourceGroupName, name, vnetName, options, callback requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); 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('&'); } @@ -4038,12 +4107,13 @@ function _listRoutesForVnet(resourceGroupName, name, vnetName, options, callback try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4133,7 +4203,6 @@ function _getRouteForVnet(resourceGroupName, name, vnetName, routeName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4165,6 +4234,9 @@ function _getRouteForVnet(resourceGroupName, name, vnetName, routeName, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4181,7 +4253,7 @@ function _getRouteForVnet(resourceGroupName, name, vnetName, routeName, options, requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); 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('&'); } @@ -4293,9 +4365,6 @@ function _getRouteForVnet(resourceGroupName, name, vnetName, routeName, options, * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @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. @@ -4342,7 +4411,6 @@ function _createOrUpdateVnetRoute(resourceGroupName, name, vnetName, routeName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4377,6 +4445,9 @@ function _createOrUpdateVnetRoute(resourceGroupName, name, vnetName, routeName, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4393,7 +4464,7 @@ function _createOrUpdateVnetRoute(resourceGroupName, name, vnetName, routeName, requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); 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('&'); } @@ -4530,7 +4601,6 @@ function _deleteVnetRoute(resourceGroupName, name, vnetName, routeName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4562,6 +4632,9 @@ function _deleteVnetRoute(resourceGroupName, name, vnetName, routeName, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4578,7 +4651,7 @@ function _deleteVnetRoute(resourceGroupName, name, vnetName, routeName, options, requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); 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('&'); } @@ -4659,9 +4732,6 @@ function _deleteVnetRoute(resourceGroupName, name, vnetName, routeName, options, * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @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. @@ -4708,7 +4778,6 @@ function _updateVnetRoute(resourceGroupName, name, vnetName, routeName, route, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4743,6 +4812,9 @@ function _updateVnetRoute(resourceGroupName, name, vnetName, routeName, route, o if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4759,7 +4831,7 @@ function _updateVnetRoute(resourceGroupName, name, vnetName, routeName, route, o requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); 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('&'); } @@ -4895,7 +4967,6 @@ function _rebootWorker(resourceGroupName, name, workerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4924,6 +4995,9 @@ function _rebootWorker(resourceGroupName, name, workerName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4939,7 +5013,7 @@ function _rebootWorker(resourceGroupName, name, workerName, options, callback) { requestUrl = requestUrl.replace('{workerName}', encodeURIComponent(workerName)); 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('&'); } @@ -5016,9 +5090,6 @@ function _rebootWorker(resourceGroupName, name, workerName, options, callback) { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -5042,9 +5113,15 @@ function _rebootWorker(resourceGroupName, name, workerName, options, callback) { * @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] 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. @@ -5117,7 +5194,6 @@ function _beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5146,6 +5222,9 @@ function _beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -5160,7 +5239,7 @@ function _beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -5216,12 +5295,13 @@ function _beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5363,12 +5443,13 @@ function _listNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5493,12 +5574,13 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5622,12 +5704,13 @@ function _listWebAppsByHybridConnectionNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5752,12 +5835,13 @@ function _listHybridConnectionsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5884,12 +5968,13 @@ function _listMetricDefintionsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6014,12 +6099,13 @@ function _listMetricsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6143,12 +6229,13 @@ function _listWebAppsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6273,12 +6360,13 @@ function _listUsagesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6647,9 +6735,6 @@ class AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -6673,9 +6758,15 @@ class AppServicePlans { * @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] 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. @@ -6757,9 +6848,6 @@ class AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -6783,9 +6871,15 @@ class AppServicePlans { * @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] 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. @@ -6980,9 +7074,6 @@ class AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanPatchResourceName Name for the - * App Service plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -7006,9 +7097,15 @@ class AppServicePlans { * @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] 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. @@ -7052,9 +7149,6 @@ class AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanPatchResourceName Name for the - * App Service plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -7078,9 +7172,15 @@ class AppServicePlans { * @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] 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. @@ -9050,9 +9150,6 @@ class AppServicePlans { * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @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. @@ -9112,9 +9209,6 @@ class AppServicePlans { * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @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. @@ -9295,9 +9389,6 @@ class AppServicePlans { * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @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. @@ -9357,9 +9448,6 @@ class AppServicePlans { * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @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. @@ -9534,9 +9622,6 @@ class AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -9560,9 +9645,15 @@ class AppServicePlans { * @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] 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. @@ -9644,9 +9735,6 @@ class AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -9670,9 +9758,15 @@ class AppServicePlans { * @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] 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. diff --git a/lib/services/websiteManagement2/lib/operations/certificateRegistrationProvider.js b/lib/services/websiteManagement2/lib/operations/certificateRegistrationProvider.js index d46700b376..14e286327f 100644 --- a/lib/services/websiteManagement2/lib/operations/certificateRegistrationProvider.js +++ b/lib/services/websiteManagement2/lib/operations/certificateRegistrationProvider.js @@ -50,9 +50,11 @@ function _listOperations(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-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.'); } @@ -64,7 +66,7 @@ function _listOperations(options, callback) { let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.CertificateRegistration/operations'; let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -106,12 +108,13 @@ function _listOperations(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -238,12 +241,13 @@ function _listOperationsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { diff --git a/lib/services/websiteManagement2/lib/operations/certificates.js b/lib/services/websiteManagement2/lib/operations/certificates.js index 601943e575..5bda762528 100644 --- a/lib/services/websiteManagement2/lib/operations/certificates.js +++ b/lib/services/websiteManagement2/lib/operations/certificates.js @@ -47,12 +47,14 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -65,7 +67,7 @@ function _list(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -107,12 +109,13 @@ function _list(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -183,7 +186,6 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -206,6 +208,9 @@ function _listByResourceGroup(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -219,7 +224,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('&'); } @@ -261,12 +266,13 @@ function _listByResourceGroup(resourceGroupName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -339,7 +345,6 @@ function _get(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -365,6 +370,9 @@ function _get(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -379,7 +387,7 @@ function _get(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -421,12 +429,13 @@ function _get(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -524,7 +533,6 @@ function _createOrUpdate(resourceGroupName, name, certificateEnvelope, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -553,6 +561,9 @@ function _createOrUpdate(resourceGroupName, name, certificateEnvelope, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -567,7 +578,7 @@ function _createOrUpdate(resourceGroupName, name, certificateEnvelope, options, requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -623,12 +634,13 @@ function _createOrUpdate(resourceGroupName, name, certificateEnvelope, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -700,7 +712,6 @@ function _deleteMethod(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -726,6 +737,9 @@ function _deleteMethod(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -740,7 +754,7 @@ function _deleteMethod(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -864,7 +878,6 @@ function _update(resourceGroupName, name, certificateEnvelope, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -893,6 +906,9 @@ function _update(resourceGroupName, name, certificateEnvelope, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -907,7 +923,7 @@ function _update(resourceGroupName, name, certificateEnvelope, options, callback requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -963,12 +979,13 @@ function _update(resourceGroupName, name, certificateEnvelope, options, callback try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1092,12 +1109,13 @@ function _listNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1221,12 +1239,13 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { diff --git a/lib/services/websiteManagement2/lib/operations/deletedWebApps.js b/lib/services/websiteManagement2/lib/operations/deletedWebApps.js index 50d8c1e457..e8f1fec2a2 100644 --- a/lib/services/websiteManagement2/lib/operations/deletedWebApps.js +++ b/lib/services/websiteManagement2/lib/operations/deletedWebApps.js @@ -48,12 +48,14 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -66,7 +68,7 @@ function _list(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -108,12 +110,13 @@ function _list(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -238,12 +241,13 @@ function _listNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { diff --git a/lib/services/websiteManagement2/lib/operations/diagnostics.js b/lib/services/websiteManagement2/lib/operations/diagnostics.js index c33b53260b..92f387cbf1 100644 --- a/lib/services/websiteManagement2/lib/operations/diagnostics.js +++ b/lib/services/websiteManagement2/lib/operations/diagnostics.js @@ -53,7 +53,6 @@ function _listHostingEnvironmentDetectorResponses(resourceGroupName, name, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -79,6 +78,9 @@ function _listHostingEnvironmentDetectorResponses(resourceGroupName, name, optio if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -93,7 +95,7 @@ function _listHostingEnvironmentDetectorResponses(resourceGroupName, name, optio requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -135,12 +137,13 @@ function _listHostingEnvironmentDetectorResponses(resourceGroupName, name, optio try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -224,7 +227,6 @@ function _getHostingEnvironmentDetectorResponse(resourceGroupName, name, detecto 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 apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -270,6 +272,9 @@ function _getHostingEnvironmentDetectorResponse(resourceGroupName, name, detecto if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -294,7 +299,7 @@ function _getHostingEnvironmentDetectorResponse(resourceGroupName, name, detecto if (timeGrain !== null && timeGrain !== undefined) { queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -336,12 +341,13 @@ function _getHostingEnvironmentDetectorResponse(resourceGroupName, name, detecto try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -415,7 +421,6 @@ function _listSiteDetectorResponses(resourceGroupName, siteName, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -441,6 +446,9 @@ function _listSiteDetectorResponses(resourceGroupName, siteName, options, callba if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -455,7 +463,7 @@ function _listSiteDetectorResponses(resourceGroupName, siteName, options, callba requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); 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('&'); } @@ -497,12 +505,13 @@ function _listSiteDetectorResponses(resourceGroupName, siteName, options, callba try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -586,7 +595,6 @@ function _getSiteDetectorResponse(resourceGroupName, siteName, detectorName, opt 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 apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -632,6 +640,9 @@ function _getSiteDetectorResponse(resourceGroupName, siteName, detectorName, opt if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -656,7 +667,7 @@ function _getSiteDetectorResponse(resourceGroupName, siteName, detectorName, opt if (timeGrain !== null && timeGrain !== undefined) { queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -698,12 +709,13 @@ function _getSiteDetectorResponse(resourceGroupName, siteName, detectorName, opt try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -777,7 +789,6 @@ function _listSiteDiagnosticCategories(resourceGroupName, siteName, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -803,6 +814,9 @@ function _listSiteDiagnosticCategories(resourceGroupName, siteName, options, cal if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -817,7 +831,7 @@ function _listSiteDiagnosticCategories(resourceGroupName, siteName, options, cal requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); 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('&'); } @@ -859,12 +873,13 @@ function _listSiteDiagnosticCategories(resourceGroupName, siteName, options, cal try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -939,7 +954,6 @@ function _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCateg if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -968,6 +982,9 @@ function _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCateg if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -983,7 +1000,7 @@ function _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCateg requestUrl = requestUrl.replace('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); 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('&'); } @@ -1025,12 +1042,13 @@ function _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCateg try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1106,7 +1124,6 @@ function _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1135,6 +1152,9 @@ function _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, opti if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1150,7 +1170,7 @@ function _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, opti requestUrl = requestUrl.replace('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); 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('&'); } @@ -1192,12 +1212,13 @@ function _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, opti try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1274,7 +1295,6 @@ function _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analy if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1306,6 +1326,9 @@ function _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analy if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1322,7 +1345,7 @@ function _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analy requestUrl = requestUrl.replace('{analysisName}', encodeURIComponent(analysisName)); 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('&'); } @@ -1364,12 +1387,13 @@ function _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analy try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1455,7 +1479,6 @@ function _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, a 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 apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1504,6 +1527,9 @@ function _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, a if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1529,7 +1555,7 @@ function _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, a if (timeGrain !== null && timeGrain !== undefined) { queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1571,12 +1597,13 @@ function _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, a try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1652,7 +1679,6 @@ function _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1681,6 +1707,9 @@ function _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, opt if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1696,7 +1725,7 @@ function _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, opt requestUrl = requestUrl.replace('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); 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('&'); } @@ -1738,12 +1767,13 @@ function _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, opt try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1821,7 +1851,6 @@ function _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detec if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1853,6 +1882,9 @@ function _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detec if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1869,7 +1901,7 @@ function _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detec requestUrl = requestUrl.replace('{detectorName}', encodeURIComponent(detectorName)); 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('&'); } @@ -1911,12 +1943,13 @@ function _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detec try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2003,7 +2036,6 @@ function _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnos 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 apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2052,6 +2084,9 @@ function _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnos if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2077,7 +2112,7 @@ function _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnos if (timeGrain !== null && timeGrain !== undefined) { queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2119,12 +2154,13 @@ function _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnos try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2200,7 +2236,6 @@ function _listSiteDetectorResponsesSlot(resourceGroupName, siteName, slot, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2229,6 +2264,9 @@ function _listSiteDetectorResponsesSlot(resourceGroupName, siteName, slot, optio if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2244,7 +2282,7 @@ function _listSiteDetectorResponsesSlot(resourceGroupName, siteName, slot, optio requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -2286,12 +2324,13 @@ function _listSiteDetectorResponsesSlot(resourceGroupName, siteName, slot, optio try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2377,7 +2416,6 @@ function _getSiteDetectorResponseSlot(resourceGroupName, siteName, detectorName, 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 apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2426,6 +2464,9 @@ function _getSiteDetectorResponseSlot(resourceGroupName, siteName, detectorName, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2451,7 +2492,7 @@ function _getSiteDetectorResponseSlot(resourceGroupName, siteName, detectorName, if (timeGrain !== null && timeGrain !== undefined) { queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2493,12 +2534,13 @@ function _getSiteDetectorResponseSlot(resourceGroupName, siteName, detectorName, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2574,7 +2616,6 @@ function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2603,6 +2644,9 @@ function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, op if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2618,7 +2662,7 @@ function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, op requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -2660,12 +2704,13 @@ function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, op try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2742,7 +2787,6 @@ function _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticC if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2774,6 +2818,9 @@ function _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticC if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2790,7 +2837,7 @@ function _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticC requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -2832,12 +2879,13 @@ function _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticC try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2915,7 +2963,6 @@ function _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2947,6 +2994,9 @@ function _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2963,7 +3013,7 @@ function _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -3005,12 +3055,13 @@ function _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3089,7 +3140,6 @@ function _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, a if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3124,6 +3174,9 @@ function _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, a if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3141,7 +3194,7 @@ function _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, a requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -3183,12 +3236,13 @@ function _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, a try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3276,7 +3330,6 @@ function _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategor 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 apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3328,6 +3381,9 @@ function _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategor if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3354,7 +3410,7 @@ function _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategor if (timeGrain !== null && timeGrain !== undefined) { queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3396,12 +3452,13 @@ function _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategor try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3479,7 +3536,6 @@ function _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3511,6 +3567,9 @@ function _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3527,7 +3586,7 @@ function _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -3569,12 +3628,13 @@ function _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3654,7 +3714,6 @@ function _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, d if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3689,6 +3748,9 @@ function _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, d if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3706,7 +3768,7 @@ function _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, d requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -3748,12 +3810,13 @@ function _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, d try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3842,7 +3905,6 @@ function _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, dia 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 apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3894,6 +3956,9 @@ function _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, dia if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3920,7 +3985,7 @@ function _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, dia if (timeGrain !== null && timeGrain !== undefined) { queryParameters.push('timeGrain=' + encodeURIComponent(timeGrain)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -3962,12 +4027,13 @@ function _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, dia try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4092,12 +4158,13 @@ function _listHostingEnvironmentDetectorResponsesNext(nextPageLink, options, cal try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4222,12 +4289,13 @@ function _listSiteDetectorResponsesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4352,12 +4420,13 @@ function _listSiteDiagnosticCategoriesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4482,12 +4551,13 @@ function _listSiteAnalysesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4612,12 +4682,13 @@ function _listSiteDetectorsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4742,12 +4813,13 @@ function _getSiteDetectorNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4872,12 +4944,13 @@ function _listSiteDetectorResponsesSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5002,12 +5075,13 @@ function _listSiteDiagnosticCategoriesSlotNext(nextPageLink, options, callback) try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5132,12 +5206,13 @@ function _listSiteAnalysesSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5262,12 +5337,13 @@ function _listSiteDetectorsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5392,12 +5468,13 @@ function _getSiteDetectorSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { diff --git a/lib/services/websiteManagement2/lib/operations/domainRegistrationProvider.js b/lib/services/websiteManagement2/lib/operations/domainRegistrationProvider.js index 6de060c6f0..15f1b4c10e 100644 --- a/lib/services/websiteManagement2/lib/operations/domainRegistrationProvider.js +++ b/lib/services/websiteManagement2/lib/operations/domainRegistrationProvider.js @@ -50,9 +50,11 @@ function _listOperations(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-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.'); } @@ -64,7 +66,7 @@ function _listOperations(options, callback) { let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.DomainRegistration/operations'; let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -106,12 +108,13 @@ function _listOperations(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -238,12 +241,13 @@ function _listOperationsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { diff --git a/lib/services/websiteManagement2/lib/operations/domains.js b/lib/services/websiteManagement2/lib/operations/domains.js index 87984bef5e..a1222e1242 100644 --- a/lib/services/websiteManagement2/lib/operations/domains.js +++ b/lib/services/websiteManagement2/lib/operations/domains.js @@ -51,12 +51,14 @@ function _checkAvailability(options, callback) { throw new Error('callback cannot be null.'); } let name = (options && options.name !== undefined) ? options.name : undefined; - let apiVersion = '2015-04-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.apiVersion === null || this.client.apiVersion === undefined || typeof 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.'); } @@ -77,7 +79,7 @@ function _checkAvailability(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -133,12 +135,13 @@ function _checkAvailability(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -206,12 +209,14 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -224,7 +229,7 @@ function _list(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -266,12 +271,13 @@ function _list(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -340,12 +346,14 @@ function _getControlCenterSsoRequest(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -358,7 +366,7 @@ function _getControlCenterSsoRequest(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -400,12 +408,13 @@ function _getControlCenterSsoRequest(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -483,7 +492,6 @@ function _listRecommendations(parameters, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (parameters === null || parameters === undefined) { @@ -492,6 +500,9 @@ function _listRecommendations(parameters, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -504,7 +515,7 @@ function _listRecommendations(parameters, options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -560,12 +571,13 @@ function _listRecommendations(parameters, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -636,7 +648,6 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -659,6 +670,9 @@ function _listByResourceGroup(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -672,7 +686,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('&'); } @@ -714,12 +728,13 @@ function _listByResourceGroup(resourceGroupName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -792,7 +807,6 @@ function _get(resourceGroupName, domainName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -818,6 +832,9 @@ function _get(resourceGroupName, domainName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -832,7 +849,7 @@ function _get(resourceGroupName, domainName, options, callback) { requestUrl = requestUrl.replace('{domainName}', encodeURIComponent(domainName)); 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('&'); } @@ -874,12 +891,13 @@ function _get(resourceGroupName, domainName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1117,7 +1135,6 @@ function _deleteMethod(resourceGroupName, domainName, options, callback) { throw new Error('callback cannot be null.'); } let forceHardDeleteDomain = (options && options.forceHardDeleteDomain !== undefined) ? options.forceHardDeleteDomain : undefined; - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1146,6 +1163,9 @@ function _deleteMethod(resourceGroupName, domainName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1163,7 +1183,7 @@ function _deleteMethod(resourceGroupName, domainName, options, callback) { if (forceHardDeleteDomain !== null && forceHardDeleteDomain !== undefined) { queryParameters.push('forceHardDeleteDomain=' + encodeURIComponent(forceHardDeleteDomain.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1342,7 +1362,6 @@ function _update(resourceGroupName, domainName, domain, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1377,6 +1396,9 @@ function _update(resourceGroupName, domainName, domain, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1391,7 +1413,7 @@ function _update(resourceGroupName, domainName, domain, options, callback) { requestUrl = requestUrl.replace('{domainName}', encodeURIComponent(domainName)); 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('&'); } @@ -1447,12 +1469,13 @@ function _update(resourceGroupName, domainName, domain, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1543,7 +1566,6 @@ function _listOwnershipIdentifiers(resourceGroupName, domainName, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1569,6 +1591,9 @@ function _listOwnershipIdentifiers(resourceGroupName, domainName, options, callb if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1583,7 +1608,7 @@ function _listOwnershipIdentifiers(resourceGroupName, domainName, options, callb requestUrl = requestUrl.replace('{domainName}', encodeURIComponent(domainName)); 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('&'); } @@ -1625,12 +1650,13 @@ function _listOwnershipIdentifiers(resourceGroupName, domainName, options, callb try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1706,7 +1732,6 @@ function _getOwnershipIdentifier(resourceGroupName, domainName, name, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1735,6 +1760,9 @@ function _getOwnershipIdentifier(resourceGroupName, domainName, name, options, c if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1750,7 +1778,7 @@ function _getOwnershipIdentifier(resourceGroupName, domainName, name, options, c requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1792,12 +1820,13 @@ function _getOwnershipIdentifier(resourceGroupName, domainName, name, options, c try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1882,7 +1911,6 @@ function _createOrUpdateOwnershipIdentifier(resourceGroupName, domainName, name, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1914,6 +1942,9 @@ function _createOrUpdateOwnershipIdentifier(resourceGroupName, domainName, name, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1929,7 +1960,7 @@ function _createOrUpdateOwnershipIdentifier(resourceGroupName, domainName, name, requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1985,12 +2016,13 @@ function _createOrUpdateOwnershipIdentifier(resourceGroupName, domainName, name, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2064,7 +2096,6 @@ function _deleteOwnershipIdentifier(resourceGroupName, domainName, name, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2093,6 +2124,9 @@ function _deleteOwnershipIdentifier(resourceGroupName, domainName, name, options if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2108,7 +2142,7 @@ function _deleteOwnershipIdentifier(resourceGroupName, domainName, name, options requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -2223,7 +2257,6 @@ function _updateOwnershipIdentifier(resourceGroupName, domainName, name, domainO if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2255,6 +2288,9 @@ function _updateOwnershipIdentifier(resourceGroupName, domainName, name, domainO if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2270,7 +2306,7 @@ function _updateOwnershipIdentifier(resourceGroupName, domainName, name, domainO requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -2326,12 +2362,13 @@ function _updateOwnershipIdentifier(resourceGroupName, domainName, name, domainO try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2403,7 +2440,6 @@ function _renew(resourceGroupName, domainName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2429,6 +2465,9 @@ function _renew(resourceGroupName, domainName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2443,7 +2482,7 @@ function _renew(resourceGroupName, domainName, options, callback) { requestUrl = requestUrl.replace('{domainName}', encodeURIComponent(domainName)); 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('&'); } @@ -2475,7 +2514,7 @@ function _renew(resourceGroupName, domainName, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202 && statusCode !== 204) { + 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); @@ -2485,13 +2524,12 @@ function _renew(resourceGroupName, domainName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; + if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; + if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; + if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['ErrorResponse']().mapper(); + let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2627,7 +2665,6 @@ function _beginCreateOrUpdate(resourceGroupName, domainName, domain, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2662,6 +2699,9 @@ function _beginCreateOrUpdate(resourceGroupName, domainName, domain, options, ca if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2676,7 +2716,7 @@ function _beginCreateOrUpdate(resourceGroupName, domainName, domain, options, ca requestUrl = requestUrl.replace('{domainName}', encodeURIComponent(domainName)); 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('&'); } @@ -2732,12 +2772,13 @@ function _beginCreateOrUpdate(resourceGroupName, domainName, domain, options, ca try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2878,12 +2919,13 @@ function _listNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3008,12 +3050,13 @@ function _listRecommendationsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3137,12 +3180,13 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3267,12 +3311,13 @@ function _listOwnershipIdentifiersNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { diff --git a/lib/services/websiteManagement2/lib/operations/index.d.ts b/lib/services/websiteManagement2/lib/operations/index.d.ts index 6a0a06d829..6383b5e281 100644 --- a/lib/services/websiteManagement2/lib/operations/index.d.ts +++ b/lib/services/websiteManagement2/lib/operations/index.d.ts @@ -8124,6 +8124,10 @@ export interface Recommendations { * * @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=channels eq 'Api' or channel eq 'Notification' and * startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' @@ -8138,7 +8142,7 @@ export interface Recommendations { * * @reject {Error|ServiceError} - The error object. */ - listHistoryForWebAppWithHttpOperationResponse(resourceGroupName: string, siteName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + 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 @@ -8153,6 +8157,10 @@ export interface Recommendations { * * @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=channels eq 'Api' or channel eq 'Notification' and * startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' @@ -8184,9 +8192,9 @@ export interface Recommendations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listHistoryForWebApp(resourceGroupName: string, siteName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + 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: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listHistoryForWebApp(resourceGroupName: string, siteName: string, options: { expiredOnly? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -8738,818 +8746,6 @@ export interface Recommendations { listRecommendedRulesForWebAppNext(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; -} - -/** - * @class - * BillingMeters - * __NOTE__: An instance of this class is automatically created for an - * instance of the WebSiteManagementClient. - */ -export interface BillingMeters { - - - /** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.billingLocation] Azure Location of billable - * resource - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listWithHttpOperationResponse(options?: { billingLocation? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.billingLocation] Azure Location of billable - * resource - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {BillingMeterCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {BillingMeterCollection} [result] - The deserialized result object if an error did not occur. - * See {@link BillingMeterCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - list(options?: { billingLocation? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { billingLocation? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {BillingMeterCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {BillingMeterCollection} [result] - The deserialized result object if an error did not occur. - * See {@link BillingMeterCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - /** * @class * WebApps @@ -9778,6 +8974,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -9796,6 +8994,9 @@ export interface WebApps { * @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. @@ -9994,6 +9195,12 @@ export interface WebApps { * @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. * @@ -10004,6 +9211,13 @@ export interface WebApps { * 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. @@ -10079,43 +9293,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -10123,7 +9300,10 @@ export interface WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -10174,6 +9354,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -10192,6 +9374,9 @@ export interface WebApps { * @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. @@ -10390,6 +9575,12 @@ export interface WebApps { * @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. * @@ -10400,6 +9591,13 @@ export interface WebApps { * 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. @@ -10475,43 +9673,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -10519,7 +9680,10 @@ export interface WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -10669,6 +9833,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -10687,6 +9853,9 @@ export interface WebApps { * @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. @@ -10885,6 +10054,12 @@ export interface WebApps { * @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. * @@ -10895,6 +10070,13 @@ export interface WebApps { * 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. @@ -10970,43 +10152,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -11056,6 +10201,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -11074,6 +10221,9 @@ export interface WebApps { * @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. @@ -11272,6 +10422,12 @@ export interface WebApps { * @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. * @@ -11282,6 +10438,13 @@ export interface WebApps { * 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. @@ -11357,43 +10520,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -11601,8 +10727,6 @@ export interface WebApps { * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName 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. @@ -11633,9 +10757,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -11664,450 +10785,6 @@ export interface WebApps { * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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 Discovers an existing app backup that can be restored from a blob - * in Azure storage. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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. - */ - discoverRestoreWithHttpOperationResponse(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. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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. - */ - discoverRestore(resourceGroupName: string, name: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - discoverRestore(resourceGroupName: string, name: string, request: models.RestoreRequest, callback: ServiceCallback): void; - discoverRestore(resourceGroupName: string, name: string, request: models.RestoreRequest, 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.backupRequestName 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. @@ -12138,8 +10815,291 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * @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 {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. * @@ -12176,8 +11136,6 @@ export interface WebApps { * * @param {object} request Information on backup request. * - * @param {string} request.backupRequestName 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. @@ -12208,9 +11166,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -12288,7 +11243,7 @@ export interface WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -12306,11 +11261,11 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @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>; + 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 @@ -12355,7 +11310,7 @@ export interface WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -12378,7 +11333,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {RestoreResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -12386,16 +11341,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestoreResponse} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} 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. */ - 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; + 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; /** @@ -12681,6 +11635,9 @@ export interface WebApps { * 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 @@ -12847,6 +11804,9 @@ export interface WebApps { * 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 @@ -13034,8 +11994,6 @@ export interface WebApps { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName 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. @@ -13066,9 +12024,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -13096,8 +12051,6 @@ export interface WebApps { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName 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. @@ -13128,9 +12081,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -14283,6 +13233,339 @@ export interface WebApps { 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. @@ -14379,6 +13662,9 @@ export interface WebApps { * * @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. * @@ -14556,6 +13842,12 @@ export interface WebApps { * @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 @@ -14565,6 +13857,13 @@ export interface WebApps { * 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. @@ -14607,6 +13906,272 @@ export interface WebApps { * * @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 {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. * @@ -14784,252 +14349,11 @@ export interface WebApps { * @param {boolean} [siteConfig.localMySqlEnabled] true to enable * local MySQL; otherwise, false. * - * @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 {number} [siteConfig.managedServiceIdentityId] Managed Service + * Identity Id * - * @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 {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 {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.xManagedServiceIdentityId] Explicit Managed + * Service Identity Id * * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. * @@ -15040,6 +14364,13 @@ export interface WebApps { * 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. @@ -15082,6 +14413,9 @@ export interface WebApps { * * @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. * @@ -15259,6 +14593,12 @@ export interface WebApps { * @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 @@ -15268,6 +14608,13 @@ export interface WebApps { * 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. @@ -15596,7 +14943,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - getWebSiteContainerLogsZipWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getContainerLogsZipWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Gets the ZIP archived docker log files for the given site @@ -15634,9 +14981,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getWebSiteContainerLogsZip(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getWebSiteContainerLogsZip(resourceGroupName: string, name: string, callback: ServiceCallback): void; - getWebSiteContainerLogsZip(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** @@ -16130,8 +15477,6 @@ export interface WebApps { * * @param {object} deployment Deployment details. * - * @param {string} [deployment.deploymentId] Identifier for deployment. - * * @param {number} [deployment.status] Deployment status. * * @param {string} [deployment.message] Details about deployment status. @@ -16180,8 +15525,6 @@ export interface WebApps { * * @param {object} deployment Deployment details. * - * @param {string} [deployment.deploymentId] Identifier for deployment. - * * @param {number} [deployment.status] Deployment status. * * @param {string} [deployment.message] Details about deployment status. @@ -16380,6 +15723,159 @@ export interface WebApps { 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. * @@ -17234,6 +16730,8 @@ export interface WebApps { * * @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. @@ -17280,6 +16778,8 @@ export interface WebApps { * * @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. @@ -20885,12 +20385,6 @@ export interface WebApps { * * @param {string} [premierAddOn.vendor] Premier add on Vendor. * - * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * * @param {string} [premierAddOn.marketplacePublisher] Premier add on * Marketplace publisher. * @@ -20937,12 +20431,6 @@ export interface WebApps { * * @param {string} [premierAddOn.vendor] Premier add on Vendor. * - * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * * @param {string} [premierAddOn.marketplacePublisher] Premier add on * Marketplace publisher. * @@ -21055,6 +20543,265 @@ export interface WebApps { 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. @@ -21936,57 +21683,443 @@ export interface WebApps { * * {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; + 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} [options] Optional Parameters. + * + * @param {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {object} [options.customHeaders] Headers that 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, options?: { format? : string, 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} [options] Optional Parameters. + * + * @param {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, options?: { format? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, options: { format? : string, 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 Gets the publishing profile for an app (or deployment slot, if - * specified). + * @summary Restores a deleted web app to this web app. * - * Gets the publishing profile for an app (or deployment slot, if specified). + * 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 the app. + * @param {string} name Name of web app. * - * @param {object} [options] Optional Parameters. + * @param {object} restoreRequest Deleted web app restore information. * - * @param {string} [options.format] Name of the format. Valid values are: - * FileZilla3 - * WebDeploy -- default - * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * @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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listPublishingProfileXmlWithSecretsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { format? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + restoreFromDeletedAppWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets the publishing profile for an app (or deployment slot, if - * specified). + * @summary Restores a deleted web app to this web app. * - * Gets the publishing profile for an app (or deployment slot, if specified). + * 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 the app. + * @param {string} name Name of web app. * - * @param {object} [options] Optional Parameters. + * @param {object} restoreRequest Deleted web app restore information. * - * @param {string} [options.format] Name of the format. Valid values are: - * FileZilla3 - * WebDeploy -- default - * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * @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 @@ -21998,7 +22131,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -22006,58 +22139,59 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [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, options?: { format? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, callback: ServiceCallback): void; - listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, options: { format? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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 Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -22070,200 +22204,53 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - recoverWithHttpOperationResponse(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + restoreSnapshotWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.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. - */ - recover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - recover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, callback: ServiceCallback): void; - recover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, 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 {string} [restoreRequest.kind] Kind of resource. * * @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 * @@ -22288,9 +22275,9 @@ export interface WebApps { * * {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; + 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; /** @@ -22735,6 +22722,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -22753,6 +22742,9 @@ export interface WebApps { * @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. @@ -22951,6 +22943,12 @@ export interface WebApps { * @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. * @@ -22961,6 +22959,13 @@ export interface WebApps { * 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. @@ -23036,43 +23041,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -23080,7 +23048,10 @@ export interface WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -23093,19 +23064,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -23115,7 +23073,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + 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 @@ -23147,6 +23105,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -23165,6 +23125,9 @@ export interface WebApps { * @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. @@ -23363,6 +23326,12 @@ export interface WebApps { * @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. * @@ -23373,6 +23342,13 @@ export interface WebApps { * 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. @@ -23448,43 +23424,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -23492,7 +23431,10 @@ export interface WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -23505,19 +23447,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -23543,9 +23472,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + 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: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -23571,9 +23500,6 @@ export interface WebApps { * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -23583,7 +23509,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - deleteSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, skipDnsRegistration? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + 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. @@ -23608,9 +23534,6 @@ export interface WebApps { * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -23635,9 +23558,9 @@ export interface WebApps { * * {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, skipDnsRegistration? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + 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, skipDnsRegistration? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteSlot(resourceGroupName: string, name: string, slot: string, options: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -23670,6 +23593,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -23688,6 +23613,9 @@ export interface WebApps { * @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. @@ -23886,6 +23814,12 @@ export interface WebApps { * @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. * @@ -23896,6 +23830,13 @@ export interface WebApps { * 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. @@ -23971,43 +23912,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -24019,19 +23923,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -24041,7 +23932,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - updateSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, slot: string, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + 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 @@ -24073,6 +23964,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -24091,6 +23984,9 @@ export interface WebApps { * @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. @@ -24289,6 +24185,12 @@ export interface WebApps { * @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. * @@ -24299,6 +24201,13 @@ export interface WebApps { * 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. @@ -24374,43 +24283,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -24422,19 +24294,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -24460,9 +24319,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - updateSlot(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, slot: string, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + 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: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + updateSlot(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -24646,8 +24505,6 @@ export interface WebApps { * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName 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. @@ -24678,9 +24535,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -24712,8 +24566,6 @@ export interface WebApps { * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName 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. @@ -24744,9 +24596,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -24855,163 +24704,6 @@ export interface WebApps { listBackupsSlot(resourceGroupName: string, name: 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. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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. - */ - discoverRestoreSlotWithHttpOperationResponse(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. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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. - */ - discoverRestoreSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - discoverRestoreSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, callback: ServiceCallback): void; - discoverRestoreSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - /** * @summary Gets a backup of an app by its ID. * @@ -25181,8 +24873,6 @@ export interface WebApps { * * @param {object} request Information on backup request. * - * @param {string} request.backupRequestName 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. @@ -25213,9 +24903,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -25254,8 +24941,6 @@ export interface WebApps { * * @param {object} request Information on backup request. * - * @param {string} request.backupRequestName 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. @@ -25286,9 +24971,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -25369,7 +25051,7 @@ export interface WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -25390,11 +25072,11 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @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>; + 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 @@ -25439,7 +25121,7 @@ export interface WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -25465,7 +25147,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {RestoreResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -25473,16 +25155,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestoreResponse} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} 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. */ - 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; + 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; /** @@ -25790,6 +25471,9 @@ export interface WebApps { * 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 @@ -25959,6 +25643,9 @@ export interface WebApps { * 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 @@ -26155,8 +25842,6 @@ export interface WebApps { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName 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. @@ -26187,9 +25872,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -26221,8 +25903,6 @@ export interface WebApps { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName 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. @@ -26253,9 +25933,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -27252,23 +26929,95 @@ export interface WebApps { * * {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; + 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 the Push settings associated with web app. + * @summary Gets a Swift Virtual Network connection. * - * Gets the Push settings associated with web app. + * Gets a Swift Virtual Network connection. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -27277,24 +27026,25 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @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>; + getSwiftVirtualNetworkConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets the Push settings associated with web app. + * @summary Gets a Swift Virtual Network connection. * - * Gets the Push settings associated with web app. + * Gets a Swift Virtual Network connection. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -27308,7 +27058,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {PushSettings} - The deserialized result object. + * @resolve {SwiftVirtualNetwork} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -27316,16 +27066,302 @@ export interface WebApps { * * {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. + * {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. */ - 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; + 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; /** @@ -27430,6 +27466,9 @@ export interface WebApps { * * @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. * @@ -27607,6 +27646,12 @@ export interface WebApps { * @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 @@ -27616,6 +27661,13 @@ export interface WebApps { * 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 @@ -27661,6 +27713,9 @@ export interface WebApps { * * @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. * @@ -27838,6 +27893,12 @@ export interface WebApps { * @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 @@ -27847,6 +27908,13 @@ export interface WebApps { * 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 @@ -27911,6 +27979,9 @@ export interface WebApps { * * @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. * @@ -28088,6 +28159,12 @@ export interface WebApps { * @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 @@ -28097,6 +28174,13 @@ export interface WebApps { * 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 @@ -28142,6 +28226,9 @@ export interface WebApps { * * @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. * @@ -28319,6 +28406,12 @@ export interface WebApps { * @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 @@ -28328,6 +28421,13 @@ export interface WebApps { * 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 @@ -28686,7 +28786,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - getWebSiteContainerLogsZipSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + 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 @@ -28727,9 +28827,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getWebSiteContainerLogsZipSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getWebSiteContainerLogsZipSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - getWebSiteContainerLogsZipSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** @@ -29246,150 +29346,345 @@ export interface WebApps { * * {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; - + 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 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 {string} [deployment.deploymentId] Identifier for deployment. - * - * @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. + * @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. * - * Create a deployment for an app, or a deployment slot. + * 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 {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 {string} [deployment.deploymentId] Identifier for deployment. - * - * @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. + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. * - * {Promise} A promise is returned. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @resolve {Deployment} - The deserialized result object. + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @reject {Error|ServiceError} - The error object. + * @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. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [request.siteName] Name of an app. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. * - * {Deployment} [result] - The deserialized result object if an error did not occur. - * See {@link Deployment} for more information. + * @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. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * {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. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * Delete a deployment by its ID for an app, or a deployment slot. + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. * - * @param {string} name Name of the app. + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). * - * @param {string} id Deployment ID. + * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. + * specified, the API will perform discovery for the production slot. * * @param {object} [options] Optional Parameters. * @@ -29398,108 +29693,68 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @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>; + discoverBackupSlotWithHttpOperationResponse(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Delete a deployment by its ID for an app, or a deployment slot. + * @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. * - * Delete a deployment by its ID for an app, or a deployment slot. + * 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 {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 {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. * - * @param {string} name Name of the app. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @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} [request.blobName] Name of a blob which contains the backup. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. + * @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 {object} [options] Optional Parameters. + * @param {string} [request.siteName] Name of an app. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. * - * @returns {Promise} A promise is returned + * @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. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * @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. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * List deployment log for specific deployment for an app, or a deployment - * slot. + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. * - * @param {string} name Name of the app. + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). * - * @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} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. + * specified, the API will perform discovery for the production slot. * * @param {object} [options] Optional Parameters. * @@ -29513,7 +29768,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {Deployment} - The deserialized result object. + * @resolve {RestoreRequest} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -29521,16 +29776,16 @@ export interface WebApps { * * {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. + * {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. */ - 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; + 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; /** @@ -30456,6 +30711,8 @@ export interface WebApps { * * @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. @@ -30505,6 +30762,8 @@ export interface WebApps { * * @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. @@ -34056,25 +34315,399 @@ export interface WebApps { * * {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; + 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 a named add-on of an app. + * @summary Gets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Gets a named add-on of an app. + * 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 Name of the app. - * - * @param {string} premierAddOnName Add-on name. + * @param {string} name The name of the web app. * - * @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 {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. * @@ -34083,26 +34716,25 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @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>; + getPrivateAccessSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets a named add-on of an app. + * @summary Gets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Gets a named add-on of an app. + * 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 Name of the app. - * - * @param {string} premierAddOnName Add-on name. + * @param {string} name The name of the web app. * - * @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 {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. * @@ -34116,7 +34748,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {PremierAddOn} - The deserialized result object. + * @resolve {PrivateAccess} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -34124,59 +34756,40 @@ export interface WebApps { * * {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. + * {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. */ - 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; + 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 Updates a named add-on of an app. + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Updates a named add-on of an app. + * 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 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.premierAddOnName] Premier add on Name. + * @param {string} name The name of the web app. * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. + * @param {object} access The information for the private access * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. + * @param {boolean} [access.enabled] Whether private access is enabled or not. * - * @param {string} [premierAddOn.marketplacePublisher] Premier add on - * Marketplace publisher. + * @param {array} [access.virtualNetworks] The Virtual Networks (and subnets) + * allowed to access the site privately. * - * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace - * offer. - * - * @param {string} [premierAddOn.kind] Kind of resource. - * - * @param {string} premierAddOn.location Resource Location. + * @param {string} [access.kind] Kind of resource. * - * @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 {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. * @@ -34185,128 +34798,34 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @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.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * - * @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; - + putPrivateAccessVnetSlotWithHttpOperationResponse(resourceGroupName: string, name: string, access: models.PrivateAccess, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Delete a premier add-on from an app. + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Delete a premier add-on from an app. + * 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 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 + * @param {string} name The name of the web app. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {object} access The information for the private access * - * @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. + * @param {boolean} [access.enabled] Whether private access is enabled or not. * - * Delete a premier add-on from an app. + * @param {array} [access.virtualNetworks] The Virtual Networks (and subnets) + * allowed to access the site privately. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {string} [access.kind] Kind of resource. * - * @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 {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. * @@ -34320,7 +34839,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {PrivateAccess} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -34328,15 +34847,16 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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. */ - 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; + 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; /** @@ -35380,110 +35900,136 @@ export interface WebApps { /** - * @summary Recovers a web app to a previous snapshot. + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * Recovers a web app to a previous snapshot. + * 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 web app. + * @param {string} name Name of the app. * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API resets configuration settings for the production slot. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {object} [options] Optional Parameters. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @returns {Promise} A promise is returned * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {boolean} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. + * @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. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. + * Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * @param {boolean} [recoveryEntity.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} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {string} [recoveryEntity.kind] Kind of resource. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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 + * @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 {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - recoverSlotWithHttpOperationResponse(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + 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 Recovers a web app to a previous snapshot. + * @summary Restarts an app (or deployment slot, if specified). * - * Recovers a web app to a previous snapshot. + * 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 web app. + * @param {string} name Name of the app. * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restart the production slot. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {object} [options] Optional Parameters. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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 {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @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 {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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 {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. + * @returns {Promise} A promise is returned * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {boolean} [recoveryEntity.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. + * @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). * - * @param {string} [recoveryEntity.kind] Kind of resource. + * Restarts an app (or deployment slot, if specified). * - * @param {string} slot Name of web app slot. If not specified then will - * default to production 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 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 * @@ -35508,25 +36054,63 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - recoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - recoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, callback: ServiceCallback): void; - recoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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 Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * @summary Restores an app from a backup blob in Azure Storage. * - * Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * 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 resets configuration settings for the production slot. + * specified, the API will restore a backup of the production slot. * * @param {object} [options] Optional Parameters. * @@ -35539,22 +36123,60 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - resetSlotConfigurationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + restoreFromBackupBlobSlotWithHttpOperationResponse(resourceGroupName: string, name: string, request: models.RestoreRequest, 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. + * @summary Restores an app from a backup blob in Azure Storage. * - * Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * 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 resets configuration settings for the production slot. + * specified, the API will restore a backup of the production slot. * * @param {object} [options] Optional Parameters. * @@ -35582,33 +36204,40 @@ export interface WebApps { * * {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; + 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 Restarts an app (or deployment slot, if specified). + * @summary Restores a deleted web app to this web app. * - * Restarts an app (or deployment slot, if specified). + * 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 the app. + * @param {string} name Name of web app. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will restart the production slot. + * @param {object} restoreRequest Deleted web app restore information. * - * @param {object} [options] Optional Parameters. + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} * - * @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} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. * - * @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 {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 @@ -35619,30 +36248,173 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - restartSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { softRestart? : boolean, synchronous? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + restoreFromDeletedAppSlotWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Restarts an app (or deployment slot, if specified). + * @summary Restores a deleted web app to this web app. * - * Restarts an app (or deployment slot, if specified). + * 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 the app. + * @param {string} name Name of web app. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will restart the production slot. + * @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 {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 {object} [options.customHeaders] Headers that will be added to the + * request * - * @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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [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 @@ -35668,9 +36440,9 @@ export interface WebApps { * * {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; + 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; /** @@ -40507,6 +41279,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -40525,6 +41299,9 @@ export interface WebApps { * @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. @@ -40723,6 +41500,12 @@ export interface WebApps { * @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. * @@ -40733,6 +41516,13 @@ export interface WebApps { * 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. @@ -40808,43 +41598,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -40852,7 +41605,10 @@ export interface WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -40903,6 +41659,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -40921,6 +41679,9 @@ export interface WebApps { * @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. @@ -41119,6 +41880,12 @@ export interface WebApps { * @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. * @@ -41129,6 +41896,13 @@ export interface WebApps { * 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. @@ -41204,43 +41978,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -41248,7 +41985,10 @@ export interface WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -41331,7 +42071,7 @@ export interface WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -41349,11 +42089,11 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @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>; + 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 @@ -41398,7 +42138,7 @@ export interface WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -41421,7 +42161,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {RestoreResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -41429,16 +42169,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestoreResponse} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} 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. */ - 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; + 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; /** @@ -41641,6 +42380,8 @@ export interface WebApps { * * @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. @@ -41687,6 +42428,8 @@ export interface WebApps { * * @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. @@ -42057,46 +42800,285 @@ export interface WebApps { /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores an app from a backup blob in Azure Storage. * - * Recovers a web app to a previous snapshot. + * 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -42109,49 +43091,50 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - beginRecoverWithHttpOperationResponse(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginRestoreSnapshotWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -42179,9 +43162,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginRecover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginRecover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, callback: ServiceCallback): void; - beginRecover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** @@ -42283,6 +43266,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -42301,6 +43286,9 @@ export interface WebApps { * @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. @@ -42499,6 +43487,12 @@ export interface WebApps { * @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. * @@ -42509,6 +43503,13 @@ export interface WebApps { * 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. @@ -42584,43 +43585,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -42628,7 +43592,10 @@ export interface WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -42641,19 +43608,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -42663,7 +43617,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + 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 @@ -42695,6 +43649,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -42713,6 +43669,9 @@ export interface WebApps { * @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. @@ -42911,6 +43870,12 @@ export interface WebApps { * @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. * @@ -42921,6 +43886,13 @@ export interface WebApps { * 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. @@ -42996,43 +43968,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -43040,7 +43975,10 @@ export interface WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -43053,19 +43991,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -43091,9 +44016,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + 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: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -43139,7 +44064,7 @@ export interface WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -43160,11 +44085,11 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @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>; + 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 @@ -43209,7 +44134,7 @@ export interface WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -43235,7 +44160,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {RestoreResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -43243,16 +44168,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestoreResponse} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} 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. */ - 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; + 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; /** @@ -43472,6 +44396,8 @@ export interface WebApps { * * @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. @@ -43521,6 +44447,8 @@ export interface WebApps { * * @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. @@ -43704,46 +44632,297 @@ export interface WebApps { /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores an app from a backup blob in Azure Storage. * - * Recovers a web app to a previous snapshot. + * 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will * default to production slot. @@ -43759,49 +44938,50 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - beginRecoverSlotWithHttpOperationResponse(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginRestoreSnapshotSlotWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will * default to production slot. @@ -43832,9 +45012,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginRecoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginRecoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, callback: ServiceCallback): void; - beginRecoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** @@ -48058,6 +49238,15 @@ export interface AppServiceEnvironments { * @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. @@ -48161,6 +49350,15 @@ export interface AppServiceEnvironments { * @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. @@ -48356,6 +49554,15 @@ export interface AppServiceEnvironments { * @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. @@ -48455,6 +49662,15 @@ export interface AppServiceEnvironments { * @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. @@ -48625,6 +49841,83 @@ export interface AppServiceEnvironments { 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. * @@ -51341,6 +52634,15 @@ export interface AppServiceEnvironments { * @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. @@ -51444,6 +52746,15 @@ export interface AppServiceEnvironments { * @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. @@ -51555,6 +52866,83 @@ export interface AppServiceEnvironments { 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. * @@ -52217,6 +53605,67 @@ export interface AppServiceEnvironments { 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. * @@ -53474,6 +54923,67 @@ export interface AppServiceEnvironments { 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. * @@ -53810,9 +55320,6 @@ export interface AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -53836,9 +55343,15 @@ export interface AppServicePlans { * @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] 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. @@ -53908,9 +55421,6 @@ export interface AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -53934,9 +55444,15 @@ export interface AppServicePlans { * @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] 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. @@ -54089,9 +55605,6 @@ export interface AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanPatchResourceName Name for the - * App Service plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -54115,9 +55628,15 @@ export interface AppServicePlans { * @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] 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. @@ -54149,9 +55668,6 @@ export interface AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanPatchResourceName Name for the - * App Service plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -54175,9 +55691,15 @@ export interface AppServicePlans { * @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] 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. @@ -55619,9 +57141,6 @@ export interface AppServicePlans { * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @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. @@ -55669,9 +57188,6 @@ export interface AppServicePlans { * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @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. @@ -55810,9 +57326,6 @@ export interface AppServicePlans { * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @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. @@ -55860,9 +57373,6 @@ export interface AppServicePlans { * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @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. @@ -55995,9 +57505,6 @@ export interface AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -56021,9 +57528,15 @@ export interface AppServicePlans { * @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] 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. @@ -56093,9 +57606,6 @@ export interface AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -56119,9 +57629,15 @@ export interface AppServicePlans { * @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] 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. diff --git a/lib/services/websiteManagement2/lib/operations/index.js b/lib/services/websiteManagement2/lib/operations/index.js index 3a92dd8e10..b0fdef3f0a 100644 --- a/lib/services/websiteManagement2/lib/operations/index.js +++ b/lib/services/websiteManagement2/lib/operations/index.js @@ -24,8 +24,6 @@ exports.DeletedWebApps = require('./deletedWebApps'); exports.Diagnostics = require('./diagnostics'); exports.Provider = require('./provider'); exports.Recommendations = require('./recommendations'); -exports.ResourceHealthMetadataOperations = require('./resourceHealthMetadataOperations'); -exports.BillingMeters = require('./billingMeters'); exports.WebApps = require('./webApps'); exports.AppServiceEnvironments = require('./appServiceEnvironments'); exports.AppServicePlans = require('./appServicePlans'); diff --git a/lib/services/websiteManagement2/lib/operations/provider.js b/lib/services/websiteManagement2/lib/operations/provider.js index e65baac626..064fc16469 100644 --- a/lib/services/websiteManagement2/lib/operations/provider.js +++ b/lib/services/websiteManagement2/lib/operations/provider.js @@ -52,12 +52,14 @@ function _getAvailableStacks(options, callback) { throw new Error('callback cannot be null.'); } let osTypeSelected = (options && options.osTypeSelected !== undefined) ? options.osTypeSelected : undefined; - let apiVersion = '2016-03-01'; // 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.'); } @@ -72,7 +74,7 @@ function _getAvailableStacks(options, callback) { if (osTypeSelected !== null && osTypeSelected !== undefined) { queryParameters.push('osTypeSelected=' + encodeURIComponent(osTypeSelected)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -114,12 +116,13 @@ function _getAvailableStacks(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -190,9 +193,11 @@ function _listOperations(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-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.'); } @@ -204,7 +209,7 @@ function _listOperations(options, callback) { let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/operations'; let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -246,12 +251,13 @@ function _listOperations(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -324,7 +330,6 @@ function _getAvailableStacksOnPrem(options, callback) { throw new Error('callback cannot be null.'); } let osTypeSelected = (options && options.osTypeSelected !== undefined) ? options.osTypeSelected : undefined; - let apiVersion = '2016-03-01'; // Validate try { if (osTypeSelected !== null && osTypeSelected !== undefined && typeof osTypeSelected.valueOf() !== 'string') { @@ -333,6 +338,9 @@ function _getAvailableStacksOnPrem(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -348,7 +356,7 @@ function _getAvailableStacksOnPrem(options, callback) { if (osTypeSelected !== null && osTypeSelected !== undefined) { queryParameters.push('osTypeSelected=' + encodeURIComponent(osTypeSelected)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -390,12 +398,13 @@ function _getAvailableStacksOnPrem(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -520,12 +529,13 @@ function _getAvailableStacksNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -652,12 +662,13 @@ function _listOperationsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -782,12 +793,13 @@ function _getAvailableStacksOnPremNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { diff --git a/lib/services/websiteManagement2/lib/operations/recommendations.js b/lib/services/websiteManagement2/lib/operations/recommendations.js index 66adb54b6a..9a5449c349 100644 --- a/lib/services/websiteManagement2/lib/operations/recommendations.js +++ b/lib/services/websiteManagement2/lib/operations/recommendations.js @@ -59,7 +59,6 @@ function _list(options, callback) { } let featured = (options && options.featured !== undefined) ? options.featured : undefined; let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-03-01'; // Validate try { if (featured !== null && featured !== undefined && typeof featured !== 'boolean') { @@ -71,6 +70,9 @@ function _list(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -89,7 +91,7 @@ function _list(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('&'); } @@ -131,12 +133,13 @@ function _list(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -203,12 +206,14 @@ function _resetAllFilters(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -221,7 +226,7 @@ function _resetAllFilters(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -322,7 +327,6 @@ function _disableRecommendationForSubscription(name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { @@ -331,6 +335,9 @@ function _disableRecommendationForSubscription(name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -344,7 +351,7 @@ function _disableRecommendationForSubscription(name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -422,6 +429,10 @@ function _disableRecommendationForSubscription(name, options, callback) { * * @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=channels eq 'Api' or channel eq 'Notification' and * startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' @@ -454,8 +465,8 @@ function _listHistoryForWebApp(resourceGroupName, siteName, options, callback) { 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; - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -478,12 +489,18 @@ function _listHistoryForWebApp(resourceGroupName, siteName, options, callback) { 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.'); } @@ -498,10 +515,13 @@ function _listHistoryForWebApp(resourceGroupName, siteName, options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -543,12 +563,13 @@ function _listHistoryForWebApp(resourceGroupName, siteName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -632,7 +653,6 @@ function _listRecommendedRulesForWebApp(resourceGroupName, siteName, options, ca } let featured = (options && options.featured !== undefined) ? options.featured : undefined; let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -664,6 +684,9 @@ function _listRecommendedRulesForWebApp(resourceGroupName, siteName, options, ca if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -684,7 +707,7 @@ function _listRecommendedRulesForWebApp(resourceGroupName, siteName, options, ca 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('&'); } @@ -726,12 +749,13 @@ function _listRecommendedRulesForWebApp(resourceGroupName, siteName, options, ca try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -803,7 +827,6 @@ function _disableAllForWebApp(resourceGroupName, siteName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -829,6 +852,9 @@ function _disableAllForWebApp(resourceGroupName, siteName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -843,7 +869,7 @@ function _disableAllForWebApp(resourceGroupName, siteName, options, callback) { requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); 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('&'); } @@ -945,7 +971,6 @@ function _resetAllFiltersForWebApp(resourceGroupName, siteName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -971,6 +996,9 @@ function _resetAllFiltersForWebApp(resourceGroupName, siteName, options, callbac if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -985,7 +1013,7 @@ function _resetAllFiltersForWebApp(resourceGroupName, siteName, options, callbac requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); 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('&'); } @@ -1099,7 +1127,6 @@ function _getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, cal } let updateSeen = (options && options.updateSeen !== undefined) ? options.updateSeen : undefined; let recommendationId = (options && options.recommendationId !== undefined) ? options.recommendationId : undefined; - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1134,6 +1161,9 @@ function _getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, cal if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1155,7 +1185,7 @@ function _getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, cal if (recommendationId !== null && recommendationId !== undefined) { queryParameters.push('recommendationId=' + encodeURIComponent(recommendationId)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1197,12 +1227,13 @@ function _getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, cal try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1276,7 +1307,6 @@ function _disableRecommendationForSite(resourceGroupName, siteName, name, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1305,6 +1335,9 @@ function _disableRecommendationForSite(resourceGroupName, siteName, name, option if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1320,7 +1353,7 @@ function _disableRecommendationForSite(resourceGroupName, siteName, name, option requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1475,12 +1508,13 @@ function _listNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1606,12 +1640,13 @@ function _listHistoryForWebAppNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1736,12 +1771,13 @@ function _listRecommendedRulesForWebAppNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2082,6 +2118,10 @@ class Recommendations { * * @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=channels eq 'Api' or channel eq 'Notification' and * startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' @@ -2123,6 +2163,10 @@ class Recommendations { * * @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=channels eq 'Api' or channel eq 'Notification' and * startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' diff --git a/lib/services/websiteManagement2/lib/operations/topLevelDomains.js b/lib/services/websiteManagement2/lib/operations/topLevelDomains.js index ed6c81ea55..20fa9e42ae 100644 --- a/lib/services/websiteManagement2/lib/operations/topLevelDomains.js +++ b/lib/services/websiteManagement2/lib/operations/topLevelDomains.js @@ -48,12 +48,14 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -66,7 +68,7 @@ function _list(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -108,12 +110,13 @@ function _list(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -183,7 +186,6 @@ function _get(name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { @@ -192,6 +194,9 @@ function _get(name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -205,7 +210,7 @@ function _get(name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -247,12 +252,13 @@ function _get(name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -335,7 +341,6 @@ function _listAgreements(name, agreementOption, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { @@ -347,6 +352,9 @@ function _listAgreements(name, agreementOption, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -360,7 +368,7 @@ function _listAgreements(name, agreementOption, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -416,12 +424,13 @@ function _listAgreements(name, agreementOption, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -546,12 +555,13 @@ function _listNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -678,12 +688,13 @@ function _listAgreementsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { diff --git a/lib/services/websiteManagement2/lib/operations/webApps.js b/lib/services/websiteManagement2/lib/operations/webApps.js index 87b187db29..1ddf143e63 100644 --- a/lib/services/websiteManagement2/lib/operations/webApps.js +++ b/lib/services/websiteManagement2/lib/operations/webApps.js @@ -47,12 +47,14 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -65,7 +67,7 @@ function _list(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -107,12 +109,13 @@ function _list(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -188,7 +191,6 @@ function _listByResourceGroup(resourceGroupName, options, callback) { throw new Error('callback cannot be null.'); } let includeSlots = (options && options.includeSlots !== undefined) ? options.includeSlots : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -214,6 +216,9 @@ function _listByResourceGroup(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -230,7 +235,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (includeSlots !== null && includeSlots !== undefined) { queryParameters.push('includeSlots=' + encodeURIComponent(includeSlots.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -272,12 +277,13 @@ function _listByResourceGroup(resourceGroupName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -350,7 +356,6 @@ function _get(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -376,6 +381,9 @@ function _get(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -390,7 +398,7 @@ function _get(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -503,6 +511,8 @@ function _get(resourceGroupName, name, options, callback) { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -521,6 +531,9 @@ function _get(resourceGroupName, name, options, callback) { * @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. @@ -719,6 +732,12 @@ function _get(resourceGroupName, name, options, callback) { * @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. * @@ -729,6 +748,13 @@ function _get(resourceGroupName, name, options, callback) { * 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. @@ -804,43 +830,6 @@ function _get(resourceGroupName, name, options, callback) { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -848,7 +837,10 @@ function _get(resourceGroupName, name, options, callback) { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -973,7 +965,6 @@ function _deleteMethod(resourceGroupName, name, options, callback) { } let deleteMetrics = (options && options.deleteMetrics !== undefined) ? options.deleteMetrics : undefined; let deleteEmptyServerFarm = (options && options.deleteEmptyServerFarm !== undefined) ? options.deleteEmptyServerFarm : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1005,6 +996,9 @@ function _deleteMethod(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1025,7 +1019,7 @@ function _deleteMethod(resourceGroupName, name, options, callback) { if (deleteEmptyServerFarm !== null && deleteEmptyServerFarm !== undefined) { queryParameters.push('deleteEmptyServerFarm=' + encodeURIComponent(deleteEmptyServerFarm.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1120,6 +1114,8 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -1138,6 +1134,9 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * @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. @@ -1336,6 +1335,12 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * @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. * @@ -1346,6 +1351,13 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * 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. @@ -1421,43 +1433,6 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -1492,7 +1467,6 @@ function _update(resourceGroupName, name, siteEnvelope, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1521,6 +1495,9 @@ function _update(resourceGroupName, name, siteEnvelope, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1535,7 +1512,7 @@ function _update(resourceGroupName, name, siteEnvelope, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1591,12 +1568,13 @@ function _update(resourceGroupName, name, siteEnvelope, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1690,7 +1668,6 @@ function _analyzeCustomHostname(resourceGroupName, name, options, callback) { throw new Error('callback cannot be null.'); } let hostName = (options && options.hostName !== undefined) ? options.hostName : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1719,6 +1696,9 @@ function _analyzeCustomHostname(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1736,7 +1716,7 @@ function _analyzeCustomHostname(resourceGroupName, name, options, callback) { if (hostName !== null && hostName !== undefined) { queryParameters.push('hostName=' + encodeURIComponent(hostName)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1778,12 +1758,13 @@ function _analyzeCustomHostname(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1866,7 +1847,6 @@ function _applySlotConfigToProduction(resourceGroupName, name, slotSwapEntity, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1895,6 +1875,9 @@ function _applySlotConfigToProduction(resourceGroupName, name, slotSwapEntity, o if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1909,7 +1892,7 @@ function _applySlotConfigToProduction(resourceGroupName, name, slotSwapEntity, o requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -2001,8 +1984,6 @@ function _applySlotConfigToProduction(resourceGroupName, name, slotSwapEntity, o * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName 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. @@ -2033,9 +2014,6 @@ function _applySlotConfigToProduction(resourceGroupName, name, slotSwapEntity, o * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -2066,7 +2044,6 @@ function _backup(resourceGroupName, name, request, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2095,6 +2072,9 @@ function _backup(resourceGroupName, name, request, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2109,7 +2089,7 @@ function _backup(resourceGroupName, name, request, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -2165,12 +2145,13 @@ function _backup(resourceGroupName, name, request, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2243,7 +2224,6 @@ function _listBackups(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2269,6 +2249,9 @@ function _listBackups(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2283,7 +2266,7 @@ function _listBackups(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -2325,12 +2308,13 @@ function _listBackups(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2366,57 +2350,185 @@ function _listBackups(resourceGroupName, name, options, callback) { } /** - * @summary Discovers an existing app backup that can be restored from a blob - * in Azure storage. + * @summary Gets a backup of an app by its ID. * - * Discovers an existing app backup that can be restored from a blob in Azure - * storage. + * 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 {object} request A RestoreRequest object that includes Azure storage - * URL and blog name for discovery of backup. + * @param {string} backupId ID of the backup. * - * @param {string} request.storageAccountUrl SAS URL to the container. + * @param {object} [options] Optional Parameters. * - * @param {string} [request.blobName] Name of a blob which contains the backup. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @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 {function} callback - The callback. * - * @param {string} [request.siteName] Name of an app. + * @returns {function} callback(err, result, request, response) * - * @param {array} [request.databases] Collection of databases which should be - * restored. This list has to match the list of databases included in the - * backup. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @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. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackupItem} for more information. * - * @param {boolean} [request.ignoreDatabases] Ignore the databases and only - * restore the site content + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [request.appServicePlan] Specify app service plan that will - * own restored site. + * {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. * - * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * Deletes a backup of an app by its ID. * - * @param {boolean} [request.adjustConnectionStrings] true if - * SiteConfig.ConnectionStrings should be set in new app; otherwise, - * false. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {string} [request.hostingEnvironment] App Service Environment name, - * if needed (only when restoring an app to an App Service Environment). + * @param {string} name Name of the app. * - * @param {string} [request.kind] Kind of resource. + * @param {string} backupId ID of the backup. * * @param {object} [options] Optional Parameters. * @@ -2429,14 +2541,13 @@ function _listBackups(resourceGroupName, name, 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 RestoreRequest} 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 _discoverRestore(resourceGroupName, name, request, options, callback) { +function _deleteBackup(resourceGroupName, name, backupId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2446,186 +2557,6 @@ function _discoverRestore(resourceGroupName, name, request, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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/discover'; - 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(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['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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 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.'); - } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2654,170 +2585,8 @@ function _getBackupStatus(resourceGroupName, name, backupId, 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 (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.'); @@ -2834,7 +2603,7 @@ function _deleteBackup(resourceGroupName, name, backupId, options, callback) { requestUrl = requestUrl.replace('{backupId}', encodeURIComponent(backupId)); 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('&'); } @@ -2919,8 +2688,6 @@ function _deleteBackup(resourceGroupName, name, backupId, options, callback) { * * @param {object} request Information on backup request. * - * @param {string} request.backupRequestName 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. @@ -2951,9 +2718,6 @@ function _deleteBackup(resourceGroupName, name, backupId, options, callback) { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -2984,7 +2748,6 @@ function _listBackupStatusSecrets(resourceGroupName, name, backupId, request, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3016,6 +2779,9 @@ function _listBackupStatusSecrets(resourceGroupName, name, backupId, request, op if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3031,7 +2797,7 @@ function _listBackupStatusSecrets(resourceGroupName, name, backupId, request, op requestUrl = requestUrl.replace('{backupId}', encodeURIComponent(backupId)); 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('&'); } @@ -3087,12 +2853,13 @@ function _listBackupStatusSecrets(resourceGroupName, name, backupId, request, op try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3171,7 +2938,7 @@ function _listBackupStatusSecrets(resourceGroupName, name, backupId, request, op * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -3193,8 +2960,7 @@ function _listBackupStatusSecrets(resourceGroupName, name, backupId, request, op * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} 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. * @@ -3232,20 +2998,6 @@ function _restore(resourceGroupName, name, backupId, request, 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['RestoreResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } return callback(null, result, httpRequest, response); }); @@ -3291,7 +3043,6 @@ function _listConfigurations(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3317,6 +3068,9 @@ function _listConfigurations(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3331,7 +3085,7 @@ function _listConfigurations(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -3373,12 +3127,13 @@ function _listConfigurations(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3457,7 +3212,6 @@ function _updateApplicationSettings(resourceGroupName, name, appSettings, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3486,6 +3240,9 @@ function _updateApplicationSettings(resourceGroupName, name, appSettings, option if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3500,7 +3257,7 @@ function _updateApplicationSettings(resourceGroupName, name, appSettings, option requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -3556,12 +3313,13 @@ function _updateApplicationSettings(resourceGroupName, name, appSettings, option try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3634,7 +3392,6 @@ function _listApplicationSettings(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3660,6 +3417,9 @@ function _listApplicationSettings(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3674,7 +3434,7 @@ function _listApplicationSettings(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -3716,12 +3476,13 @@ function _listApplicationSettings(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3831,6 +3592,9 @@ function _listApplicationSettings(resourceGroupName, name, options, callback) { * 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 @@ -3937,7 +3701,6 @@ function _updateAuthSettings(resourceGroupName, name, siteAuthSettings, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3966,6 +3729,9 @@ function _updateAuthSettings(resourceGroupName, name, siteAuthSettings, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3980,7 +3746,7 @@ function _updateAuthSettings(resourceGroupName, name, siteAuthSettings, options, requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -4036,12 +3802,13 @@ function _updateAuthSettings(resourceGroupName, name, siteAuthSettings, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4114,7 +3881,6 @@ function _getAuthSettings(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4140,6 +3906,9 @@ function _getAuthSettings(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4154,7 +3923,7 @@ function _getAuthSettings(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -4196,12 +3965,13 @@ function _getAuthSettings(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4248,8 +4018,6 @@ function _getAuthSettings(resourceGroupName, name, options, callback) { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName 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. @@ -4280,9 +4048,6 @@ function _getAuthSettings(resourceGroupName, name, options, callback) { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -4313,7 +4078,6 @@ function _updateBackupConfiguration(resourceGroupName, name, request, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4342,6 +4106,9 @@ function _updateBackupConfiguration(resourceGroupName, name, request, options, c if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4356,7 +4123,7 @@ function _updateBackupConfiguration(resourceGroupName, name, request, options, c requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -4412,12 +4179,13 @@ function _updateBackupConfiguration(resourceGroupName, name, request, options, c try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4489,7 +4257,6 @@ function _deleteBackupConfiguration(resourceGroupName, name, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4515,6 +4282,9 @@ function _deleteBackupConfiguration(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4529,7 +4299,7 @@ function _deleteBackupConfiguration(resourceGroupName, name, options, callback) requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -4632,7 +4402,6 @@ function _getBackupConfiguration(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4658,6 +4427,9 @@ function _getBackupConfiguration(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4672,7 +4444,7 @@ function _getBackupConfiguration(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -4714,12 +4486,13 @@ function _getBackupConfiguration(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4800,7 +4573,6 @@ function _updateConnectionStrings(resourceGroupName, name, connectionStrings, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4829,6 +4601,9 @@ function _updateConnectionStrings(resourceGroupName, name, connectionStrings, op if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4843,7 +4618,7 @@ function _updateConnectionStrings(resourceGroupName, name, connectionStrings, op requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -4899,12 +4674,13 @@ function _updateConnectionStrings(resourceGroupName, name, connectionStrings, op try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4978,7 +4754,6 @@ function _listConnectionStrings(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5004,6 +4779,9 @@ function _listConnectionStrings(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -5018,7 +4796,7 @@ function _listConnectionStrings(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -5060,12 +4838,13 @@ function _listConnectionStrings(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5138,7 +4917,6 @@ function _getDiagnosticLogsConfiguration(resourceGroupName, name, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5164,6 +4942,9 @@ function _getDiagnosticLogsConfiguration(resourceGroupName, name, options, callb if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -5178,7 +4959,7 @@ function _getDiagnosticLogsConfiguration(resourceGroupName, name, options, callb requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -5220,12 +5001,13 @@ function _getDiagnosticLogsConfiguration(resourceGroupName, name, options, callb try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5382,7 +5164,6 @@ function _updateDiagnosticLogsConfig(resourceGroupName, name, siteLogsConfig, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5411,6 +5192,9 @@ function _updateDiagnosticLogsConfig(resourceGroupName, name, siteLogsConfig, op if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -5425,7 +5209,7 @@ function _updateDiagnosticLogsConfig(resourceGroupName, name, siteLogsConfig, op requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -5481,12 +5265,13 @@ function _updateDiagnosticLogsConfig(resourceGroupName, name, siteLogsConfig, op try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5566,7 +5351,6 @@ function _updateMetadata(resourceGroupName, name, metadata, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5595,6 +5379,9 @@ function _updateMetadata(resourceGroupName, name, metadata, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -5609,7 +5396,7 @@ function _updateMetadata(resourceGroupName, name, metadata, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -5665,12 +5452,13 @@ function _updateMetadata(resourceGroupName, name, metadata, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5743,7 +5531,6 @@ function _listMetadata(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5769,6 +5556,9 @@ function _listMetadata(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -5783,7 +5573,7 @@ function _listMetadata(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -5825,12 +5615,13 @@ function _listMetadata(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6006,7 +5797,6 @@ function _updateSitePushSettings(resourceGroupName, name, pushSettings, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6035,6 +5825,9 @@ function _updateSitePushSettings(resourceGroupName, name, pushSettings, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -6049,7 +5842,7 @@ function _updateSitePushSettings(resourceGroupName, name, pushSettings, options, requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -6105,12 +5898,13 @@ function _updateSitePushSettings(resourceGroupName, name, pushSettings, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6183,7 +5977,6 @@ function _listSitePushSettings(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6209,6 +6002,9 @@ function _listSitePushSettings(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -6223,7 +6019,7 @@ function _listSitePushSettings(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -6265,12 +6061,13 @@ function _listSitePushSettings(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6346,7 +6143,6 @@ function _listSlotConfigurationNames(resourceGroupName, name, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6372,6 +6168,9 @@ function _listSlotConfigurationNames(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -6386,7 +6185,7 @@ function _listSlotConfigurationNames(resourceGroupName, name, options, callback) requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -6428,12 +6227,13 @@ function _listSlotConfigurationNames(resourceGroupName, name, options, callback) try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6520,7 +6320,6 @@ function _updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6549,6 +6348,9 @@ function _updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -6563,7 +6365,7 @@ function _updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -6619,12 +6421,13 @@ function _updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6660,11 +6463,9 @@ function _updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, } /** - * @summary Gets the configuration of an app, such as platform version and - * bitness, default documents, virtual applications, Always On, etc. + * @summary Gets a Swift Virtual Network connection. * - * Gets the configuration of an app, such as platform version and bitness, - * default documents, virtual applications, Always On, etc. + * Gets a Swift Virtual Network connection. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -6683,13 +6484,13 @@ function _updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, * {Error} 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. + * 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 _getConfiguration(resourceGroupName, name, options, callback) { +function _getSwiftVirtualNetworkConnection(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -6699,7 +6500,6 @@ function _getConfiguration(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6725,6 +6525,9 @@ function _getConfiguration(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -6734,12 +6537,12 @@ function _getConfiguration(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -6781,12 +6584,13 @@ function _getConfiguration(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6806,7 +6610,7 @@ function _getConfiguration(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigResource']().mapper(); + let resultMapper = new client.models['SwiftVirtualNetwork']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -6822,219 +6626,32 @@ function _getConfiguration(resourceGroupName, name, options, callback) { } /** - * @summary Updates the configuration of an app. + * @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. * - * Updates the configuration of an app. + * 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} 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 {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 {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 {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. * - * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web - * site to allow clients to connect over http2.0 + * @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 {string} [siteConfig.minTlsVersion] MinTlsVersion: configures the - * minimum version of TLS required for SSL requests. Possible values include: - * '1.0', '1.1', '1.2' + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. * - * @param {string} [siteConfig.kind] Kind of resource. + * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -7048,13 +6665,13 @@ function _getConfiguration(resourceGroupName, name, 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 SiteConfigResource} for more information. + * 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 _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, options, callback) { +function _createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -7064,7 +6681,6 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7087,12 +6703,15 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, optio if (name === 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 (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.'); } @@ -7102,12 +6721,12 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, optio // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -7136,14 +6755,14 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, optio 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'); + 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(siteConfig, null, 2)}.`); + `payload - ${JSON.stringify(connectionEnvelope, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -7163,12 +6782,13 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, optio try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -7188,7 +6808,7 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, optio parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigResource']().mapper(); + let resultMapper = new client.models['SwiftVirtualNetwork']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -7204,220 +6824,16 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, optio } /** - * @summary Updates the configuration of an app. + * @summary Deletes a Swift Virtual Network connection from an app (or + * deployment slot). * - * Updates the configuration of an app. + * 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} 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 {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 {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 {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.kind] Kind of resource. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7429,14 +6845,13 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, 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 SiteConfigResource} 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 _updateConfiguration(resourceGroupName, name, siteConfig, options, callback) { +function _deleteSwiftVirtualNetwork(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -7446,7 +6861,6 @@ function _updateConfiguration(resourceGroupName, name, siteConfig, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7469,12 +6883,12 @@ function _updateConfiguration(resourceGroupName, name, siteConfig, options, call if (name === 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.'); } @@ -7484,19 +6898,19 @@ function _updateConfiguration(resourceGroupName, name, siteConfig, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'; + 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(apiVersion)); + queryParameters.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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -7514,28 +6928,14 @@ function _updateConfiguration(resourceGroupName, name, siteConfig, options, call } } } - // 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; + httpRequest.body = null; // 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 !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -7563,40 +6963,39 @@ function _updateConfiguration(resourceGroupName, name, siteConfig, options, call // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @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. * - * Gets a list of web app configuration snapshots identifiers. Each element of - * the list contains a timestamp and the ID of the snapshot. + * 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 @@ -7609,14 +7008,13 @@ function _updateConfiguration(resourceGroupName, name, siteConfig, options, call * {Error} 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. + * 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 _listConfigurationSnapshotInfo(resourceGroupName, name, options, callback) { +function _updateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -7626,7 +7024,6 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7649,9 +7046,15 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callba if (name === 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.'); } @@ -7661,19 +7064,19 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callba // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots'; + 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(apiVersion)); + queryParameters.push('api-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 = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -7691,7 +7094,21 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callba } } } - httpRequest.body = null; + // 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) { @@ -7708,12 +7125,13 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callba try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -7733,7 +7151,7 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callba parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigurationSnapshotInfoCollection']().mapper(); + let resultMapper = new client.models['SwiftVirtualNetwork']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -7749,18 +7167,17 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callba } /** - * @summary Gets a snapshot of the configuration of an app at a previous point - * in time. + * @summary Gets the configuration of an app, such as platform version and + * bitness, default documents, virtual applications, Always On, etc. * - * Gets a snapshot of the configuration of an app at a previous point in time. + * 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} snapshotId The ID of the snapshot to read. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7779,7 +7196,7 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callba * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, callback) { +function _getConfiguration(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -7789,7 +7206,6 @@ function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7812,12 +7228,12 @@ function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, if (name === 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.'); } @@ -7827,13 +7243,12 @@ function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, // 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}'; + 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('{snapshotId}', encodeURIComponent(snapshotId)); 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('&'); } @@ -7875,12 +7290,13 @@ function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -7916,191 +7332,264 @@ function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, } /** - * @summary Reverts the configuration of an app to a previous snapshot. + * @summary Updates the configuration of an app. * - * Reverts the configuration of an app to a previous snapshot. + * 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 {string} snapshotId The ID of the snapshot to read. + * @param {object} siteConfig JSON representation of a SiteConfig object. See + * example. * - * @param {object} [options] Optional Parameters. + * @param {number} [siteConfig.numberOfWorkers] Number of workers. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [siteConfig.defaultDocuments] Default documents. * - * @param {function} callback - The callback. + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. * - * @returns {function} callback(err, result, request, response) + * @param {string} [siteConfig.phpVersion] Version of PHP. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {string} [siteConfig.pythonVersion] Version of Python. * - * {null} [result] - The deserialized result object if an error did not occur. + * @param {string} [siteConfig.nodeVersion] Version of Node.js. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version * - * {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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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 + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version * - * Gets the last lines of docker logs for the given site + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. * - * @param {string} name Name of web app. + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. * - * @param {object} [options] Optional Parameters. + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. * - * @param {function} callback - The callback. + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. * - * @returns {function} callback(err, result, request, response) + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {string} [siteConfig.publishingUsername] Publishing user name. * - * {object} [result] - The deserialized result object if an error did not occur. + * @param {array} [siteConfig.appSettings] Application settings. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {array} [siteConfig.connectionStrings] Connection strings. * - * {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') { + * @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.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -8123,9 +7612,15 @@ function _getWebSiteContainerLogs(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -8135,19 +7630,19 @@ function _getWebSiteContainerLogs(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs'; + 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(apiVersion)); + queryParameters.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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -8165,31 +7660,44 @@ function _getWebSiteContainerLogs(resourceGroupName, name, options, callback) { } } } - httpRequest.body = null; + // 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 - 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}`); + if (statusCode !== 200) { + let error = new Error(responseBody); 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); + parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -8199,22 +7707,261 @@ function _getWebSiteContainerLogs(resourceGroupName, name, options, callback) { } return callback(error); } - // Create Result - let result = response; + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 the ZIP archived docker log files for the given site + * @summary Updates the configuration of an app. * - * Gets the ZIP archived docker log files for the given site + * Updates the configuration of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. + * @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 {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. * @@ -8228,12 +7975,13 @@ function _getWebSiteContainerLogs(resourceGroupName, name, 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 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 _getWebSiteContainerLogsZip(resourceGroupName, name, options, callback) { +function _updateConfiguration(resourceGroupName, name, siteConfig, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -8243,7 +7991,6 @@ function _getWebSiteContainerLogsZip(resourceGroupName, name, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -8266,9 +8013,15 @@ function _getWebSiteContainerLogsZip(resourceGroupName, name, options, callback) if (name === 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.'); } @@ -8278,19 +8031,19 @@ function _getWebSiteContainerLogsZip(resourceGroupName, name, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs/zip/download'; + 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(apiVersion)); + queryParameters.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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -8308,31 +8061,44 @@ function _getWebSiteContainerLogsZip(resourceGroupName, name, options, callback) } } } - httpRequest.body = null; + // 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 - 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}`); + if (statusCode !== 200) { + let error = new Error(responseBody); 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); + parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -8342,22 +8108,42 @@ function _getWebSiteContainerLogsZip(resourceGroupName, name, options, callback) } 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. + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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. * - * @param {string} name Site name. + * 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. * @@ -8371,14 +8157,14 @@ function _getWebSiteContainerLogsZip(resourceGroupName, name, 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 ContinuousWebJobCollection} for more - * information. + * 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 _listContinuousWebJobs(resourceGroupName, name, options, callback) { +function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -8388,7 +8174,6 @@ function _listContinuousWebJobs(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -8414,6 +8199,9 @@ function _listContinuousWebJobs(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -8423,12 +8211,12 @@ function _listContinuousWebJobs(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -8470,12 +8258,13 @@ function _listContinuousWebJobs(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -8495,7 +8284,7 @@ function _listContinuousWebJobs(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ContinuousWebJobCollection']().mapper(); + let resultMapper = new client.models['SiteConfigurationSnapshotInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -8511,17 +8300,17 @@ function _listContinuousWebJobs(resourceGroupName, name, options, callback) { } /** - * @summary Gets a continuous web job by its ID for an app, or a deployment - * slot. + * @summary Gets a snapshot of the configuration of an app at a previous point + * in time. * - * Gets a continuous web job by its ID for an app, or a deployment slot. + * 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 Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @param {string} snapshotId The ID of the snapshot to read. * * @param {object} [options] Optional Parameters. * @@ -8535,13 +8324,13 @@ function _listContinuousWebJobs(resourceGroupName, name, 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 ContinuousWebJob} for more information. + * 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 _getContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { +function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -8551,7 +8340,6 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -8574,12 +8362,15 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, options, call if (name === 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 (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.'); } @@ -8589,13 +8380,13 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}'; + 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('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{snapshotId}', encodeURIComponent(snapshotId)); 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('&'); } @@ -8627,7 +8418,7 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, options, call return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -8637,12 +8428,13 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, options, call try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -8662,7 +8454,7 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ContinuousWebJob']().mapper(); + let resultMapper = new client.models['SiteConfigResource']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -8678,17 +8470,16 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, options, call } /** - * @summary Delete a continuous web job by its ID for an app, or a deployment - * slot. + * @summary Reverts the configuration of an app to a previous snapshot. * - * Delete a continuous web job by its ID for an app, or a deployment slot. + * 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 Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @param {string} snapshotId The ID of the snapshot to read. * * @param {object} [options] Optional Parameters. * @@ -8707,7 +8498,7 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, options, call * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { +function _recoverSiteConfigurationSnapshot(resourceGroupName, name, snapshotId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -8717,7 +8508,6 @@ function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -8740,12 +8530,15 @@ function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, c if (name === 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 (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.'); } @@ -8755,20 +8548,20 @@ function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, c // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}'; + 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('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{snapshotId}', encodeURIComponent(snapshotId)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -8793,7 +8586,7 @@ function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, c return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -8827,16 +8620,14 @@ function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, c } /** - * @summary Start a continuous web job for an app, or a deployment slot. + * @summary Gets the last lines of docker logs for the given site * - * Start a continuous web job for an app, or a deployment slot. + * 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 Site name. - * - * @param {string} webJobName Name of Web Job. + * @param {string} name Name of web app. * * @param {object} [options] Optional Parameters. * @@ -8849,13 +8640,13 @@ function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, c * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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 _startContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { +function _getWebSiteContainerLogs(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -8865,7 +8656,6 @@ function _startContinuousWebJob(resourceGroupName, name, webJobName, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -8888,12 +8678,157 @@ function _startContinuousWebJob(resourceGroupName, name, webJobName, options, ca if (name === 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}/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.'); } @@ -8903,13 +8838,12 @@ function _startContinuousWebJob(resourceGroupName, name, webJobName, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/start'; + 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('{webJobName}', encodeURIComponent(webJobName)); 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('&'); } @@ -8936,20 +8870,22 @@ function _startContinuousWebJob(resourceGroupName, name, webJobName, options, ca } 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(responseBody); + 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 { - parsedErrorResponse = JSON.parse(responseBody); + if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; @@ -8966,26 +8902,23 @@ function _startContinuousWebJob(resourceGroupName, name, webJobName, options, ca } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } /** - * @summary Stop a continuous web job for an app, or a deployment slot. + * @summary List continuous web jobs for an app, or a deployment slot. * - * Stop a continuous web job 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} webJobName Name of Web Job. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -8997,13 +8930,15 @@ function _startContinuousWebJob(resourceGroupName, name, webJobName, options, ca * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _stopContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { +function _listContinuousWebJobs(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9013,7 +8948,6 @@ function _stopContinuousWebJob(resourceGroupName, name, webJobName, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -9036,12 +8970,12 @@ function _stopContinuousWebJob(resourceGroupName, name, webJobName, options, cal if (name === 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.'); } @@ -9051,20 +8985,19 @@ function _stopContinuousWebJob(resourceGroupName, name, webJobName, options, cal // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/stop'; + 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('{webJobName}', encodeURIComponent(webJobName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -9089,7 +9022,7 @@ function _stopContinuousWebJob(resourceGroupName, name, webJobName, options, cal return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -9099,12 +9032,13 @@ function _stopContinuousWebJob(resourceGroupName, name, webJobName, options, cal try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -9117,20 +9051,40 @@ function _stopContinuousWebJob(resourceGroupName, name, webJobName, 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['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. + * @summary Gets a continuous web job by its ID for an app, or a deployment + * slot. * - * List deployments 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 Name of the app. + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. * * @param {object} [options] Optional Parameters. * @@ -9144,13 +9098,13 @@ function _stopContinuousWebJob(resourceGroupName, name, webJobName, 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 DeploymentCollection} for more information. + * 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 _listDeployments(resourceGroupName, name, options, callback) { +function _getContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9160,7 +9114,6 @@ function _listDeployments(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -9183,9 +9136,15 @@ function _listDeployments(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -9195,12 +9154,13 @@ function _listDeployments(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -9232,7 +9192,7 @@ function _listDeployments(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -9267,7 +9227,7 @@ function _listDeployments(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DeploymentCollection']().mapper(); + let resultMapper = new client.models['ContinuousWebJob']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -9283,16 +9243,17 @@ function _listDeployments(resourceGroupName, name, options, callback) { } /** - * @summary Get a deployment by its ID for an app, or a deployment slot. + * @summary Delete a continuous web job by its ID for an app, or a deployment + * slot. * - * Get a deployment 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 Name of the app. + * @param {string} name Site name. * - * @param {string} id Deployment ID. + * @param {string} webJobName Name of Web Job. * * @param {object} [options] Optional Parameters. * @@ -9305,14 +9266,13 @@ function _listDeployments(resourceGroupName, name, 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 Deployment} 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 _getDeployment(resourceGroupName, name, id, options, callback) { +function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9322,7 +9282,6 @@ function _getDeployment(resourceGroupName, name, id, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -9345,12 +9304,15 @@ function _getDeployment(resourceGroupName, name, id, options, callback) { if (name === 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 (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.'); } @@ -9360,20 +9322,20 @@ function _getDeployment(resourceGroupName, name, id, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'; + 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('{id}', encodeURIComponent(id)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -9398,7 +9360,7 @@ function _getDeployment(resourceGroupName, name, id, 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); @@ -9426,64 +9388,22 @@ function _getDeployment(resourceGroupName, name, id, 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['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. + * @summary Start a continuous web job for an app, or a deployment slot. * - * Create a deployment 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 Name of the app. - * - * @param {string} id ID of an existing deployment. - * - * @param {object} deployment Deployment details. - * - * @param {string} [deployment.deploymentId] Identifier for deployment. - * - * @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} name Site name. * - * @param {string} [deployment.kind] Kind of resource. + * @param {string} webJobName Name of Web Job. * * @param {object} [options] Optional Parameters. * @@ -9496,14 +9416,13 @@ function _getDeployment(resourceGroupName, name, id, 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 Deployment} 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 _createDeployment(resourceGroupName, name, id, deployment, options, callback) { +function _startContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9513,7 +9432,6 @@ function _createDeployment(resourceGroupName, name, id, deployment, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -9536,15 +9454,15 @@ function _createDeployment(resourceGroupName, name, id, deployment, options, cal if (name === 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 (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.'); } @@ -9554,20 +9472,20 @@ function _createDeployment(resourceGroupName, name, id, deployment, options, cal // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'; + 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('{id}', encodeURIComponent(id)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -9585,28 +9503,14 @@ function _createDeployment(resourceGroupName, name, id, deployment, options, cal } } } - // 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; + httpRequest.body = null; // 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 !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -9634,39 +9538,22 @@ function _createDeployment(resourceGroupName, name, id, deployment, 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['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. + * @summary Stop a continuous web job for an app, or a deployment slot. * - * Delete a deployment by its ID 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 Name of the app. + * @param {string} name Site name. * - * @param {string} id Deployment ID. + * @param {string} webJobName Name of Web Job. * * @param {object} [options] Optional Parameters. * @@ -9685,7 +9572,7 @@ function _createDeployment(resourceGroupName, name, id, deployment, options, cal * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteDeployment(resourceGroupName, name, id, options, callback) { +function _stopContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9695,7 +9582,6 @@ function _deleteDeployment(resourceGroupName, name, id, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -9718,12 +9604,15 @@ function _deleteDeployment(resourceGroupName, name, id, options, callback) { if (name === 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 (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.'); } @@ -9733,20 +9622,20 @@ function _deleteDeployment(resourceGroupName, name, id, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'; + 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('{id}', encodeURIComponent(id)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -9771,7 +9660,7 @@ function _deleteDeployment(resourceGroupName, name, id, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -9805,21 +9694,15 @@ function _deleteDeployment(resourceGroupName, name, id, options, callback) { } /** - * @summary List deployment log for specific deployment for an app, or a - * deployment slot. + * @summary List deployments for an app, or a deployment slot. * - * List deployment log for specific deployment 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} 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 @@ -9832,13 +9715,13 @@ function _deleteDeployment(resourceGroupName, name, id, 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 Deployment} for more information. + * 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 _listDeploymentLog(resourceGroupName, name, id, options, callback) { +function _listDeployments(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9848,7 +9731,6 @@ function _listDeploymentLog(resourceGroupName, name, id, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -9871,12 +9753,12 @@ function _listDeploymentLog(resourceGroupName, name, id, options, callback) { if (name === 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.'); } @@ -9886,13 +9768,12 @@ function _listDeploymentLog(resourceGroupName, name, id, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}/log'; + 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('{id}', encodeURIComponent(id)); 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('&'); } @@ -9934,12 +9815,13 @@ function _listDeploymentLog(resourceGroupName, name, id, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -9959,7 +9841,7 @@ function _listDeploymentLog(resourceGroupName, name, id, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Deployment']().mapper(); + let resultMapper = new client.models['DeploymentCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -9975,15 +9857,17 @@ function _listDeploymentLog(resourceGroupName, name, id, options, callback) { } /** - * @summary Lists ownership identifiers for domain associated with web app. + * @summary Get a deployment by its ID for an app, or a deployment slot. * - * Lists ownership identifiers for domain associated with web app. + * 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 @@ -9996,13 +9880,13 @@ function _listDeploymentLog(resourceGroupName, name, id, 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 IdentifierCollection} for more information. + * 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 _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callback) { +function _getDeployment(resourceGroupName, name, id, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10012,7 +9896,6 @@ function _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -10035,9 +9918,15 @@ function _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callb if (name === 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.'); } @@ -10047,12 +9936,13 @@ function _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -10094,12 +9984,13 @@ function _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callb try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -10119,7 +10010,7 @@ function _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callb parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['IdentifierCollection']().mapper(); + let resultMapper = new client.models['Deployment']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10135,17 +10026,39 @@ function _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callb } /** - * @summary Get domain ownership identifier for web app. + * @summary Create a deployment for an app, or a deployment slot. * - * Get domain ownership identifier for web app. + * 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} domainOwnershipIdentifierName Name of domain ownership - * identifier. + * @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. * @@ -10159,13 +10072,13 @@ function _listDomainOwnershipIdentifiers(resourceGroupName, name, 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 Identifier} for more information. + * 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 _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, options, callback) { +function _createDeployment(resourceGroupName, name, id, deployment, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10175,7 +10088,6 @@ function _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipI if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -10198,12 +10110,18 @@ function _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipI if (name === 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 (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.'); } @@ -10213,20 +10131,20 @@ function _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipI // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; + 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('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); + requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -10244,7 +10162,21 @@ function _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipI } } } - httpRequest.body = null; + // 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) { @@ -10261,12 +10193,13 @@ function _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipI try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -10286,7 +10219,7 @@ function _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipI parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Identifier']().mapper(); + let resultMapper = new client.models['Deployment']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10302,27 +10235,16 @@ function _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipI } /** - * @summary Creates a domain ownership identifier for web app, or updates an - * existing ownership identifier. + * @summary Delete a deployment by its ID for an app, or a deployment slot. * - * Creates a domain ownership identifier for web app, or updates an existing - * ownership identifier. + * 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} 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} id Deployment ID. * * @param {object} [options] Optional Parameters. * @@ -10335,14 +10257,13 @@ function _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipI * * {Error} 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [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) { +function _deleteDeployment(resourceGroupName, name, id, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10352,7 +10273,6 @@ function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domai if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -10375,15 +10295,15 @@ function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domai if (name === 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 (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.'); } @@ -10393,20 +10313,20 @@ function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domai // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; + 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('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); + requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -10424,28 +10344,14 @@ function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domai } } } - // 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; + httpRequest.body = null; // 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 !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -10473,40 +10379,26 @@ function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domai // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @summary List deployment log for specific deployment for an app, or a + * deployment slot. * - * Deletes a domain ownership identifier for a web app. + * 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} domainOwnershipIdentifierName Name of domain ownership - * identifier. + * @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. * @@ -10519,13 +10411,14 @@ function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domai * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, options, callback) { +function _listDeploymentLog(resourceGroupName, name, id, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10535,7 +10428,6 @@ function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -10558,12 +10450,15 @@ function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh if (name === 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 (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.'); } @@ -10573,20 +10468,20 @@ function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; + 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('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); + requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -10611,7 +10506,7 @@ function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -10621,12 +10516,13 @@ function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -10639,33 +10535,81 @@ function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Creates a domain ownership identifier for web app, or updates an - * existing ownership identifier. + * @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. * - * Creates a domain ownership identifier for web app, or updates an existing - * ownership identifier. + * 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 {string} domainOwnershipIdentifierName Name of domain ownership - * identifier. + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. * - * @param {object} domainOwnershipIdentifier A JSON representation of the - * domain ownership properties. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @param {string} [domainOwnershipIdentifier.identifierId] String - * representation of the identity. + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * @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. * @@ -10679,13 +10623,13 @@ function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh * {Error} 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. + * 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 _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options, callback) { +function _discoverBackup(resourceGroupName, name, request, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10695,7 +10639,6 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -10718,15 +10661,15 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh if (name === 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 (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.'); } @@ -10736,20 +10679,19 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; + 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('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -10771,14 +10713,14 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh 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'); + 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(domainOwnershipIdentifier, null, 2)}.`); + `payload - ${JSON.stringify(request, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -10798,12 +10740,13 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -10823,7 +10766,7 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Identifier']().mapper(); + let resultMapper = new client.models['RestoreRequest']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10839,14 +10782,14 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh } /** - * @summary Get the status of the last MSDeploy operation. + * @summary Lists ownership identifiers for domain associated with web app. * - * Get the status of the last MSDeploy operation. + * 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 web app. + * @param {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -10860,13 +10803,13 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh * {Error} 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. + * 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 _getMSDeployStatus(resourceGroupName, name, options, callback) { +function _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10876,7 +10819,6 @@ function _getMSDeployStatus(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -10902,6 +10844,9 @@ function _getMSDeployStatus(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -10911,12 +10856,12 @@ function _getMSDeployStatus(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -10958,12 +10903,13 @@ function _getMSDeployStatus(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -10983,7 +10929,7 @@ function _getMSDeployStatus(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MSDeployStatus']().mapper(); + let resultMapper = new client.models['IdentifierCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10998,44 +10944,18 @@ function _getMSDeployStatus(resourceGroupName, name, options, callback) { }); } - /** - * @summary Invoke the MSDeploy web app extension. + * @summary Get domain ownership identifier for web app. * - * Invoke the MSDeploy web app extension. + * 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 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} name Name of the app. * - * @param {string} [mSDeploy.kind] Kind of resource. + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. * * @param {object} [options] Optional Parameters. * @@ -11049,50 +10969,137 @@ function _getMSDeployStatus(resourceGroupName, name, 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 MSDeployStatus} for more information. + * 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 _createMSDeployOperation(resourceGroupName, name, mSDeploy, options, callback) { +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); + } - // 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; + // 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('&'); + } - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; - - // Deserialize Response + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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(); + let resultMapper = new client.models['Identifier']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -11101,21 +11108,34 @@ function _createMSDeployOperation(resourceGroupName, name, mSDeploy, options, ca deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } + } - return callback(null, result, httpRequest, response); - }); + return callback(null, result, httpRequest, response); }); } /** - * @summary Get the MSDeploy Log for the last MSDeploy operation. + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. * - * Get the MSDeploy Log for the last MSDeploy operation. + * 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 web app. + * @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. * @@ -11129,13 +11149,13 @@ function _createMSDeployOperation(resourceGroupName, name, mSDeploy, 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 MSDeployLog} for more information. + * 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 _getMSDeployLog(resourceGroupName, name, options, callback) { +function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -11145,7 +11165,6 @@ function _getMSDeployLog(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -11168,9 +11187,18 @@ function _getMSDeployLog(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -11180,19 +11208,20 @@ function _getMSDeployLog(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy/log'; + 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(apiVersion)); + queryParameters.push('api-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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -11210,14 +11239,28 @@ function _getMSDeployLog(resourceGroupName, name, options, callback) { } } } - httpRequest.body = null; + // 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 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -11227,12 +11270,13 @@ function _getMSDeployLog(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -11252,7 +11296,7 @@ function _getMSDeployLog(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MSDeployLog']().mapper(); + let resultMapper = new client.models['Identifier']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -11268,14 +11312,17 @@ function _getMSDeployLog(resourceGroupName, name, options, callback) { } /** - * @summary List the functions for a web site, or a deployment slot. + * @summary Deletes a domain ownership identifier for a web app. * - * List the functions for a web site, or a deployment slot. + * 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 Site name. + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. * * @param {object} [options] Optional Parameters. * @@ -11288,15 +11335,13 @@ function _getMSDeployLog(resourceGroupName, name, 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 FunctionEnvelopeCollection} 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 _listFunctions(resourceGroupName, name, options, callback) { +function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -11306,7 +11351,6 @@ function _listFunctions(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -11329,9 +11373,15 @@ function _listFunctions(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -11341,19 +11391,20 @@ function _listFunctions(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions'; + 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(apiVersion)); + queryParameters.push('api-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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -11378,7 +11429,7 @@ function _listFunctions(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -11406,37 +11457,33 @@ function _listFunctions(resourceGroupName, name, 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['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. + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. * - * Fetch a short lived token that can be exchanged for a master key. + * 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 web app. + * @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. * @@ -11449,13 +11496,14 @@ function _listFunctions(resourceGroupName, name, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [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 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 _getFunctionsAdminToken(resourceGroupName, name, options, callback) { +function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -11465,7 +11513,6 @@ function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -11488,9 +11535,18 @@ function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -11500,19 +11556,20 @@ function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/admin/token'; + 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(apiVersion)); + queryParameters.push('api-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 = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -11530,7 +11587,21 @@ function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { } } } - httpRequest.body = null; + // 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) { @@ -11547,12 +11618,13 @@ function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -11572,13 +11644,7 @@ function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; + let resultMapper = new client.models['Identifier']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -11594,17 +11660,14 @@ function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { } /** - * @summary Get function information by its ID for web site, or a deployment - * slot. + * @summary Get the status of the last MSDeploy operation. * - * Get function information by its ID for web site, or a deployment slot. + * Get the status of the last MSDeploy operation. * * @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} name Name of web app. * * @param {object} [options] Optional Parameters. * @@ -11618,13 +11681,13 @@ function _getFunctionsAdminToken(resourceGroupName, name, 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 FunctionEnvelope} for more information. + * 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 _getFunction(resourceGroupName, name, functionName, options, callback) { +function _getMSDeployStatus(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -11634,7 +11697,6 @@ function _getFunction(resourceGroupName, name, functionName, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -11657,12 +11719,12 @@ function _getFunction(resourceGroupName, name, functionName, options, callback) if (name === 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.'); } @@ -11672,13 +11734,12 @@ function _getFunction(resourceGroupName, name, functionName, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'; + 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('{functionName}', encodeURIComponent(functionName)); 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('&'); } @@ -11710,7 +11771,7 @@ function _getFunction(resourceGroupName, name, functionName, options, callback) return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -11720,12 +11781,13 @@ function _getFunction(resourceGroupName, name, functionName, options, callback) try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -11745,7 +11807,7 @@ function _getFunction(resourceGroupName, name, functionName, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionEnvelope']().mapper(); + let resultMapper = new client.models['MSDeployStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -11762,37 +11824,42 @@ function _getFunction(resourceGroupName, name, functionName, options, callback) /** - * @summary Create function for web site, or a deployment slot. + * @summary Invoke the MSDeploy web app extension. * - * Create function for web site, or a deployment slot. + * Invoke the MSDeploy web app extension. * * @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} name Name of web app. * - * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. + * @param {object} mSDeploy Details of MSDeploy operation * - * @param {string} [functionEnvelope.scriptHref] Script URI. + * @param {string} [mSDeploy.packageUri] Package URI * - * @param {string} [functionEnvelope.configHref] Config URI. + * @param {string} [mSDeploy.connectionString] SQL Connection String * - * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * @param {string} [mSDeploy.dbType] Database Type * - * @param {string} [functionEnvelope.href] Function URI. + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. * - * @param {object} [functionEnvelope.config] Config information. + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. * - * @param {object} [functionEnvelope.files] File list. + * @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 {string} [functionEnvelope.testData] Test data used when testing via - * the Azure Portal. + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. * - * @param {string} [functionEnvelope.kind] Kind of resource. + * @param {string} [mSDeploy.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -11806,13 +11873,13 @@ function _getFunction(resourceGroupName, name, functionName, 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 FunctionEnvelope} for more information. + * 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 _createFunction(resourceGroupName, name, functionName, functionEnvelope, options, callback) { +function _createMSDeployOperation(resourceGroupName, name, mSDeploy, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -11825,7 +11892,7 @@ function _createFunction(resourceGroupName, name, functionName, functionEnvelope } // Send request - this.beginCreateFunction(resourceGroupName, name, functionName, functionEnvelope, options, (err, parsedResult, httpRequest, response) => { + this.beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -11849,7 +11916,7 @@ function _createFunction(resourceGroupName, name, functionName, functionEnvelope parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionEnvelope']().mapper(); + let resultMapper = new client.models['MSDeployStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -11865,16 +11932,14 @@ function _createFunction(resourceGroupName, name, functionName, functionEnvelope } /** - * @summary Delete a function for web site, or a deployment slot. + * @summary Get the MSDeploy Log for the last MSDeploy operation. * - * Delete a function for web site, or a deployment slot. + * 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 Site name. - * - * @param {string} functionName Function name. + * @param {string} name Name of web app. * * @param {object} [options] Optional Parameters. * @@ -11887,13 +11952,14 @@ function _createFunction(resourceGroupName, name, functionName, functionEnvelope * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteFunction(resourceGroupName, name, functionName, options, callback) { +function _getMSDeployLog(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -11903,7 +11969,6 @@ function _deleteFunction(resourceGroupName, name, functionName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -11926,12 +11991,12 @@ function _deleteFunction(resourceGroupName, name, functionName, options, callbac if (name === 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.'); } @@ -11941,20 +12006,19 @@ function _deleteFunction(resourceGroupName, name, functionName, options, callbac // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'; + 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('{functionName}', encodeURIComponent(functionName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -11979,7 +12043,7 @@ function _deleteFunction(resourceGroupName, name, functionName, options, callbac return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -12007,24 +12071,38 @@ function _deleteFunction(resourceGroupName, name, functionName, 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['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 function secrets for a function in a web site, or a deployment - * slot. + * @summary List the functions for a web site, or a deployment slot. * - * Get function secrets for a function in 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} functionName Function name. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -12037,13 +12115,14 @@ function _deleteFunction(resourceGroupName, name, functionName, 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 FunctionSecrets} for more information. + * 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 _listFunctionSecrets(resourceGroupName, name, functionName, options, callback) { +function _listFunctions(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -12053,7 +12132,6 @@ function _listFunctionSecrets(resourceGroupName, name, functionName, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -12076,12 +12154,12 @@ function _listFunctionSecrets(resourceGroupName, name, functionName, options, ca if (name === 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.'); } @@ -12091,20 +12169,19 @@ function _listFunctionSecrets(resourceGroupName, name, functionName, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listsecrets'; + 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('{functionName}', encodeURIComponent(functionName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -12129,7 +12206,7 @@ function _listFunctionSecrets(resourceGroupName, name, functionName, options, ca return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -12164,7 +12241,7 @@ function _listFunctionSecrets(resourceGroupName, name, functionName, options, ca parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionSecrets']().mapper(); + let resultMapper = new client.models['FunctionEnvelopeCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -12180,14 +12257,14 @@ function _listFunctionSecrets(resourceGroupName, name, functionName, options, ca } /** - * @summary Get hostname bindings for an app or a deployment slot. + * @summary Fetch a short lived token that can be exchanged for a master key. * - * Get hostname bindings for an app or a deployment slot. + * 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 the app. + * @param {string} name Name of web app. * * @param {object} [options] Optional Parameters. * @@ -12200,15 +12277,13 @@ function _listFunctionSecrets(resourceGroupName, name, functionName, 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 HostNameBindingCollection} for more - * information. + * {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 _listHostNameBindings(resourceGroupName, name, options, callback) { +function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -12218,7 +12293,6 @@ function _listHostNameBindings(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -12244,6 +12318,9 @@ function _listHostNameBindings(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -12253,12 +12330,12 @@ function _listHostNameBindings(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -12300,12 +12377,13 @@ function _listHostNameBindings(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -12325,7 +12403,13 @@ function _listHostNameBindings(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HostNameBindingCollection']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -12341,18 +12425,17 @@ function _listHostNameBindings(resourceGroupName, name, options, callback) { } /** - * @summary Get the named hostname binding for an app (or deployment slot, if - * specified). + * @summary Get function information by its ID for web site, or a deployment + * slot. * - * Get the named hostname binding for an app (or deployment slot, if - * specified). + * 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 Name of the app. + * @param {string} name Site name. * - * @param {string} hostName Hostname in the hostname binding. + * @param {string} functionName Function name. * * @param {object} [options] Optional Parameters. * @@ -12366,13 +12449,13 @@ function _listHostNameBindings(resourceGroupName, name, 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 HostNameBinding} for more information. + * 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 _getHostNameBinding(resourceGroupName, name, hostName, options, callback) { +function _getFunction(resourceGroupName, name, functionName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -12382,7 +12465,6 @@ function _getHostNameBinding(resourceGroupName, name, hostName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -12405,12 +12487,15 @@ function _getHostNameBinding(resourceGroupName, name, hostName, options, callbac if (name === 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 (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.'); } @@ -12420,13 +12505,13 @@ function _getHostNameBinding(resourceGroupName, name, hostName, options, callbac // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'; + 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('{hostName}', encodeURIComponent(hostName)); + requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); 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('&'); } @@ -12458,7 +12543,7 @@ function _getHostNameBinding(resourceGroupName, name, hostName, options, callbac return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -12493,7 +12578,7 @@ function _getHostNameBinding(resourceGroupName, name, hostName, options, callbac parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HostNameBinding']().mapper(); + let resultMapper = new client.models['FunctionEnvelope']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -12508,43 +12593,41 @@ function _getHostNameBinding(resourceGroupName, name, hostName, options, callbac }); } + /** - * @summary Creates a hostname binding for an app. + * @summary Create function for web site, or a deployment slot. * - * Creates a hostname binding for an app. + * 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 Name of the app. + * @param {string} name Site name. * - * @param {string} hostName Hostname in the hostname binding. + * @param {string} functionName Function name. * - * @param {object} hostNameBinding Binding details. This is the JSON - * representation of a HostNameBinding object. + * @param {object} functionEnvelope Function details. * - * @param {string} [hostNameBinding.siteName] App Service app name. + * @param {string} [functionEnvelope.functionAppId] Function App ID. * - * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain - * resource URI. + * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. * - * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * @param {string} [functionEnvelope.scriptHref] Script URI. * - * @param {string} [hostNameBinding.azureResourceType] Azure resource type. - * Possible values include: 'Website', 'TrafficManager' + * @param {string} [functionEnvelope.configHref] Config URI. * - * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS - * record type. Possible values include: 'CName', 'A' + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. * - * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible - * values include: 'Verified', 'Managed' + * @param {string} [functionEnvelope.href] Function URI. * - * @param {string} [hostNameBinding.sslState] SSL type. Possible values - * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * @param {object} [functionEnvelope.config] Config information. * - * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * @param {object} [functionEnvelope.files] File list. * - * @param {string} [hostNameBinding.kind] Kind of resource. + * @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. * @@ -12558,13 +12641,94 @@ function _getHostNameBinding(resourceGroupName, name, hostName, 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 HostNameBinding} for more information. + * 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 _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostNameBinding, options, callback) { +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') { @@ -12574,7 +12738,6 @@ function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostN if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -12597,15 +12760,15 @@ function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostN if (name === 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 (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.'); } @@ -12615,20 +12778,20 @@ function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostN // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'; + 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('{hostName}', encodeURIComponent(hostName)); + requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -12646,28 +12809,14 @@ function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostN } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 204 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -12695,39 +12844,23 @@ function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostN // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @summary Get function secrets for a function in a web site, or a deployment + * slot. * - * Deletes a hostname binding for an app. + * 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 Name of the app. + * @param {string} name Site name. * - * @param {string} hostName Hostname in the hostname binding. + * @param {string} functionName Function name. * * @param {object} [options] Optional Parameters. * @@ -12740,13 +12873,14 @@ function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostN * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteHostNameBinding(resourceGroupName, name, hostName, options, callback) { +function _listFunctionSecrets(resourceGroupName, name, functionName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -12756,7 +12890,6 @@ function _deleteHostNameBinding(resourceGroupName, name, hostName, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -12779,12 +12912,15 @@ function _deleteHostNameBinding(resourceGroupName, name, hostName, options, call if (name === 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 (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.'); } @@ -12794,20 +12930,20 @@ function _deleteHostNameBinding(resourceGroupName, name, hostName, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'; + 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('{hostName}', encodeURIComponent(hostName)); + requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -12832,7 +12968,7 @@ function _deleteHostNameBinding(resourceGroupName, name, hostName, options, call return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -12842,12 +12978,13 @@ function _deleteHostNameBinding(resourceGroupName, name, hostName, options, call try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -12860,25 +12997,37 @@ function _deleteHostNameBinding(resourceGroupName, name, hostName, options, call // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Retrieves a specific Service Bus Hybrid Connection used by this Web - * App. + * @summary Get hostname bindings for an app or a deployment slot. * - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * 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 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} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -12892,13 +13041,14 @@ function _deleteHostNameBinding(resourceGroupName, name, hostName, options, call * {Error} 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. + * 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 _getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, callback) { +function _listHostNameBindings(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -12908,7 +13058,6 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -12931,15 +13080,12 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, if (name === 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.'); } @@ -12949,14 +13095,12 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, // 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}'; + 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('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); 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('&'); } @@ -12998,12 +13142,13 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -13023,7 +13168,7 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HybridConnection']().mapper(); + let resultMapper = new client.models['HostNameBindingCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -13039,46 +13184,18 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, } /** - * @summary Creates a new Hybrid Connection using a Service Bus relay. + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). * - * Creates a new Hybrid Connection using a Service Bus relay. + * 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 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} name Name of the app. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} hostName Hostname in the hostname binding. * * @param {object} [options] Optional Parameters. * @@ -13092,13 +13209,13 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, * {Error} 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. + * 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 _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, callback) { +function _getHostNameBinding(resourceGroupName, name, hostName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -13108,7 +13225,6 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -13131,18 +13247,15 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, if (name === 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 (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.'); } @@ -13152,21 +13265,20 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, // 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}'; + 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('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -13184,21 +13296,7 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -13215,12 +13313,13 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -13240,7 +13339,7 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HybridConnection']().mapper(); + let resultMapper = new client.models['HostNameBinding']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -13256,18 +13355,42 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, } /** - * @summary Removes a Hybrid Connection from this site. + * @summary Creates a hostname binding for an app. * - * Removes a Hybrid Connection from this site. + * Creates a hostname binding for an 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} name Name of the app. * - * @param {string} namespaceName The namespace for this hybrid connection. + * @param {string} hostName Hostname in the hostname binding. * - * @param {string} relayName The relay name for this hybrid connection. + * @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. * @@ -13280,13 +13403,14 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, callback) { +function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostNameBinding, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -13296,7 +13420,6 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -13319,15 +13442,18 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa if (name === 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 (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 (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 (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.'); } @@ -13337,21 +13463,20 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa // 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}'; + 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('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -13369,14 +13494,28 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa } } } - httpRequest.body = null; + // 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 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -13386,12 +13525,13 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -13404,52 +13544,39 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 new Hybrid Connection using a Service Bus relay. + * @summary Deletes a hostname binding for an app. * - * Creates a new Hybrid Connection using a Service Bus relay. + * Deletes a hostname binding for an 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} 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} name Name of the app. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} hostName Hostname in the hostname binding. * * @param {object} [options] Optional Parameters. * @@ -13462,14 +13589,13 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa * * {Error} 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [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) { +function _deleteHostNameBinding(resourceGroupName, name, hostName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -13479,7 +13605,6 @@ function _updateHybridConnection(resourceGroupName, name, namespaceName, relayNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -13502,18 +13627,15 @@ function _updateHybridConnection(resourceGroupName, name, namespaceName, relayNa if (name === 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 (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.'); } @@ -13523,21 +13645,20 @@ function _updateHybridConnection(resourceGroupName, name, namespaceName, relayNa // 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}'; + 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('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -13555,28 +13676,14 @@ function _updateHybridConnection(resourceGroupName, name, namespaceName, relayNa } } } - // 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; + httpRequest.body = null; // 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 !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -13604,32 +13711,16 @@ function _updateHybridConnection(resourceGroupName, name, namespaceName, relayNa // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. * - * Gets the send key name and value for a Hybrid Connection. + * 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. @@ -13652,13 +13743,13 @@ function _updateHybridConnection(resourceGroupName, name, namespaceName, relayNa * {Error} 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. + * 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 _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, callback) { +function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -13668,7 +13759,6 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -13700,6 +13790,9 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -13709,21 +13802,21 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay // 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'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -13758,12 +13851,13 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -13783,7 +13877,7 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HybridConnectionKey']().mapper(); + let resultMapper = new client.models['HybridConnection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -13799,15 +13893,47 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay } /** - * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * @summary Creates a new Hybrid Connection using a Service Bus relay. * - * Retrieves all Service Bus Hybrid Connections used by this Web App. + * 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 @@ -13826,7 +13952,7 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _listHybridConnections(resourceGroupName, name, options, callback) { +function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -13836,7 +13962,6 @@ function _listHybridConnections(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -13859,9 +13984,21 @@ function _listHybridConnections(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -13871,19 +14008,21 @@ function _listHybridConnections(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays'; + 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(apiVersion)); + queryParameters.push('api-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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -13901,7 +14040,21 @@ function _listHybridConnections(resourceGroupName, name, options, callback) { } } } - httpRequest.body = null; + // 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) { @@ -13918,12 +14071,13 @@ function _listHybridConnections(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -13959,16 +14113,18 @@ function _listHybridConnections(resourceGroupName, name, options, callback) { } /** - * @summary Gets hybrid connections configured for an app (or deployment slot, - * if specified). + * @summary Removes a Hybrid Connection from this site. * - * Gets hybrid connections configured for an app (or deployment slot, if - * specified). + * Removes a Hybrid Connection from this site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @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. * @@ -13981,15 +14137,13 @@ function _listHybridConnections(resourceGroupName, name, 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 RelayServiceConnectionEntity} 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 _listRelayServiceConnections(resourceGroupName, name, options, callback) { +function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -13999,7 +14153,6 @@ function _listRelayServiceConnections(resourceGroupName, name, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -14022,9 +14175,18 @@ function _listRelayServiceConnections(resourceGroupName, name, options, callback if (name === 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.'); } @@ -14034,19 +14196,21 @@ function _listRelayServiceConnections(resourceGroupName, name, options, callback // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection'; + 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(apiVersion)); + queryParameters.push('api-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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -14071,7 +14235,7 @@ function _listRelayServiceConnections(resourceGroupName, name, options, callback return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -14099,39 +14263,52 @@ function _listRelayServiceConnections(resourceGroupName, name, 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['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. + * @summary Creates a new Hybrid Connection using a Service Bus relay. * - * Gets a hybrid connection configuration by its name. + * 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 Name of the app. + * @param {string} name The name of the web app. * - * @param {string} entityName Name of the hybrid connection. + * @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. * @@ -14145,14 +14322,13 @@ function _listRelayServiceConnections(resourceGroupName, name, 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 RelayServiceConnectionEntity} for more - * information. + * 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 _getRelayServiceConnection(resourceGroupName, name, entityName, options, callback) { +function _updateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -14162,7 +14338,6 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -14185,12 +14360,21 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, options if (name === 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 (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.'); } @@ -14200,20 +14384,21 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, options // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'; + 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('{entityName}', encodeURIComponent(entityName)); + 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(apiVersion)); + queryParameters.push('api-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 = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -14231,7 +14416,21 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, options } } } - httpRequest.body = null; + // 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) { @@ -14248,12 +14447,13 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, options try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -14273,7 +14473,7 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, options parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); + let resultMapper = new client.models['HybridConnection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -14289,37 +14489,18 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, options } /** - * @summary Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). + * @summary Gets the send key name and value for a Hybrid Connection. * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). + * 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 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} name The name of the web app. * - * @param {string} [connectionEnvelope.biztalkUri] + * @param {string} namespaceName The namespace for this hybrid connection. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} relayName The relay name for this hybrid connection. * * @param {object} [options] Optional Parameters. * @@ -14333,14 +14514,13 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, 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 RelayServiceConnectionEntity} for more - * information. + * 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 _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, callback) { +function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -14350,7 +14530,6 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -14373,15 +14552,18 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa if (name === 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 (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 (connectionEnvelope === null || connectionEnvelope === undefined) { - throw new Error('connectionEnvelope cannot be null or undefined.'); + 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.'); } @@ -14391,20 +14573,21 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'; + 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('{entityName}', encodeURIComponent(entityName)); + 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(apiVersion)); + queryParameters.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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -14422,21 +14605,7 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -14453,12 +14622,13 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -14478,7 +14648,7 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); + let resultMapper = new client.models['HybridConnectionKey']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -14494,16 +14664,14 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa } /** - * @summary Deletes a relay service connection by its name. + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. * - * Deletes a relay service connection by its name. + * 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 Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. + * @param {string} name The name of the web app. * * @param {object} [options] Optional Parameters. * @@ -14516,13 +14684,14 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteRelayServiceConnection(resourceGroupName, name, entityName, options, callback) { +function _listHybridConnections(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -14532,7 +14701,6 @@ function _deleteRelayServiceConnection(resourceGroupName, name, entityName, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -14555,12 +14723,12 @@ function _deleteRelayServiceConnection(resourceGroupName, name, entityName, opti if (name === 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.'); } @@ -14570,20 +14738,19 @@ function _deleteRelayServiceConnection(resourceGroupName, name, entityName, opti // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'; + 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('{entityName}', encodeURIComponent(entityName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -14608,7 +14775,7 @@ function _deleteRelayServiceConnection(resourceGroupName, name, entityName, opti return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -14618,12 +14785,13 @@ function _deleteRelayServiceConnection(resourceGroupName, name, entityName, opti try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -14636,44 +14804,40 @@ function _deleteRelayServiceConnection(resourceGroupName, name, entityName, opti // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 configuration (PUT), or updates an - * existing one (PATCH). + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). + * 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} 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 @@ -14693,7 +14857,7 @@ function _deleteRelayServiceConnection(resourceGroupName, name, entityName, opti * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _updateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, callback) { +function _listRelayServiceConnections(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -14703,7 +14867,6 @@ function _updateRelayServiceConnection(resourceGroupName, name, entityName, conn if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -14726,15 +14889,12 @@ function _updateRelayServiceConnection(resourceGroupName, name, entityName, conn if (name === 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.'); } @@ -14744,20 +14904,19 @@ function _updateRelayServiceConnection(resourceGroupName, name, entityName, conn // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'; + 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('{entityName}', encodeURIComponent(entityName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -14775,21 +14934,7 @@ function _updateRelayServiceConnection(resourceGroupName, name, entityName, conn } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -14806,12 +14951,13 @@ function _updateRelayServiceConnection(resourceGroupName, name, entityName, conn try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -14847,15 +14993,17 @@ function _updateRelayServiceConnection(resourceGroupName, name, entityName, conn } /** - * @summary Gets all scale-out instances of an app. + * @summary Gets a hybrid connection configuration by its name. * - * Gets all scale-out instances of an app. + * 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 @@ -14868,14 +15016,14 @@ function _updateRelayServiceConnection(resourceGroupName, name, entityName, conn * {Error} 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 + * 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 _listInstanceIdentifiers(resourceGroupName, name, options, callback) { +function _getRelayServiceConnection(resourceGroupName, name, entityName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -14885,7 +15033,6 @@ function _listInstanceIdentifiers(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -14908,9 +15055,15 @@ function _listInstanceIdentifiers(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -14920,12 +15073,13 @@ function _listInstanceIdentifiers(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -14967,12 +15121,13 @@ function _listInstanceIdentifiers(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -14992,7 +15147,7 @@ function _listInstanceIdentifiers(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebAppInstanceCollection']().mapper(); + let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -15008,16 +15163,37 @@ function _listInstanceIdentifiers(resourceGroupName, name, options, callback) { } /** - * @summary Get the status of the last MSDeploy operation. + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). * - * Get the status of the last MSDeploy operation. + * 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 web app. + * @param {string} name Name of the app. * - * @param {string} instanceId ID of web app instance. + * @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. * @@ -15031,13 +15207,14 @@ function _listInstanceIdentifiers(resourceGroupName, name, 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 MSDeployStatus} for more information. + * 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 _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options, callback) { +function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -15047,7 +15224,6 @@ function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -15070,12 +15246,18 @@ function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options if (name === 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 (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.'); } @@ -15085,20 +15267,20 @@ function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options // 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'; + 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('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -15116,7 +15298,21 @@ function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options } } } - httpRequest.body = null; + // 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) { @@ -15133,12 +15329,13 @@ function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -15158,7 +15355,7 @@ function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MSDeployStatus']().mapper(); + let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -15173,128 +15370,17 @@ function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options }); } - /** - * @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. + * @summary Deletes a relay service connection by its name. * - * Get the MSDeploy Log for the last MSDeploy operation. + * 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 web app. + * @param {string} name Name of the app. * - * @param {string} instanceId ID of web app instance. + * @param {string} entityName Name of the hybrid connection configuration. * * @param {object} [options] Optional Parameters. * @@ -15307,14 +15393,13 @@ function _createInstanceMSDeployOperation(resourceGroupName, name, instanceId, m * * {Error} 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [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) { +function _deleteRelayServiceConnection(resourceGroupName, name, entityName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -15324,7 +15409,6 @@ function _getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -15347,12 +15431,15 @@ function _getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, c if (name === 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 (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.'); } @@ -15362,20 +15449,20 @@ function _getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, c // 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'; + 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('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -15428,43 +15515,43 @@ function _getInstanceMSDeployLog(resourceGroupName, name, 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['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. + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. + * 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 Site name. + * @param {string} name Name of the app. * - * @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 {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. * @@ -15478,13 +15565,14 @@ function _getInstanceMSDeployLog(resourceGroupName, name, 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 ProcessInfoCollection} for more information. + * 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 _listInstanceProcesses(resourceGroupName, name, instanceId, options, callback) { +function _updateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -15494,7 +15582,6 @@ function _listInstanceProcesses(resourceGroupName, name, instanceId, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -15517,12 +15604,18 @@ function _listInstanceProcesses(resourceGroupName, name, instanceId, options, ca if (name === 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 (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.'); } @@ -15532,20 +15625,20 @@ function _listInstanceProcesses(resourceGroupName, name, instanceId, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes'; + 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('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -15563,14 +15656,28 @@ function _listInstanceProcesses(resourceGroupName, name, instanceId, options, ca } } } - httpRequest.body = null; + // 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 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -15580,12 +15687,13 @@ function _listInstanceProcesses(resourceGroupName, name, instanceId, options, ca try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -15605,7 +15713,7 @@ function _listInstanceProcesses(resourceGroupName, name, instanceId, options, ca parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfoCollection']().mapper(); + let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -15621,22 +15729,14 @@ function _listInstanceProcesses(resourceGroupName, name, instanceId, options, ca } /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. + * @summary Gets all scale-out instances of an app. * - * Get process information by its ID for a specific scaled-out instance in a - * web site. + * Gets all scale-out instances of an app. * * @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 {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -15650,13 +15750,14 @@ function _listInstanceProcesses(resourceGroupName, name, instanceId, 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 ProcessInfo} for more information. + * 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 _getInstanceProcess(resourceGroupName, name, processId, instanceId, options, callback) { +function _listInstanceIdentifiers(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -15666,7 +15767,6 @@ function _getInstanceProcess(resourceGroupName, name, processId, instanceId, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -15689,15 +15789,12 @@ function _getInstanceProcess(resourceGroupName, name, processId, instanceId, opt if (name === 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.'); } @@ -15707,14 +15804,12 @@ function _getInstanceProcess(resourceGroupName, name, processId, instanceId, opt // 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}'; + 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('{processId}', encodeURIComponent(processId)); - requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); 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('&'); } @@ -15746,7 +15841,7 @@ function _getInstanceProcess(resourceGroupName, name, processId, instanceId, opt return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -15756,12 +15851,13 @@ function _getInstanceProcess(resourceGroupName, name, processId, instanceId, opt try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -15781,7 +15877,7 @@ function _getInstanceProcess(resourceGroupName, name, processId, instanceId, opt parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfo']().mapper(); + let resultMapper = new client.models['WebAppInstanceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -15797,22 +15893,16 @@ function _getInstanceProcess(resourceGroupName, name, processId, instanceId, opt } /** - * @summary Terminate a process by its ID for a web site, or a deployment slot, - * or specific scaled-out instance in a web site. + * @summary Get the status of the last MSDeploy operation. * - * Terminate a process by its ID for a web site, or a deployment slot, or - * specific scaled-out instance in a web site. + * Get the status of the last MSDeploy operation. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. - * - * @param {string} processId PID. + * @param {string} name Name of web app. * - * @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 {string} instanceId ID of web app instance. * * @param {object} [options] Optional Parameters. * @@ -15825,13 +15915,14 @@ function _getInstanceProcess(resourceGroupName, name, processId, instanceId, opt * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, options, callback) { +function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -15841,7 +15932,6 @@ function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -15864,15 +15954,15 @@ function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, if (name === 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.'); } @@ -15882,21 +15972,20 @@ function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, // 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}'; + 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('{processId}', encodeURIComponent(processId)); requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -15921,7 +16010,7 @@ function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -15931,12 +16020,13 @@ function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -15949,28 +16039,68 @@ function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Get a memory dump of a process by its ID for a specific scaled-out - * instance in a web site. + * @summary Invoke the MSDeploy web app extension. * - * Get a memory dump of a process by its ID for a specific scaled-out instance - * in a web site. + * Invoke the MSDeploy web app extension. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @param {string} name Name of web app. * - * @param {string} processId PID. + * @param {string} instanceId ID of web app instance. * - * @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} 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. * @@ -15984,12 +16114,95 @@ function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, * {Error} 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 _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, options, callback) { +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') { @@ -15999,7 +16212,6 @@ function _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -16022,15 +16234,15 @@ function _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, if (name === 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.'); } @@ -16040,14 +16252,13 @@ function _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, // 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'; + 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('{processId}', encodeURIComponent(processId)); requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); 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('&'); } @@ -16074,22 +16285,20 @@ function _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, } 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}`); + let error = new Error(responseBody); 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); + parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; @@ -16106,27 +16315,43 @@ function _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, } return callback(error); } - // Create Result - let result = response; + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 module information for a process by its ID for a specific - * scaled-out instance in a web site. + * @summary Get list of processes for a web site, or a deployment slot, or 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. + * 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} 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". @@ -16143,14 +16368,13 @@ function _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, * {Error} 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. + * 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 _listInstanceProcessModules(resourceGroupName, name, processId, instanceId, options, callback) { +function _listInstanceProcesses(resourceGroupName, name, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -16160,7 +16384,6 @@ function _listInstanceProcessModules(resourceGroupName, name, processId, instanc if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -16183,15 +16406,15 @@ function _listInstanceProcessModules(resourceGroupName, name, processId, instanc if (name === 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.'); } @@ -16201,14 +16424,13 @@ function _listInstanceProcessModules(resourceGroupName, name, processId, instanc // 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'; + 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('{processId}', encodeURIComponent(processId)); requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); 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('&'); } @@ -16275,7 +16497,7 @@ function _listInstanceProcessModules(resourceGroupName, name, processId, instanc parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); + let resultMapper = new client.models['ProcessInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -16304,8 +16526,6 @@ function _listInstanceProcessModules(resourceGroupName, name, processId, instanc * * @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". @@ -16322,13 +16542,13 @@ function _listInstanceProcessModules(resourceGroupName, name, processId, instanc * {Error} 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. + * 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 _getInstanceProcessModule(resourceGroupName, name, processId, baseAddress, instanceId, options, callback) { +function _getInstanceProcess(resourceGroupName, name, processId, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -16338,7 +16558,6 @@ function _getInstanceProcessModule(resourceGroupName, name, processId, baseAddre if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -16364,15 +16583,15 @@ function _getInstanceProcessModule(resourceGroupName, name, processId, baseAddre 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.'); } @@ -16382,15 +16601,14 @@ function _getInstanceProcessModule(resourceGroupName, name, processId, baseAddre // 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}'; + 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('{baseAddress}', encodeURIComponent(baseAddress)); requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); 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('&'); } @@ -16457,7 +16675,7 @@ function _getInstanceProcessModule(resourceGroupName, name, processId, baseAddre parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfo']().mapper(); + let resultMapper = new client.models['ProcessInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -16473,11 +16691,11 @@ function _getInstanceProcessModule(resourceGroupName, name, processId, baseAddre } /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or 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. + * 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. @@ -16501,15 +16719,13 @@ function _getInstanceProcessModule(resourceGroupName, name, processId, baseAddre * * {Error} 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [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) { +function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -16519,7 +16735,6 @@ function _listInstanceProcessThreads(resourceGroupName, name, processId, instanc if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -16551,6 +16766,9 @@ function _listInstanceProcessThreads(resourceGroupName, name, processId, instanc if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -16560,21 +16778,21 @@ function _listInstanceProcessThreads(resourceGroupName, name, processId, instanc // 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'; + 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(apiVersion)); + queryParameters.push('api-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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -16599,7 +16817,7 @@ function _listInstanceProcessThreads(resourceGroupName, name, processId, instanc return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 204 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -16627,34 +16845,17 @@ function _listInstanceProcessThreads(resourceGroupName, name, processId, instanc // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @summary Get a memory dump of a process by its ID for 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. + * 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. @@ -16663,8 +16864,6 @@ function _listInstanceProcessThreads(resourceGroupName, name, processId, instanc * * @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". @@ -16681,13 +16880,12 @@ function _listInstanceProcessThreads(resourceGroupName, name, processId, instanc * {Error} 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) { +function _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -16697,7 +16895,6 @@ function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -16723,15 +16920,15 @@ function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, 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.'); } @@ -16741,15 +16938,14 @@ function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, // 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}'; + 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('{threadId}', encodeURIComponent(threadId)); requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); 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('&'); } @@ -16776,20 +16972,22 @@ function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, } 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(responseBody); + 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 { - parsedErrorResponse = JSON.parse(responseBody); + if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; @@ -16806,42 +17004,30 @@ function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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); - } - } + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } /** - * @summary Shows whether an app can be cloned to another resource group or - * subscription. + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. * - * Shows whether an app can be cloned to another resource group or - * subscription. + * 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 Name of the app. + * @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. * @@ -16855,13 +17041,14 @@ function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, * {Error} 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. + * 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 _isCloneable(resourceGroupName, name, options, callback) { +function _listInstanceProcessModules(resourceGroupName, name, processId, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -16871,7 +17058,6 @@ function _isCloneable(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -16894,9 +17080,18 @@ function _isCloneable(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -16906,19 +17101,21 @@ function _isCloneable(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/iscloneable'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -16943,7 +17140,7 @@ function _isCloneable(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -16978,7 +17175,7 @@ function _isCloneable(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteCloneability']().mapper(); + let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -16994,14 +17191,24 @@ function _isCloneable(resourceGroupName, name, options, callback) { } /** - * @summary This is to allow calling via powershell and ARM template. + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. * - * This is to allow calling via powershell and ARM template. + * 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 Name of the app. + * @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. * @@ -17015,13 +17222,13 @@ function _isCloneable(resourceGroupName, name, 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 FunctionSecrets} for more information. + * 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 _listSyncFunctionTriggers(resourceGroupName, name, options, callback) { +function _getInstanceProcessModule(resourceGroupName, name, processId, baseAddress, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -17031,7 +17238,6 @@ function _listSyncFunctionTriggers(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -17054,9 +17260,21 @@ function _listSyncFunctionTriggers(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -17066,19 +17284,22 @@ function _listSyncFunctionTriggers(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listsyncfunctiontriggerstatus'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -17103,7 +17324,7 @@ function _listSyncFunctionTriggers(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -17138,7 +17359,7 @@ function _listSyncFunctionTriggers(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionSecrets']().mapper(); + let resultMapper = new client.models['ProcessModuleInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -17154,15 +17375,22 @@ function _listSyncFunctionTriggers(resourceGroupName, name, options, callback) { } /** - * @summary Gets all metric definitions of an app (or deployment slot, if - * specified). + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. * - * Gets all metric definitions of an app (or deployment slot, if specified). + * 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 Name of the app. + * @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. * @@ -17176,14 +17404,14 @@ function _listSyncFunctionTriggers(resourceGroupName, name, 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 ResourceMetricDefinitionCollection} for more + * 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 _listMetricDefinitions(resourceGroupName, name, options, callback) { +function _listInstanceProcessThreads(resourceGroupName, name, processId, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -17193,7 +17421,6 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -17216,9 +17443,18 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -17228,12 +17464,14 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/metricdefinitions'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -17265,7 +17503,7 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -17300,7 +17538,7 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); + let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -17316,25 +17554,26 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { } /** - * @summary Gets performance metrics of an app (or deployment slot, if - * specified). + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. * - * Gets performance metrics of an app (or deployment slot, if specified). + * 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 Name of the app. + * @param {string} name Site name. * - * @param {object} [options] Optional Parameters. + * @param {string} processId PID. * - * @param {boolean} [options.details] Specify "true" to include metric details - * in the response. It is "false" by default. + * @param {string} threadId TID. * - * @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 {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 @@ -17346,14 +17585,13 @@ function _listMetricDefinitions(resourceGroupName, name, 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 ResourceMetricCollection} for more - * information. + * 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 _listMetrics(resourceGroupName, name, options, callback) { +function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -17363,9 +17601,6 @@ function _listMetrics(resourceGroupName, name, options, callback) { 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; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -17388,15 +17623,21 @@ function _listMetrics(resourceGroupName, name, options, callback) { if (name === 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 (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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter 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.'); } @@ -17406,18 +17647,15 @@ function _listMetrics(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/metrics'; + 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 = []; - 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -17449,7 +17687,7 @@ function _listMetrics(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -17484,7 +17722,7 @@ function _listMetrics(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricCollection']().mapper(); + let resultMapper = new client.models['ProcessThreadInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -17499,35 +17737,17 @@ function _listMetrics(resourceGroupName, name, options, callback) { }); } - /** - * @summary Restores a web app. - * - * Restores a web app. + * @summary Shows whether an app can be cloned to another resource group or + * subscription. * - * @param {string} subscriptionName Azure 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 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 {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -17541,144 +17761,133 @@ function _listMetrics(resourceGroupName, name, 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 StorageMigrationResponse} for more - * information. + * 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 _migrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, callback) { +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.'); } - - // 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); + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); } - - 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 (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } + } + if (name === 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); } - if (!callback) { - throw new Error('callback cannot be null.'); + // 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('&'); } - // 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; + // Create HTTP transport objects + let 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; - - // Deserialize Response + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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(); + let resultMapper = new client.models['SiteCloneability']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -17687,23 +17896,21 @@ function _migrateMySql(resourceGroupName, name, migrationRequestEnvelope, option deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } + } - return callback(null, result, httpRequest, response); - }); + 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 + * @summary This is to allow calling via powershell and ARM template. * - * Returns the status of MySql in app migration, if one is active, and whether - * or not MySql in app is enabled + * 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 web app. + * @param {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -17717,13 +17924,13 @@ function _migrateMySql(resourceGroupName, name, migrationRequestEnvelope, 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 MigrateMySqlStatus} for more information. + * 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 _getMigrateMySqlStatus(resourceGroupName, name, options, callback) { +function _listSyncFunctionTriggers(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -17733,7 +17940,6 @@ function _getMigrateMySqlStatus(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -17759,6 +17965,9 @@ function _getMigrateMySqlStatus(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -17768,19 +17977,19 @@ function _getMigrateMySqlStatus(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status'; + 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(apiVersion)); + queryParameters.push('api-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 @@ -17815,12 +18024,13 @@ function _getMigrateMySqlStatus(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -17840,7 +18050,7 @@ function _getMigrateMySqlStatus(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MigrateMySqlStatus']().mapper(); + let resultMapper = new client.models['FunctionSecrets']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -17856,20 +18066,16 @@ function _getMigrateMySqlStatus(resourceGroupName, name, options, callback) { } /** - * @summary Gets all network features used by the app (or deployment slot, if + * @summary Gets all metric definitions of an app (or deployment slot, if * specified). * - * Gets all network features used by the 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} 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 @@ -17882,13 +18088,14 @@ function _getMigrateMySqlStatus(resourceGroupName, name, 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 NetworkFeatures} for more information. + * 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 _listNetworkFeatures(resourceGroupName, name, view, options, callback) { +function _listMetricDefinitions(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -17898,7 +18105,6 @@ function _listNetworkFeatures(resourceGroupName, name, view, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -17921,12 +18127,12 @@ function _listNetworkFeatures(resourceGroupName, name, view, options, callback) if (name === 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.'); } @@ -17936,13 +18142,12 @@ function _listNetworkFeatures(resourceGroupName, name, view, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}'; + 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('{view}', encodeURIComponent(view)); 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('&'); } @@ -17974,7 +18179,7 @@ function _listNetworkFeatures(resourceGroupName, name, view, options, callback) return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -17984,12 +18189,13 @@ function _listNetworkFeatures(resourceGroupName, name, view, options, callback) try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -18009,7 +18215,7 @@ function _listNetworkFeatures(resourceGroupName, name, view, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['NetworkFeatures']().mapper(); + let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -18025,24 +18231,25 @@ function _listNetworkFeatures(resourceGroupName, name, view, options, callback) } /** - * @summary Start capturing network packets for the site. + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). * - * Start capturing network packets for the site. + * 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 The name of the web app. + * @param {string} name Name of the 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 {boolean} [options.details] Specify "true" to include metric details + * in the response. It is "false" by default. * - * @param {string} [options.sasUrl] The Blob URL to store capture file. + * @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 @@ -18053,13 +18260,15 @@ function _listNetworkFeatures(resourceGroupName, name, view, options, callback) * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [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 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 _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { +function _listMetrics(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -18069,10 +18278,8 @@ function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { 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; - let apiVersion = '2016-08-01'; + 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') { @@ -18095,18 +18302,18 @@ function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { if (name === 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 (details !== null && details !== undefined && typeof details !== 'boolean') { + throw new Error('details must be of type boolean.'); } - if (sasUrl !== null && sasUrl !== undefined && typeof sasUrl.valueOf() !== 'string') { - throw new Error('sasUrl 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.'); } @@ -18116,28 +18323,25 @@ function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/start'; + 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 (durationInSeconds !== null && durationInSeconds !== undefined) { - queryParameters.push('durationInSeconds=' + encodeURIComponent(durationInSeconds.toString())); - } - if (maxFrameLength !== null && maxFrameLength !== undefined) { - queryParameters.push('maxFrameLength=' + encodeURIComponent(maxFrameLength.toString())); + if (details !== null && details !== undefined) { + queryParameters.push('details=' + encodeURIComponent(details.toString())); } - if (sasUrl !== null && sasUrl !== undefined) { - queryParameters.push('sasUrl=' + encodeURIComponent(sasUrl)); + 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -18172,12 +18376,13 @@ function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -18197,13 +18402,7 @@ function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; + let resultMapper = new client.models['ResourceMetricCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -18218,15 +18417,35 @@ function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { }); } + /** - * @summary Stop ongoing capturing network packets for the site. + * @summary Restores a web app. * - * Stop ongoing capturing network packets for the site. + * 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 The name of the web app. + * @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. * @@ -18239,13 +18458,190 @@ function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [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 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 _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { +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') { @@ -18255,7 +18651,6 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -18281,6 +18676,9 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -18290,19 +18688,19 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/stop'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -18337,12 +18735,13 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -18362,13 +18761,7 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; + let resultMapper = new client.models['MigrateMySqlStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -18384,10 +18777,10 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { } /** - * @summary Generates a new publishing password for an app (or deployment slot, - * if specified). + * @summary Gets all network features used by the app (or deployment slot, if + * specified). * - * Generates a new publishing password for an app (or deployment slot, if + * Gets all network features used by the app (or deployment slot, if * specified). * * @param {string} resourceGroupName Name of the resource group to which the @@ -18395,6 +18788,9 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { * * @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 @@ -18406,13 +18802,14 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _generateNewSitePublishingPassword(resourceGroupName, name, options, callback) { +function _listNetworkFeatures(resourceGroupName, name, view, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -18422,7 +18819,6 @@ function _generateNewSitePublishingPassword(resourceGroupName, name, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -18445,9 +18841,15 @@ function _generateNewSitePublishingPassword(resourceGroupName, name, options, ca if (name === 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.'); } @@ -18457,19 +18859,20 @@ function _generateNewSitePublishingPassword(resourceGroupName, name, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -18494,7 +18897,7 @@ function _generateNewSitePublishingPassword(resourceGroupName, name, options, ca return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -18522,27 +18925,47 @@ function _generateNewSitePublishingPassword(resourceGroupName, name, options, ca // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 perfmon counters for web app. + * @summary Start capturing network packets for the site. * - * Gets perfmon counters for web app. + * Start capturing network packets for the site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. + * @param {string} name The name of the 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 {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 @@ -18553,15 +18976,13 @@ function _generateNewSitePublishingPassword(resourceGroupName, name, 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 PerfMonCounterCollection} for more - * information. + * {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 _listPerfMonCounters(resourceGroupName, name, options, callback) { +function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -18571,8 +18992,9 @@ function _listPerfMonCounters(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-08-01'; + 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') { @@ -18595,12 +19017,21 @@ function _listPerfMonCounters(resourceGroupName, name, options, callback) { if (name === 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 (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.'); } @@ -18610,22 +19041,28 @@ function _listPerfMonCounters(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/perfcounters'; + 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 (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + filter); + if (durationInSeconds !== null && durationInSeconds !== undefined) { + queryParameters.push('durationInSeconds=' + encodeURIComponent(durationInSeconds.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -18660,12 +19097,13 @@ function _listPerfMonCounters(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -18685,7 +19123,13 @@ function _listPerfMonCounters(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PerfMonCounterCollection']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -18701,14 +19145,14 @@ function _listPerfMonCounters(resourceGroupName, name, options, callback) { } /** - * @summary Gets web app's event logs. + * @summary Stop ongoing capturing network packets for the site. * - * Gets web app's event logs. + * Stop ongoing capturing network packets for the site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. + * @param {string} name The name of the web app. * * @param {object} [options] Optional Parameters. * @@ -18721,14 +19165,13 @@ function _listPerfMonCounters(resourceGroupName, name, 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 SitePhpErrorLogFlag} for more information. + * {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 _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { +function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -18738,7 +19181,6 @@ function _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -18764,6 +19206,9 @@ function _getSitePhpErrorLogFlag(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -18773,19 +19218,19 @@ function _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging'; + 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(apiVersion)); + queryParameters.push('api-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 @@ -18820,12 +19265,13 @@ function _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -18845,7 +19291,13 @@ function _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SitePhpErrorLogFlag']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -18861,9 +19313,11 @@ function _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { } /** - * @summary Gets the premier add-ons of an app. + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). * - * Gets the premier add-ons of an app. + * 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. @@ -18881,14 +19335,13 @@ function _getSitePhpErrorLogFlag(resourceGroupName, name, 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 PremierAddOn} 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 _listPremierAddOns(resourceGroupName, name, options, callback) { +function _generateNewSitePublishingPassword(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -18898,7 +19351,6 @@ function _listPremierAddOns(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -18924,6 +19376,9 @@ function _listPremierAddOns(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -18933,19 +19388,19 @@ function _listPremierAddOns(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons'; + 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(apiVersion)); + queryParameters.push('api-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 @@ -18970,7 +19425,7 @@ function _listPremierAddOns(resourceGroupName, name, 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); @@ -18998,6 +19453,165 @@ function _listPremierAddOns(resourceGroupName, name, options, callback) { // 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; @@ -19005,7 +19619,7 @@ function _listPremierAddOns(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PremierAddOn']().mapper(); + let resultMapper = new client.models['PerfMonCounterCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -19021,16 +19635,14 @@ function _listPremierAddOns(resourceGroupName, name, options, callback) { } /** - * @summary Gets a named add-on of an app. + * @summary Gets web app's event logs. * - * Gets a named add-on of an app. + * Gets web app's event logs. * * @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} name Name of web app. * * @param {object} [options] Optional Parameters. * @@ -19044,13 +19656,13 @@ function _listPremierAddOns(resourceGroupName, name, 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 PremierAddOn} for more information. + * 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 _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, callback) { +function _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -19060,7 +19672,6 @@ function _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -19083,12 +19694,12 @@ function _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, ca if (name === 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.'); } @@ -19098,13 +19709,12 @@ function _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'; + 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('{premierAddOnName}', encodeURIComponent(premierAddOnName)); 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('&'); } @@ -19146,12 +19756,13 @@ function _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, ca try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -19171,7 +19782,7 @@ function _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, ca parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PremierAddOn']().mapper(); + let resultMapper = new client.models['SitePhpErrorLogFlag']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -19187,44 +19798,15 @@ function _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, ca } /** - * @summary Updates a named add-on of an app. + * @summary Gets the premier add-ons of an app. * - * Updates a named add-on 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} 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.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * - * @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 @@ -19243,7 +19825,7 @@ function _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, ca * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, callback) { +function _listPremierAddOns(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -19253,7 +19835,6 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -19276,15 +19857,12 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO if (name === 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.'); } @@ -19294,20 +19872,19 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'; + 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('{premierAddOnName}', encodeURIComponent(premierAddOnName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -19325,21 +19902,7 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -19356,12 +19919,13 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -19397,9 +19961,9 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO } /** - * @summary Delete a premier add-on from an app. + * @summary Gets a named add-on of an app. * - * Delete a premier add-on from an app. + * Gets a named add-on of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -19419,13 +19983,14 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, callback) { +function _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -19435,7 +20000,6 @@ function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -19464,6 +20028,9 @@ function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -19479,14 +20046,14 @@ function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -19521,12 +20088,13 @@ function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -19539,22 +20107,60 @@ function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, 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['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 Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. + * @summary Updates a named add-on of an app. * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. + * Updates a named add-on of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @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. * @@ -19568,13 +20174,13 @@ function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, 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 ProcessInfoCollection} for more information. + * 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 _listProcesses(resourceGroupName, name, options, callback) { +function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -19584,7 +20190,6 @@ function _listProcesses(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -19607,9 +20212,18 @@ function _listProcesses(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -19619,19 +20233,20 @@ function _listProcesses(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes'; + 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(apiVersion)); + queryParameters.push('api-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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -19649,14 +20264,28 @@ function _listProcesses(resourceGroupName, name, options, callback) { } } } - httpRequest.body = null; + // 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 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -19666,12 +20295,13 @@ function _listProcesses(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -19691,7 +20321,7 @@ function _listProcesses(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfoCollection']().mapper(); + let resultMapper = new client.models['PremierAddOn']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -19707,18 +20337,16 @@ function _listProcesses(resourceGroupName, name, options, callback) { } /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. + * @summary Delete a premier add-on from an app. * - * Get process information by its ID for a specific scaled-out instance in a - * web site. + * Delete a premier add-on from an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @param {string} name Name of the app. * - * @param {string} processId PID. + * @param {string} premierAddOnName Add-on name. * * @param {object} [options] Optional Parameters. * @@ -19731,14 +20359,13 @@ function _listProcesses(resourceGroupName, name, 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 ProcessInfo} 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 _getProcess(resourceGroupName, name, processId, options, callback) { +function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -19748,7 +20375,6 @@ function _getProcess(resourceGroupName, name, processId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -19771,12 +20397,15 @@ function _getProcess(resourceGroupName, name, processId, options, callback) { if (name === 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 (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.'); } @@ -19786,20 +20415,20 @@ function _getProcess(resourceGroupName, name, processId, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'; + 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('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -19824,7 +20453,7 @@ function _getProcess(resourceGroupName, name, processId, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -19852,41 +20481,39 @@ function _getProcess(resourceGroupName, name, processId, 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['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. + * @summary Updates a named add-on of an app. * - * Terminate a process by its ID for a web site, or a deployment slot, or - * specific scaled-out instance in a web site. + * Updates a named add-on of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @param {string} name Name of the app. * - * @param {string} processId PID. + * @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. * @@ -19899,13 +20526,14 @@ function _getProcess(resourceGroupName, name, processId, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteProcess(resourceGroupName, name, processId, options, callback) { +function _updatePremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -19915,7 +20543,6 @@ function _deleteProcess(resourceGroupName, name, processId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -19938,12 +20565,18 @@ function _deleteProcess(resourceGroupName, name, processId, options, callback) { if (name === 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 (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.'); } @@ -19953,20 +20586,20 @@ function _deleteProcess(resourceGroupName, name, processId, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'; + 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('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -19984,14 +20617,28 @@ function _deleteProcess(resourceGroupName, name, processId, options, callback) { } } } - httpRequest.body = null; + // 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 !== 204 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -20001,12 +20648,13 @@ function _deleteProcess(resourceGroupName, name, processId, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -20019,24 +20667,39 @@ function _deleteProcess(resourceGroupName, name, processId, 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['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 Get a memory dump of a process by its ID for a specific scaled-out - * instance in a web site. + * @summary Gets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Get a memory dump of a process by its ID for a specific scaled-out instance - * in a web 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 Site name. - * - * @param {string} processId PID. + * @param {string} name The name of the web app. * * @param {object} [options] Optional Parameters. * @@ -20050,12 +20713,13 @@ function _deleteProcess(resourceGroupName, name, processId, 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 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 _getProcessDump(resourceGroupName, name, processId, options, callback) { +function _getPrivateAccess(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20065,7 +20729,6 @@ function _getProcessDump(resourceGroupName, name, processId, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -20088,12 +20751,12 @@ function _getProcessDump(resourceGroupName, name, processId, options, callback) if (name === 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.'); } @@ -20103,13 +20766,12 @@ function _getProcessDump(resourceGroupName, name, processId, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/dump'; + 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('{processId}', encodeURIComponent(processId)); 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('&'); } @@ -20136,29 +20798,28 @@ function _getProcessDump(resourceGroupName, name, processId, options, callback) } 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}`); + if (statusCode !== 200) { + let error = new Error(responseBody); 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); + parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -20168,26 +20829,51 @@ function _getProcessDump(resourceGroupName, name, processId, options, callback) } return callback(error); } - // Create Result - let result = response; + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 List module information for a process by its ID for a specific - * scaled-out instance in a web site. + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * List module information for a process by its ID for a specific scaled-out - * instance in a web 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 Site name. + * @param {string} name The name of the web app. * - * @param {string} processId PID. + * @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. * @@ -20201,14 +20887,13 @@ function _getProcessDump(resourceGroupName, name, processId, 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 ProcessModuleInfoCollection} for more - * information. + * 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 _listProcessModules(resourceGroupName, name, processId, options, callback) { +function _putPrivateAccessVnet(resourceGroupName, name, access, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20218,7 +20903,6 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -20241,12 +20925,15 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba if (name === 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 (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.'); } @@ -20256,20 +20943,19 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules'; + 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('{processId}', encodeURIComponent(processId)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -20287,14 +20973,28 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba } } } - httpRequest.body = null; + // 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 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -20304,12 +21004,13 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -20329,7 +21030,7 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); + let resultMapper = new client.models['PrivateAccess']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -20345,21 +21046,17 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba } /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. + * @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 process information by its ID 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} processId PID. - * - * @param {string} baseAddress Module base address. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -20372,13 +21069,13 @@ function _listProcessModules(resourceGroupName, name, processId, 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 ProcessModuleInfo} for more information. + * 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 _getProcessModule(resourceGroupName, name, processId, baseAddress, options, callback) { +function _listProcesses(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20388,7 +21085,6 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -20411,15 +21107,12 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, opti if (name === 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.'); } @@ -20429,14 +21122,12 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, opti // 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}'; + 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('{processId}', encodeURIComponent(processId)); - requestUrl = requestUrl.replace('{baseAddress}', encodeURIComponent(baseAddress)); 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('&'); } @@ -20503,7 +21194,7 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, opti parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfo']().mapper(); + let resultMapper = new client.models['ProcessInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -20519,11 +21210,11 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, opti } /** - * @summary List the threads in a process by its ID for a specific scaled-out + * @summary Get process information 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. + * 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. @@ -20544,14 +21235,13 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, 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 ProcessThreadInfoCollection} for more - * information. + * 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 _listProcessThreads(resourceGroupName, name, processId, options, callback) { +function _getProcess(resourceGroupName, name, processId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20561,7 +21251,6 @@ function _listProcessThreads(resourceGroupName, name, processId, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -20590,6 +21279,9 @@ function _listProcessThreads(resourceGroupName, name, processId, options, callba if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -20599,13 +21291,13 @@ function _listProcessThreads(resourceGroupName, name, processId, options, callba // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -20672,7 +21364,7 @@ function _listProcessThreads(resourceGroupName, name, processId, options, callba parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); + let resultMapper = new client.models['ProcessInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -20688,11 +21380,11 @@ function _listProcessThreads(resourceGroupName, name, processId, options, callba } /** - * @summary Get thread information by Thread ID for a specific process, in a - * specific scaled-out instance in a web site. + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or 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. + * 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. @@ -20701,8 +21393,6 @@ function _listProcessThreads(resourceGroupName, name, processId, options, callba * * @param {string} processId PID. * - * @param {string} threadId TID. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -20714,14 +21404,13 @@ function _listProcessThreads(resourceGroupName, name, processId, 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 ProcessThreadInfo} 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 _getProcessThread(resourceGroupName, name, processId, threadId, options, callback) { +function _deleteProcess(resourceGroupName, name, processId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20731,7 +21420,6 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -20757,12 +21445,12 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, options 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.'); } @@ -20772,21 +21460,20 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, options // 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}'; + 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('{threadId}', encodeURIComponent(threadId)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -20811,7 +21498,7 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, options return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 204 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -20839,37 +21526,177 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, options // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = 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 { - 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'); + 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; } - } catch (error) { - let 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 = response; return callback(null, result, httpRequest, response); }); } /** - * @summary Get public certificates for an app or a deployment slot. + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. * - * Get public certificates for an app or a deployment slot. + * 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 Name of the app. + * @param {string} name Site name. + * + * @param {string} processId PID. * * @param {object} [options] Optional Parameters. * @@ -20883,14 +21710,14 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, 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 PublicCertificateCollection} for more + * 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 _listPublicCertificates(resourceGroupName, name, options, callback) { +function _listProcessModules(resourceGroupName, name, processId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20900,7 +21727,6 @@ function _listPublicCertificates(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -20923,9 +21749,15 @@ function _listPublicCertificates(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -20935,12 +21767,13 @@ function _listPublicCertificates(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -20972,7 +21805,7 @@ function _listPublicCertificates(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -21007,7 +21840,7 @@ function _listPublicCertificates(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PublicCertificateCollection']().mapper(); + let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -21023,18 +21856,20 @@ function _listPublicCertificates(resourceGroupName, name, options, callback) { } /** - * @summary Get the named public certificate for an app (or deployment slot, if - * specified). + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. * - * Get the named public certificate for an app (or deployment slot, if - * specified). + * 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 Name of the app. + * @param {string} name Site name. * - * @param {string} publicCertificateName Public certificate name. + * @param {string} processId PID. + * + * @param {string} baseAddress Module base address. * * @param {object} [options] Optional Parameters. * @@ -21048,13 +21883,13 @@ function _listPublicCertificates(resourceGroupName, name, 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 PublicCertificate} for more information. + * 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 _getPublicCertificate(resourceGroupName, name, publicCertificateName, options, callback) { +function _getProcessModule(resourceGroupName, name, processId, baseAddress, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21064,7 +21899,6 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -21087,12 +21921,18 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o if (name === 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 (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.'); } @@ -21102,13 +21942,14 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'; + 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('{publicCertificateName}', encodeURIComponent(publicCertificateName)); + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -21140,7 +21981,7 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -21175,7 +22016,7 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PublicCertificate']().mapper(); + let resultMapper = new client.models['ProcessModuleInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -21191,27 +22032,18 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o } /** - * @summary Creates a hostname binding for an app. + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. * - * Creates a hostname binding for an app. + * 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 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} name Site name. * - * @param {string} [publicCertificate.kind] Kind of resource. + * @param {string} processId PID. * * @param {object} [options] Optional Parameters. * @@ -21225,13 +22057,14 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, 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 PublicCertificate} for more information. + * 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 _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertificateName, publicCertificate, options, callback) { +function _listProcessThreads(resourceGroupName, name, processId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21241,7 +22074,6 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -21264,15 +22096,15 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi if (name === 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 (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.'); } @@ -21282,20 +22114,20 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'; + 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('{publicCertificateName}', encodeURIComponent(publicCertificateName)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -21313,28 +22145,14 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi } } } - // 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; + httpRequest.body = null; // 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 !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -21369,7 +22187,7 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PublicCertificate']().mapper(); + let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -21385,16 +22203,20 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi } /** - * @summary Deletes a hostname binding for an app. + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. * - * Deletes a hostname binding for an app. + * 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 Name of the app. + * @param {string} name Site name. * - * @param {string} publicCertificateName Public certificate name. + * @param {string} processId PID. + * + * @param {string} threadId TID. * * @param {object} [options] Optional Parameters. * @@ -21407,13 +22229,14 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deletePublicCertificate(resourceGroupName, name, publicCertificateName, options, callback) { +function _getProcessThread(resourceGroupName, name, processId, threadId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21423,7 +22246,6 @@ function _deletePublicCertificate(resourceGroupName, name, publicCertificateName if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -21446,12 +22268,18 @@ function _deletePublicCertificate(resourceGroupName, name, publicCertificateName if (name === 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 (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.'); } @@ -21461,20 +22289,21 @@ function _deletePublicCertificate(resourceGroupName, name, publicCertificateName // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'; + 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('{publicCertificateName}', encodeURIComponent(publicCertificateName)); + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -21499,7 +22328,7 @@ function _deletePublicCertificate(resourceGroupName, name, publicCertificateName return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -21527,16 +22356,32 @@ function _deletePublicCertificate(resourceGroupName, name, publicCertificateName // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Gets the publishing profile for an app (or deployment slot, if - * specified). + * @summary Get public certificates for an app or a deployment slot. * - * Gets the publishing profile for an app (or deployment slot, if specified). + * Get public certificates for an app or a deployment slot. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -21545,11 +22390,6 @@ function _deletePublicCertificate(resourceGroupName, name, publicCertificateName * * @param {object} [options] Optional Parameters. * - * @param {string} [options.format] Name of the format. Valid values are: - * FileZilla3 - * WebDeploy -- default - * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -21560,12 +22400,14 @@ function _deletePublicCertificate(resourceGroupName, name, publicCertificateName * {Error} 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 _listPublishingProfileXmlWithSecrets(resourceGroupName, name, options, callback) { +function _listPublicCertificates(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21575,8 +22417,6 @@ function _listPublishingProfileXmlWithSecrets(resourceGroupName, name, options, if (!callback) { throw new Error('callback cannot be null.'); } - let format = (options && options.format !== undefined) ? options.format : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -21602,8 +22442,8 @@ function _listPublishingProfileXmlWithSecrets(resourceGroupName, name, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (format !== null && format !== undefined && typeof format.valueOf() !== 'string') { - throw new Error('format must be of type string.'); + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -21611,27 +22451,22 @@ function _listPublishingProfileXmlWithSecrets(resourceGroupName, name, options, } catch (error) { return callback(error); } - let publishingProfileOptions; - if (format !== null && format !== undefined) { - publishingProfileOptions = new client.models['CsmPublishingProfileOptions'](); - publishingProfileOptions.format = format; - } // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -21649,45 +22484,30 @@ function _listPublishingProfileXmlWithSecrets(resourceGroupName, name, options, } } } - // 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; + 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) { - let error = new Error(`Unexpected status code: ${statusCode}`); + let error = new Error(responseBody); 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); + parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -21697,123 +22517,45 @@ function _listPublishingProfileXmlWithSecrets(resourceGroupName, name, options, } return callback(error); } - // Create Result - let result = response; - return callback(null, result, httpRequest, response); - }); -} - - -/** - * @summary Recovers a web app to a previous snapshot. - * - * Recovers a web app to a previous snapshot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. - * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.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 _recover(resourceGroupName, name, recoveryEntity, options, callback) { - /* jshint 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.beginRecover(resourceGroupName, name, recoveryEntity, 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 result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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); - }); + 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. + * @summary Get the named public certificate for an app (or deployment slot, if + * specified). * - * Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * 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 @@ -21825,13 +22567,14 @@ function _recover(resourceGroupName, name, recoveryEntity, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _resetProductionSlotConfig(resourceGroupName, name, options, callback) { +function _getPublicCertificate(resourceGroupName, name, publicCertificateName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21841,7 +22584,6 @@ function _resetProductionSlotConfig(resourceGroupName, name, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -21864,9 +22606,15 @@ function _resetProductionSlotConfig(resourceGroupName, name, options, callback) if (name === 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.'); } @@ -21876,19 +22624,20 @@ function _resetProductionSlotConfig(resourceGroupName, name, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resetSlotConfig'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -21923,12 +22672,13 @@ function _resetProductionSlotConfig(resourceGroupName, name, options, callback) try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -21941,30 +22691,52 @@ function _resetProductionSlotConfig(resourceGroupName, name, 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['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 Restarts an app (or deployment slot, if specified). + * @summary Creates a hostname binding for an app. * - * Restarts an app (or deployment slot, if specified). + * 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 {object} [options] Optional Parameters. + * @param {string} publicCertificateName Public certificate name. * - * @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 {object} publicCertificate Public certificate details. This is the + * JSON representation of a PublicCertificate object. * - * @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 {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 @@ -21975,13 +22747,14 @@ function _resetProductionSlotConfig(resourceGroupName, name, options, callback) * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _restart(resourceGroupName, name, options, callback) { +function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertificateName, publicCertificate, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21991,9 +22764,6 @@ function _restart(resourceGroupName, name, options, callback) { 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; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -22016,15 +22786,18 @@ function _restart(resourceGroupName, name, options, callback) { if (name === 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 (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 (synchronous !== null && synchronous !== undefined && typeof synchronous !== 'boolean') { - throw new Error('synchronous must be of type boolean.'); + 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.'); } @@ -22034,25 +22807,20 @@ function _restart(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restart'; + 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 = []; - 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(apiVersion)); + queryParameters.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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -22070,7 +22838,21 @@ function _restart(resourceGroupName, name, options, callback) { } } } - httpRequest.body = null; + // 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) { @@ -22087,12 +22869,13 @@ function _restart(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -22105,20 +22888,39 @@ function _restart(resourceGroupName, name, 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['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 Get list of siteextensions for a web site, or a deployment slot. + * @summary Deletes a hostname binding for an app. * - * Get list of siteextensions for a web site, or a deployment slot. + * Deletes a hostname binding for an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @param {string} name Name of the app. + * + * @param {string} publicCertificateName Public certificate name. * * @param {object} [options] Optional Parameters. * @@ -22131,15 +22933,13 @@ function _restart(resourceGroupName, name, 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 SiteExtensionInfoCollection} 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 _listSiteExtensions(resourceGroupName, name, options, callback) { +function _deletePublicCertificate(resourceGroupName, name, publicCertificateName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22149,7 +22949,6 @@ function _listSiteExtensions(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -22172,9 +22971,15 @@ function _listSiteExtensions(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -22184,19 +22989,20 @@ function _listSiteExtensions(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions'; + 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(apiVersion)); + queryParameters.push('api-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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -22221,7 +23027,7 @@ function _listSiteExtensions(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -22249,44 +23055,29 @@ function _listSiteExtensions(resourceGroupName, name, 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['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. + * @summary Gets the publishing profile for an app (or deployment slot, if + * specified). * - * Get site extension information by its ID for a web site, or a deployment - * slot. + * 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 Site name. - * - * @param {string} siteExtensionId Site extension name. + * @param {string} name Name of the app. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -22297,13 +23088,12 @@ function _listSiteExtensions(resourceGroupName, name, 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 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) { +function _listPublishingProfileXmlWithSecrets(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22313,7 +23103,7 @@ function _getSiteExtension(resourceGroupName, name, siteExtensionId, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; + let format = (options && options.format !== undefined) ? options.format : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -22336,35 +23126,42 @@ function _getSiteExtension(resourceGroupName, name, siteExtensionId, options, ca if (name === 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 (format !== null && format !== undefined && typeof format.valueOf() !== 'string') { + throw new Error('format must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.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 publishingProfileOptions; + if (format !== null && format !== undefined) { + publishingProfileOptions = new client.models['CsmPublishingProfileOptions'](); + publishingProfileOptions.format = format; + } // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'; + 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('{siteExtensionId}', encodeURIComponent(siteExtensionId)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -22382,29 +23179,46 @@ function _getSiteExtension(resourceGroupName, name, siteExtensionId, options, ca } } } - httpRequest.body = null; + // 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 && statusCode !== 404) { - let error = new Error(responseBody); + 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 { - parsedErrorResponse = JSON.parse(responseBody); + 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; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -22414,125 +23228,24 @@ function _getSiteExtension(resourceGroupName, name, siteExtensionId, options, ca } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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); - } - } + // Create Result + let result = response; 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. + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * Remove a site extension from a web site, or a deployment slot. + * 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 Site name. - * - * @param {string} siteExtensionId Site extension name. + * @param {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -22551,7 +23264,7 @@ function _installSiteExtension(resourceGroupName, name, siteExtensionId, options * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteSiteExtension(resourceGroupName, name, siteExtensionId, options, callback) { +function _resetProductionSlotConfig(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22561,7 +23274,6 @@ function _deleteSiteExtension(resourceGroupName, name, siteExtensionId, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -22584,12 +23296,12 @@ function _deleteSiteExtension(resourceGroupName, name, siteExtensionId, options, if (name === 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.'); } @@ -22599,20 +23311,19 @@ function _deleteSiteExtension(resourceGroupName, name, siteExtensionId, options, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'; + 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('{siteExtensionId}', encodeURIComponent(siteExtensionId)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -22637,7 +23348,7 @@ function _deleteSiteExtension(resourceGroupName, name, siteExtensionId, options, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -22671,15 +23382,467 @@ function _deleteSiteExtension(resourceGroupName, name, siteExtensionId, options, } /** - * @summary Gets an app's deployment slots. + * @summary Restarts an app (or deployment slot, if specified). * - * Gets an app's deployment slots. + * 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 @@ -22692,13 +23855,14 @@ function _deleteSiteExtension(resourceGroupName, name, siteExtensionId, 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 WebAppCollection} for more information. + * 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 _listSlots(resourceGroupName, name, options, callback) { +function _listSiteExtensions(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22708,7 +23872,6 @@ function _listSlots(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -22734,6 +23897,9 @@ function _listSlots(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -22743,12 +23909,12 @@ function _listSlots(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -22780,7 +23946,7 @@ function _listSlots(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -22815,7 +23981,7 @@ function _listSlots(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebAppCollection']().mapper(); + let resultMapper = new client.models['SiteExtensionInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -22831,17 +23997,18 @@ function _listSlots(resourceGroupName, name, options, callback) { } /** - * @summary Gets the details of a web, mobile, or API app. + * @summary Get site extension information by its ID for a web site, or a + * deployment slot. * - * Gets the details of a web, mobile, or API app. + * 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 Name of the app. + * @param {string} name Site name. * - * @param {string} slot Name of the deployment slot. By default, this API - * returns the production slot. + * @param {string} siteExtensionId Site extension name. * * @param {object} [options] Optional Parameters. * @@ -22855,13 +24022,13 @@ function _listSlots(resourceGroupName, name, 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 Site} for more information. + * 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 _getSlot(resourceGroupName, name, slot, options, callback) { +function _getSiteExtension(resourceGroupName, name, siteExtensionId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22871,7 +24038,6 @@ function _getSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -22894,12 +24060,15 @@ function _getSlot(resourceGroupName, name, slot, options, callback) { if (name === 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 (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.'); } @@ -22909,13 +24078,13 @@ function _getSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'; + 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('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{siteExtensionId}', encodeURIComponent(siteExtensionId)); 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('&'); } @@ -22982,7 +24151,7 @@ function _getSlot(resourceGroupName, name, slot, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Site']().mapper(); + let resultMapper = new client.models['SiteExtensionInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -22999,65 +24168,1248 @@ function _getSlot(resourceGroupName, name, slot, options, callback) { /** - * @summary Creates a new web, mobile, or API app in an existing resource - * group, or updates an existing app. + * @summary Install site extension on a web site, or a deployment slot. * - * Creates a new web, mobile, or API app in an existing resource group, or - * updates an existing app. + * 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 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 {object} [siteEnvelope.siteConfig] Configuration of the app. - * - * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. - * - * @param {array} [siteEnvelope.siteConfig.defaultDocuments] Default documents. + * @param {string} name Site name. * - * @param {string} [siteEnvelope.siteConfig.netFrameworkVersion] .NET Framework - * version. + * @param {string} siteExtensionId Site extension name. * - * @param {string} [siteEnvelope.siteConfig.phpVersion] Version of PHP. + * @param {object} [options] Optional Parameters. * - * @param {string} [siteEnvelope.siteConfig.pythonVersion] Version of Python. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [siteEnvelope.siteConfig.nodeVersion] Version of Node.js. + * @param {function} callback - The callback. * - * @param {string} [siteEnvelope.siteConfig.linuxFxVersion] Linux App Framework - * and version + * @returns {function} callback(err, result, request, response) * - * @param {boolean} [siteEnvelope.siteConfig.requestTracingEnabled] - * true if request tracing is enabled; otherwise, - * false. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {date} [siteEnvelope.siteConfig.requestTracingExpirationTime] Request - * tracing expiration time. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link SiteExtensionInfo} for more information. * - * @param {boolean} [siteEnvelope.siteConfig.remoteDebuggingEnabled] - * true if remote debugging is enabled; otherwise, - * false. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [siteEnvelope.siteConfig.remoteDebuggingVersion] Remote + * {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] 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 {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] 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] @@ -23210,195 +25562,1106 @@ function _getSlot(resourceGroupName, name, slot, options, callback) { * 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 {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 {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a - * flag indicating whether the Push endpoint is enabled. + * @param {object} [options] Optional Parameters. * - * @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 {object} [options.customHeaders] Headers that will be added to the + * request * - * @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 {function} callback - The callback. * - * @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. + * @returns {function} callback(err, result, request, response) * - * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about - * the formal API definition for the app. + * {null} [result] - The deserialized result object if an error did not occur. * - * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the - * API definition. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot - * name. + * {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. * - * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] - * true to enable local MySQL; otherwise, false. + * Creates a backup of an app. * - * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: - * configures a web site to allow clients to connect over http2.0 + * @param {string} name Name of the app. * - * @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 {object} request Backup configuration. You can use the JSON response + * from the POST action as input here. * - * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop - * SCM (KUDU) site when the app is stopped; otherwise, false. The - * default is false. + * @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 {object} [siteEnvelope.hostingEnvironmentProfile] App Service - * Environment to use for the app. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of - * the App Service Environment. + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. * - * @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 {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 {boolean} [siteEnvelope.clientCertEnabled] true to - * enable client certificate authentication (TLS mutual authentication); - * otherwise, false. Default is false. + * @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} [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 {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} [siteEnvelope.containerSize] Size of the function container. + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. * - * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily - * memory-time quota (applicable on dynamic apps only). + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. * - * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, - * the app is cloned from a source app. + * @param {array} [request.databases] Databases included in the backup. * - * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of - * cloning operation. This ID ties multiple cloning operations - * together to use the same snapshot. + * @param {string} [request.kind] Kind of resource. * - * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to - * overwrite destination app; otherwise, false. + * @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 {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] - * true to clone custom hostnames from source app; otherwise, - * false. + * @param {object} [options] Optional Parameters. * - * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] - * true to clone source control from source app; otherwise, - * false. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @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 {function} callback - The callback. * - * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service - * Environment. + * @returns {function} callback(err, result, request, response) * - * @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. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] - * true to configure load balancing for source and destination - * app. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackupItem} for more information. * - * @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}. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [siteEnvelope.cloningInfo.trafficManagerProfileName] Name of - * Traffic Manager profile to create. This is only needed if Traffic Manager - * profile does not already exist. + * {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. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. + * Gets existing backups of an app. * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. + * @param {string} name Name of the app. * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will get backups of the production slot. * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS + * @param {object} [options] Optional Parameters. * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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 {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. + * @param {function} callback - The callback. * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. + * @returns {function} callback(err, result, request, response) * - * @param {boolean} [siteEnvelope.snapshotInfo.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. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {string} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackupItemCollection} for more information. * - * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site - * to accept only https requests. Issues redirect for - * http requests + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [siteEnvelope.identity] + * {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. * - * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * Gets a backup of an app by its ID. * - * @param {string} [siteEnvelope.kind] Kind of resource. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {string} siteEnvelope.location Resource Location. + * @param {string} name Name of the app. * - * @param {object} [siteEnvelope.tags] Resource tags. + * @param {string} backupId ID of the backup. * - * @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 {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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -23409,50 +26672,141 @@ function _getSlot(resourceGroupName, name, slot, 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 Site} for more information. + * 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 _createOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, options, callback) { +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); + } - // 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; + // 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('&'); + } - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; - - // Deserialize Response + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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(); + let resultMapper = new client.models['BackupItem']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -23461,37 +26815,28 @@ function _createOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, option deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } + } - return callback(null, result, httpRequest, response); - }); + return callback(null, result, httpRequest, response); }); } /** - * @summary Deletes a web, mobile, or API app, or one of the deployment slots. + * @summary Deletes a backup of an app by its ID. * - * Deletes a web, mobile, or API app, or one of the deployment slots. + * 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 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 {string} name Name of the app. * - * @param {boolean} [options.deleteMetrics] If true, web app metrics are also - * deleted. + * @param {string} backupId ID of the backup. * - * @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 {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete a backup of the production slot. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -23508,7 +26853,7 @@ function _createOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, option * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteSlot(resourceGroupName, name, slot, options, callback) { +function _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -23518,10 +26863,6 @@ function _deleteSlot(resourceGroupName, name, slot, options, callback) { 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; - let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -23544,21 +26885,18 @@ function _deleteSlot(resourceGroupName, name, slot, options, callback) { if (name === 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 (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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { - throw new Error('skipDnsRegistration must be of type boolean.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -23568,22 +26906,14 @@ function _deleteSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'; + 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 = []; - if (deleteMetrics !== null && deleteMetrics !== undefined) { - queryParameters.push('deleteMetrics=' + encodeURIComponent(deleteMetrics.toString())); - } - if (deleteEmptyServerFarm !== null && deleteEmptyServerFarm !== undefined) { - queryParameters.push('deleteEmptyServerFarm=' + encodeURIComponent(deleteEmptyServerFarm.toString())); - } - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { - queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -23615,7 +26945,7 @@ function _deleteSlot(resourceGroupName, name, slot, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -23649,396 +26979,365 @@ function _deleteSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary Creates a new web, mobile, or API app in an existing resource - * group, or updates an existing app. + * @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. * - * Creates a new web, mobile, or API app in an existing resource group, or - * updates an existing app. + * 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 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 {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 {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 {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 {string} name Name of web app. * - * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing - * (CORS) settings. + * @param {string} backupId ID of backup. * - * @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} request Information on backup request. * - * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * @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 {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a - * flag indicating whether the Push endpoint is enabled. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @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 {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. * - * @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 {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} [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} 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 {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * @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 {object} [siteEnvelope.siteConfig.apiDefinition] Information about - * the formal API definition for the app. + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. * - * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the - * API definition. + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. * - * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot - * name. + * @param {array} [request.databases] Databases included in the backup. * - * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] - * true to enable local MySQL; otherwise, false. + * @param {string} [request.kind] Kind of resource. * - * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. * - * @param {boolean} [siteEnvelope.siteConfig.http20Enabled] Http20Enabled: - * configures a web site to allow clients to connect over http2.0 + * @param {object} [options] Optional Parameters. * - * @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 {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop - * SCM (KUDU) site when the app is stopped; otherwise, false. The - * default is false. + * @param {function} callback - The callback. * - * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service - * Environment to use for the app. + * @returns {function} callback(err, result, request, response) * - * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of - * the App Service Environment. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @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. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackupItem} for more information. * - * @param {boolean} [siteEnvelope.clientCertEnabled] true to - * enable client certificate authentication (TLS mutual authentication); - * otherwise, false. Default is false. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @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. + * {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). * - * @param {number} [siteEnvelope.containerSize] Size of the function container. + * Restores a specific backup to another app (or deployment slot, if + * specified). * - * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily - * memory-time quota (applicable on dynamic apps only). + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, - * the app is cloned from a source app. + * @param {string} name Name of the app. * - * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of - * cloning operation. This ID ties multiple cloning operations - * together to use the same snapshot. + * @param {string} backupId ID of the backup. * - * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to - * overwrite destination app; otherwise, false. + * @param {object} request Information on restore request . * - * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] - * true to clone custom hostnames from source app; otherwise, - * false. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] - * true to clone source control from source app; otherwise, - * false. + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @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 {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} [siteEnvelope.cloningInfo.hostingEnvironment] App Service - * Environment. + * @param {string} [request.siteName] Name of an app. * - * @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 {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} [siteEnvelope.cloningInfo.configureLoadBalancing] - * true to configure load balancing for source and destination - * app. + * @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 {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 {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * @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 {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. + * @param {string} [request.kind] Kind of resource. * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS + * @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 {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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 {object} [options] Optional Parameters. * - * @param {boolean} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. + * @param {function} callback - The callback. * - * @param {boolean} [siteEnvelope.snapshotInfo.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. + * @returns {function} callback(err, result, request, response) * - * @param {string} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site - * to accept only https requests. Issues redirect for - * http requests + * {null} [result] - The deserialized result object if an error did not occur. * - * @param {string} [siteEnvelope.kind] Kind of resource. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {string} slot Name of the deployment slot to create or update. By - * default, this API attempts to create or modify the production slot. + * {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 * - * @param {object} [options] Optional Parameters. + * List the configurations of an app * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. + * @param {string} name Name of the app. * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -24050,13 +27349,14 @@ function _deleteSlot(resourceGroupName, name, slot, 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 Site} for more information. + * 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 _updateSlot(resourceGroupName, name, siteEnvelope, slot, options, callback) { +function _listConfigurationsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -24066,11 +27366,6 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, slot, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; - let skipCustomDomainVerification = (options && options.skipCustomDomainVerification !== undefined) ? options.skipCustomDomainVerification : undefined; - let forceDnsRegistration = (options && options.forceDnsRegistration !== undefined) ? options.forceDnsRegistration : undefined; - let ttlInSeconds = (options && options.ttlInSeconds !== undefined) ? options.ttlInSeconds : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -24093,27 +27388,15 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, slot, options, callb if (name === 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { - throw new Error('skipDnsRegistration must be of type boolean.'); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined && typeof skipCustomDomainVerification !== 'boolean') { - throw new Error('skipCustomDomainVerification must be of type boolean.'); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined && typeof forceDnsRegistration !== 'boolean') { - throw new Error('forceDnsRegistration must be of type boolean.'); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined && typeof ttlInSeconds.valueOf() !== 'string') { - throw new Error('ttlInSeconds must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -24123,32 +27406,20 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, slot, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'; + 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 = []; - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { - queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined) { - queryParameters.push('skipCustomDomainVerification=' + encodeURIComponent(skipCustomDomainVerification.toString())); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined) { - queryParameters.push('forceDnsRegistration=' + encodeURIComponent(forceDnsRegistration.toString())); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined) { - queryParameters.push('ttlInSeconds=' + encodeURIComponent(ttlInSeconds)); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -24166,28 +27437,14 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, slot, options, callb } } } - // 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; + httpRequest.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); @@ -24197,12 +27454,13 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, slot, options, callb try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -24222,7 +27480,7 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, slot, options, callb parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Site']().mapper(); + let resultMapper = new client.models['SiteConfigResourceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -24232,44 +27490,32 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, slot, options, callb 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. + * @summary Replaces the application settings of an app. * - * Analyze a custom hostname. + * 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 web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @param {object} appSettings Application settings of the app. * - * @param {object} [options] Optional Parameters. + * @param {object} [appSettings.properties] Settings. * - * @param {string} [options.hostName] Custom hostname. + * @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 @@ -24281,14 +27527,13 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, slot, 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 CustomHostnameAnalysisResult} for more - * information. + * 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 _analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, callback) { +function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -24298,8 +27543,6 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let hostName = (options && options.hostName !== undefined) ? options.hostName : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -24322,15 +27565,18 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, call if (name === 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 (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.'); } @@ -24340,23 +27586,20 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/analyzeCustomHostname'; + 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 = []; - if (hostName !== null && hostName !== undefined) { - queryParameters.push('hostName=' + encodeURIComponent(hostName)); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -24374,7 +27617,21 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, call } } } - httpRequest.body = null; + // 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) { @@ -24391,12 +27648,13 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, call try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -24416,7 +27674,7 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['CustomHostnameAnalysisResult']().mapper(); + let resultMapper = new client.models['StringDictionary']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -24432,28 +27690,18 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, call } /** - * @summary Applies the configuration settings from the target slot onto the - * current slot. + * @summary Gets the application settings of an app. * - * Applies the configuration settings from the target slot onto the current - * slot. + * 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} 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 {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. * @@ -24466,13 +27714,14 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, call * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, slot, options, callback) { +function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -24482,7 +27731,6 @@ function _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, sl if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -24505,15 +27753,15 @@ function _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, sl if (name === 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.'); } @@ -24523,13 +27771,13 @@ function _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, sl // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/applySlotConfig'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -24554,21 +27802,7 @@ function _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, sl } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -24585,12 +27819,13 @@ function _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, sl try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -24603,63 +27838,186 @@ function _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, sl // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Creates a backup of an app. + * @summary Updates the Authentication / Authorization settings associated with + * web app. * - * Creates a backup of an 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 the app. + * @param {string} name Name of web app. * - * @param {object} request Backup configuration. You can use the JSON response - * from the POST action as input here. + * @param {object} siteAuthSettings Auth settings associated with web app. * - * @param {string} request.backupRequestName Name of the backup. + * @param {boolean} [siteAuthSettings.enabled] true if the + * Authentication / Authorization feature is enabled for the current app; + * otherwise, false. * - * @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} [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} request.storageAccountUrl SAS URL to the container. + * @param {string} [siteAuthSettings.unauthenticatedClientAction] The action to + * take when an unauthenticated client attempts to access the app. Possible + * values include: 'RedirectToLoginPage', 'AllowAnonymous' * - * @param {object} [request.backupSchedule] Schedule for the backup if it is - * executed periodically. + * @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 {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 {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} 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 {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 {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} [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 {number} request.backupSchedule.retentionPeriodInDays After how many - * days backups should be deleted. + * @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 {date} [request.backupSchedule.startTime] When the schedule should - * start working. + * @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 {array} [request.databases] Databases included in the backup. + * @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 {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * @param {boolean} [siteAuthSettings.validateIssuer] Gets a value indicating + * whether the issuer should be a valid HTTPS url and be validated as such. * - * @param {string} [request.kind] Kind of resource. + * @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 {string} slot Name of the deployment slot. If a slot is not - * specified, the API will create a backup for the production slot. + * @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. * @@ -24673,13 +28031,13 @@ function _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, sl * {Error} 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. + * 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 _backupSlot(resourceGroupName, name, request, slot, options, callback) { +function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -24689,7 +28047,6 @@ function _backupSlot(resourceGroupName, name, request, slot, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -24712,8 +28069,8 @@ function _backupSlot(resourceGroupName, name, request, slot, options, callback) if (name === 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 (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.'); @@ -24721,6 +28078,9 @@ function _backupSlot(resourceGroupName, name, request, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -24730,20 +28090,20 @@ function _backupSlot(resourceGroupName, name, request, slot, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup'; + 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(apiVersion)); + queryParameters.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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -24765,14 +28125,14 @@ function _backupSlot(resourceGroupName, name, request, slot, options, callback) 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'); + 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(request, null, 2)}.`); + `payload - ${JSON.stringify(siteAuthSettings, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -24792,12 +28152,13 @@ function _backupSlot(resourceGroupName, name, request, slot, options, callback) try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -24817,7 +28178,7 @@ function _backupSlot(resourceGroupName, name, request, slot, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupItem']().mapper(); + let resultMapper = new client.models['SiteAuthSettings']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -24833,9 +28194,9 @@ function _backupSlot(resourceGroupName, name, request, slot, options, callback) } /** - * @summary Gets existing backups of an app. + * @summary Gets the Authentication/Authorization settings of an app. * - * Gets existing backups of an app. + * Gets the Authentication/Authorization settings of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -24843,7 +28204,7 @@ function _backupSlot(resourceGroupName, name, request, slot, options, callback) * @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. + * specified, the API will get the settings for the production slot. * * @param {object} [options] Optional Parameters. * @@ -24857,13 +28218,13 @@ function _backupSlot(resourceGroupName, name, request, slot, 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 BackupItemCollection} for more information. + * 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 _listBackupsSlot(resourceGroupName, name, slot, options, callback) { +function _getAuthSettingsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -24873,7 +28234,6 @@ function _listBackupsSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -24902,6 +28262,9 @@ function _listBackupsSlot(resourceGroupName, name, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -24911,20 +28274,20 @@ function _listBackupsSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups'; + 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(apiVersion)); + queryParameters.push('api-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 @@ -24959,12 +28322,13 @@ function _listBackupsSlot(resourceGroupName, name, slot, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -24984,7 +28348,7 @@ function _listBackupsSlot(resourceGroupName, name, slot, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupItemCollection']().mapper(); + let resultMapper = new client.models['SiteAuthSettings']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -25000,60 +28364,52 @@ function _listBackupsSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary Discovers an existing app backup that can be restored from a blob - * in Azure storage. + * @summary Updates the backup configuration of an app. * - * Discovers an existing app backup that can be restored from a blob in Azure - * storage. + * 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 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 {object} request Edited backup configuration. * - * @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 {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.siteName] Name of an app. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @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 {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. * - * @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 {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 {boolean} [request.ignoreDatabases] Ignore the databases and only - * restore the site content + * @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 {string} [request.appServicePlan] Specify app service plan that will - * own restored site. + * @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 {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. * - * @param {boolean} [request.adjustConnectionStrings] true if - * SiteConfig.ConnectionStrings should be set in new app; otherwise, - * false. + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. * - * @param {string} [request.hostingEnvironment] App Service Environment name, - * if needed (only when restoring an app to an App Service Environment). + * @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 perform discovery for the production slot. + * specified, the API will update the backup configuration for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -25067,13 +28423,13 @@ function _listBackupsSlot(resourceGroupName, name, slot, 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 RestoreRequest} for more information. + * 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 _discoverRestoreSlot(resourceGroupName, name, request, slot, options, callback) { +function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -25083,7 +28439,6 @@ function _discoverRestoreSlot(resourceGroupName, name, request, slot, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -25115,6 +28470,9 @@ function _discoverRestoreSlot(resourceGroupName, name, request, slot, options, c if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -25124,13 +28482,13 @@ function _discoverRestoreSlot(resourceGroupName, name, request, slot, options, c // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/discover'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -25160,7 +28518,7 @@ function _discoverRestoreSlot(resourceGroupName, name, request, slot, options, c let requestModel = null; try { if (request !== null && request !== undefined) { - let requestModelMapper = new client.models['RestoreRequest']().mapper(); + let requestModelMapper = new client.models['BackupRequest']().mapper(); requestModel = client.serialize(requestModelMapper, request, 'request'); requestContent = JSON.stringify(requestModel); } @@ -25186,12 +28544,13 @@ function _discoverRestoreSlot(resourceGroupName, name, request, slot, options, c try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -25211,7 +28570,7 @@ function _discoverRestoreSlot(resourceGroupName, name, request, slot, options, c parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RestoreRequest']().mapper(); + let resultMapper = new client.models['BackupRequest']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -25227,19 +28586,18 @@ function _discoverRestoreSlot(resourceGroupName, name, request, slot, options, c } /** - * @summary Gets a backup of an app by its ID. + * @summary Deletes the backup configuration of an app. * - * Gets a backup of an app by its ID. + * 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} 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. + * specified, the API will delete the backup configuration for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -25252,14 +28610,13 @@ function _discoverRestoreSlot(resourceGroupName, name, request, slot, 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 BackupItem} 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 _getBackupStatusSlot(resourceGroupName, name, backupId, slot, options, callback) { +function _deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -25269,7 +28626,6 @@ function _getBackupStatusSlot(resourceGroupName, name, backupId, slot, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -25292,15 +28648,15 @@ function _getBackupStatusSlot(resourceGroupName, name, backupId, slot, options, if (name === 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.'); } @@ -25310,21 +28666,20 @@ function _getBackupStatusSlot(resourceGroupName, name, backupId, slot, options, // 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}'; + 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('{backupId}', encodeURIComponent(backupId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -25377,42 +28732,24 @@ function _getBackupStatusSlot(resourceGroupName, name, backupId, slot, 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['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. + * @summary Gets the backup configuration of an app. * - * Deletes a backup of an app by its ID. + * 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} 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. + * specified, the API will get the backup configuration for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -25425,13 +28762,14 @@ function _getBackupStatusSlot(resourceGroupName, name, backupId, slot, options, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, callback) { +function _getBackupConfigurationSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -25441,7 +28779,6 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -25464,15 +28801,15 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, cal if (name === 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.'); } @@ -25482,21 +28819,20 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, cal // 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}'; + 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('{backupId}', encodeURIComponent(backupId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -25521,7 +28857,7 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, cal return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -25531,12 +28867,13 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, cal try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -25549,70 +28886,48 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, slot, 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['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 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. + * @summary Replaces the connection strings of an app. * - * 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. + * 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 web app. - * - * @param {string} backupId ID of backup. - * - * @param {object} request Information on backup request. - * - * @param {string} request.backupRequestName 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 {string} name Name of the app. * - * @param {array} [request.databases] Databases included in the backup. + * @param {object} connectionStrings Connection strings of the app or + * deployment slot. See example. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * @param {object} [connectionStrings.properties] Connection strings. * - * @param {string} [request.kind] Kind of resource. + * @param {string} [connectionStrings.kind] Kind of resource. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -25626,13 +28941,14 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, slot, 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 BackupItem} for more information. + * 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 _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request, slot, options, callback) { +function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -25642,7 +28958,6 @@ function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -25665,11 +28980,8 @@ function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request if (name === 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 (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.'); @@ -25677,6 +28989,9 @@ function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -25686,21 +29001,20 @@ function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request // 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'; + 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('{backupId}', encodeURIComponent(backupId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -25722,14 +29036,14 @@ function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, 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'); + 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(request, null, 2)}.`); + `payload - ${JSON.stringify(connectionStrings, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -25749,12 +29063,13 @@ function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -25774,7 +29089,7 @@ function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupItem']().mapper(); + let resultMapper = new client.models['ConnectionStringDictionary']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -25789,138 +29104,10 @@ function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request }); } - -/** - * @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' - * - * @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. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} for more information. - * - * {object} [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 - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RestoreResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in 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 + * @summary Gets the connection strings of an app. * - * List the configurations of an app + * Gets the connection strings of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -25928,7 +29115,7 @@ function _restoreSlot(resourceGroupName, name, backupId, request, slot, options, * @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. + * specified, the API will get the connection settings for the production slot. * * @param {object} [options] Optional Parameters. * @@ -25942,14 +29129,14 @@ function _restoreSlot(resourceGroupName, name, backupId, request, slot, 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 SiteConfigResourceCollection} for more + * 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 _listConfigurationsSlot(resourceGroupName, name, slot, options, callback) { +function _listConnectionStringsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -25959,7 +29146,6 @@ function _listConfigurationsSlot(resourceGroupName, name, slot, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -25988,6 +29174,9 @@ function _listConfigurationsSlot(resourceGroupName, name, slot, options, callbac if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -25997,20 +29186,20 @@ function _listConfigurationsSlot(resourceGroupName, name, slot, options, callbac // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config'; + 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(apiVersion)); + queryParameters.push('api-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 @@ -26045,12 +29234,13 @@ function _listConfigurationsSlot(resourceGroupName, name, slot, options, callbac try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -26070,7 +29260,7 @@ function _listConfigurationsSlot(resourceGroupName, name, slot, options, callbac parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigResourceCollection']().mapper(); + let resultMapper = new client.models['ConnectionStringDictionary']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -26086,23 +29276,17 @@ function _listConfigurationsSlot(resourceGroupName, name, slot, options, callbac } /** - * @summary Replaces the application settings of an app. + * @summary Gets the logging configuration of an app. * - * Replaces the application settings 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} 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 + * specified, the API will get the logging configuration for the production * slot. * * @param {object} [options] Optional Parameters. @@ -26117,13 +29301,13 @@ function _listConfigurationsSlot(resourceGroupName, name, slot, 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 StringDictionary} for more information. + * 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 _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, slot, options, callback) { +function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -26133,7 +29317,6 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, sl if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -26156,15 +29339,15 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, sl if (name === 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.'); } @@ -26174,20 +29357,20 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, sl // 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'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -26205,21 +29388,7 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, sl } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -26236,12 +29405,13 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, sl try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -26261,7 +29431,7 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, sl parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['StringDictionary']().mapper(); + let resultMapper = new client.models['SiteLogsConfig']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -26277,17 +29447,101 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, sl } /** - * @summary Gets the application settings of an app. + * @summary Updates the logging configuration of an app. * - * Gets the application settings 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 get the application settings for the production + * specified, the API will update the logging configuration for the production * slot. * * @param {object} [options] Optional Parameters. @@ -26302,13 +29556,13 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, sl * {Error} 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. + * 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 _listApplicationSettingsSlot(resourceGroupName, name, slot, options, callback) { +function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -26318,7 +29572,6 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -26341,12 +29594,18 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, ca if (name === 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.'); } @@ -26356,20 +29615,20 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, ca // 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'; + 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(apiVersion)); + queryParameters.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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -26387,7 +29646,21 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, ca } } } - httpRequest.body = null; + // 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) { @@ -26404,12 +29677,13 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, ca try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -26429,7 +29703,7 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, ca parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['StringDictionary']().mapper(); + let resultMapper = new client.models['SiteLogsConfig']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -26445,160 +29719,24 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, ca } /** - * @summary Updates the Authentication / Authorization settings associated with - * web app. + * @summary Replaces the metadata of an app. * - * Updates the Authentication / Authorization settings associated with web 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 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 {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} name Name of the app. * - * @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 {object} metadata Edited metadata of the app or deployment slot. See + * example. * - * @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 {object} [metadata.properties] Settings. * - * @param {string} [siteAuthSettings.kind] Kind of resource. + * @param {string} [metadata.kind] Kind of resource. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -26612,13 +29750,13 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, 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 SiteAuthSettings} for more information. + * 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 _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot, options, callback) { +function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -26628,7 +29766,6 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -26651,8 +29788,8 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot if (name === 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 (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.'); @@ -26660,6 +29797,9 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -26669,13 +29809,13 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -26704,14 +29844,14 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot 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'); + 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(siteAuthSettings, null, 2)}.`); + `payload - ${JSON.stringify(metadata, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -26731,12 +29871,13 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -26756,7 +29897,7 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteAuthSettings']().mapper(); + let resultMapper = new client.models['StringDictionary']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -26772,9 +29913,9 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot } /** - * @summary Gets the Authentication/Authorization settings of an app. + * @summary Gets the metadata of an app. * - * Gets the Authentication/Authorization settings of an app. + * Gets the metadata of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -26782,7 +29923,7 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot * @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. + * specified, the API will get the metadata for the production slot. * * @param {object} [options] Optional Parameters. * @@ -26796,13 +29937,13 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot * {Error} 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. + * 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 _getAuthSettingsSlot(resourceGroupName, name, slot, options, callback) { +function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -26812,7 +29953,6 @@ function _getAuthSettingsSlot(resourceGroupName, name, slot, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -26841,6 +29981,9 @@ function _getAuthSettingsSlot(resourceGroupName, name, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -26850,13 +29993,13 @@ function _getAuthSettingsSlot(resourceGroupName, name, slot, options, callback) // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -26898,12 +30041,13 @@ function _getAuthSettingsSlot(resourceGroupName, name, slot, options, callback) try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -26923,7 +30067,7 @@ function _getAuthSettingsSlot(resourceGroupName, name, slot, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteAuthSettings']().mapper(); + let resultMapper = new client.models['StringDictionary']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -26938,58 +30082,125 @@ function _getAuthSettingsSlot(resourceGroupName, name, slot, options, callback) }); } + /** - * @summary Updates the backup configuration of an app. + * @summary Gets the Git/FTP publishing credentials of an app. * - * Updates the backup configuration 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} request Edited backup configuration. + * @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 {string} request.backupRequestName Name of the backup. + * @param {object} [options] Optional Parameters. * - * @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 {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} request.storageAccountUrl SAS URL to the container. + * @param {function} callback - The callback. * - * @param {object} [request.backupSchedule] Schedule for the backup if it is - * executed periodically. + * @returns {function} callback(err, result, request, response) * - * @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) + * {Error} err - The Error object if an error occurred, null otherwise. * - * @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' + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link User} for more information. * - * @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. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {number} request.backupSchedule.retentionPeriodInDays After how many - * days backups should be deleted. + * {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. * - * @param {date} [request.backupSchedule.startTime] When the schedule should - * start working. + * Updates the Push settings associated with web app. * - * @param {array} [request.databases] Databases included in the backup. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * @param {string} name Name of web app. * - * @param {string} [request.kind] Kind of resource. + * @param {object} pushSettings Push settings associated with web app. * - * @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 {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. * @@ -27003,13 +30214,13 @@ function _getAuthSettingsSlot(resourceGroupName, name, slot, 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 BackupRequest} for more information. + * 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 _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, options, callback) { +function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -27019,7 +30230,6 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -27042,8 +30252,8 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, if (name === 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 (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.'); @@ -27051,6 +30261,9 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -27060,13 +30273,13 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -27095,14 +30308,14 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, 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'); + 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(request, null, 2)}.`); + `payload - ${JSON.stringify(pushSettings, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -27122,12 +30335,13 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -27147,7 +30361,7 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupRequest']().mapper(); + let resultMapper = new client.models['PushSettings']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -27163,18 +30377,17 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, } /** - * @summary Deletes the backup configuration of an app. + * @summary Gets the Push settings associated with web app. * - * Deletes the backup configuration of an 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 the app. + * @param {string} name Name of web 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 {string} slot Name of web app slot. If not specified then will + * default to production slot. * * @param {object} [options] Optional Parameters. * @@ -27187,13 +30400,14 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, callback) { +function _listSitePushSettingsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -27203,7 +30417,6 @@ function _deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -27232,6 +30445,9 @@ function _deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -27241,20 +30457,20 @@ function _deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, // 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'; + 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(apiVersion)); + queryParameters.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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -27289,12 +30505,13 @@ function _deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -27307,15 +30524,32 @@ function _deleteBackupConfigurationSlot(resourceGroupName, name, slot, 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['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 backup configuration of an app. + * @summary Gets a Swift Virtual Network connection. * - * Gets the backup configuration of an app. + * Gets a Swift Virtual Network connection. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -27323,8 +30557,8 @@ function _deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, * @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. + * specified, the API will get a gateway for the production slot's Virtual + * Network. * * @param {object} [options] Optional Parameters. * @@ -27338,13 +30572,13 @@ function _deleteBackupConfigurationSlot(resourceGroupName, name, slot, 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 BackupRequest} for more information. + * 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 _getBackupConfigurationSlot(resourceGroupName, name, slot, options, callback) { +function _getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -27354,7 +30588,6 @@ function _getBackupConfigurationSlot(resourceGroupName, name, slot, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -27383,6 +30616,9 @@ function _getBackupConfigurationSlot(resourceGroupName, name, slot, options, cal if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -27392,20 +30628,20 @@ function _getBackupConfigurationSlot(resourceGroupName, name, slot, options, cal // 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'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -27440,12 +30676,13 @@ function _getBackupConfigurationSlot(resourceGroupName, name, slot, options, cal try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -27465,7 +30702,7 @@ function _getBackupConfigurationSlot(resourceGroupName, name, slot, options, cal parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupRequest']().mapper(); + let resultMapper = new client.models['SwiftVirtualNetwork']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -27481,25 +30718,35 @@ function _getBackupConfigurationSlot(resourceGroupName, name, slot, options, cal } /** - * @summary Replaces the connection strings of an app. + * @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. * - * Replaces the connection strings of an app. + * 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} connectionStrings Connection strings of the app or - * deployment slot. See example. + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. * - * @param {object} [connectionStrings.properties] Connection strings. + * @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 {string} [connectionStrings.kind] Kind of resource. + * @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 update the connection settings for the production - * slot. + * specified, the API will add or update connections for the production slot. * * @param {object} [options] Optional Parameters. * @@ -27513,14 +30760,13 @@ function _getBackupConfigurationSlot(resourceGroupName, name, slot, 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 ConnectionStringDictionary} for more - * information. + * 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 _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings, slot, options, callback) { +function _createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -27530,7 +30776,6 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -27553,8 +30798,8 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings if (name === 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 (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.'); @@ -27562,6 +30807,9 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -27571,13 +30819,13 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -27606,14 +30854,14 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings 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'); + 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(connectionStrings, null, 2)}.`); + `payload - ${JSON.stringify(connectionEnvelope, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -27633,12 +30881,13 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -27658,7 +30907,7 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ConnectionStringDictionary']().mapper(); + let resultMapper = new client.models['SwiftVirtualNetwork']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -27674,9 +30923,10 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings } /** - * @summary Gets the connection strings of an app. + * @summary Deletes a Swift Virtual Network connection from an app (or + * deployment slot). * - * Gets the connection strings of an app. + * 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. @@ -27684,7 +30934,7 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings * @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. + * specified, the API will delete the connection for the production slot. * * @param {object} [options] Optional Parameters. * @@ -27697,15 +30947,13 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings * * {Error} 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [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) { +function _deleteSwiftVirtualNetworkSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -27715,7 +30963,6 @@ function _listConnectionStringsSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -27744,6 +30991,9 @@ function _listConnectionStringsSlot(resourceGroupName, name, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -27753,20 +31003,20 @@ function _listConnectionStringsSlot(resourceGroupName, name, slot, options, call // 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'; + 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(apiVersion)); + queryParameters.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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -27791,7 +31041,7 @@ function _listConnectionStringsSlot(resourceGroupName, name, slot, options, call return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -27819,41 +31069,41 @@ function _listConnectionStringsSlot(resourceGroupName, name, slot, options, call // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @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. * - * Gets the logging configuration of an app. + * 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 get the logging configuration for the production - * slot. + * specified, the API will add or update connections for the production slot. * * @param {object} [options] Optional Parameters. * @@ -27867,13 +31117,13 @@ function _listConnectionStringsSlot(resourceGroupName, name, slot, options, call * {Error} 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. + * 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 _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, options, callback) { +function _updateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -27883,7 +31133,6 @@ function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -27906,12 +31155,18 @@ function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, opti if (name === 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.'); } @@ -27921,20 +31176,20 @@ function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, opti // 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'; + 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(apiVersion)); + queryParameters.push('api-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 = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -27952,7 +31207,21 @@ function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, opti } } } - httpRequest.body = null; + // 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) { @@ -27963,149 +31232,67 @@ function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, opti let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + error.response = msRest.stripResponse(response); + if (responseBody === '') responseBody = null; + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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. * - * @param {object} [siteLogsConfig.detailedErrorMessages] Detailed error - * messages configuration. + * Gets the configuration of an app, such as platform version and bitness, + * default documents, virtual applications, Always On, etc. * - * @param {boolean} [siteLogsConfig.detailedErrorMessages.enabled] True if - * configuration is enabled, false if it is disabled and null if configuration - * is not set. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {string} [siteLogsConfig.kind] Kind of resource. + * @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 logging configuration for the production - * slot. + * specified, the API will return configuration for the production slot. * * @param {object} [options] Optional Parameters. * @@ -28119,13 +31306,13 @@ function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, 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 SiteLogsConfig} for more information. + * 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 _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig, slot, options, callback) { +function _getConfigurationSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -28135,7 +31322,6 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -28158,15 +31344,15 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig if (name === 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.'); } @@ -28176,20 +31362,20 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig // 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'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -28207,21 +31393,7 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -28238,12 +31410,13 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -28263,7 +31436,7 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteLogsConfig']().mapper(); + let resultMapper = new client.models['SiteConfigResource']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -28279,24 +31452,238 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig } /** - * @summary Replaces the metadata of an app. + * @summary Updates the configuration of an app. * - * Replaces the metadata 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} metadata Edited metadata of the app or deployment slot. See + * @param {object} siteConfig JSON representation of a SiteConfig object. See * example. * - * @param {object} [metadata.properties] Settings. + * @param {number} [siteConfig.numberOfWorkers] Number of workers. * - * @param {string} [metadata.kind] Kind of resource. + * @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 {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 the metadata for the production slot. + * specified, the API will update configuration for the production slot. * * @param {object} [options] Optional Parameters. * @@ -28310,13 +31697,13 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig * {Error} 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. + * 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 _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, callback) { +function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -28326,7 +31713,6 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -28349,8 +31735,8 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, c if (name === 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 (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.'); @@ -28358,6 +31744,9 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, c if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -28367,13 +31756,13 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, c // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -28402,14 +31791,14 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, c 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'); + 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(metadata, null, 2)}.`); + `payload - ${JSON.stringify(siteConfig, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -28429,12 +31818,13 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, c try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -28454,7 +31844,7 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, c parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['StringDictionary']().mapper(); + let resultMapper = new client.models['SiteConfigResource']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -28470,17 +31860,238 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, c } /** - * @summary Gets the metadata of an app. + * @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 {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. * - * Gets the metadata of an app. + * @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} resourceGroupName Name of the resource group to which the - * resource belongs. + * @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} name Name of the app. + * @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 get the metadata for the production slot. + * specified, the API will update configuration for the production slot. * * @param {object} [options] Optional Parameters. * @@ -28494,13 +32105,13 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, 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 StringDictionary} for more information. + * 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 _listMetadataSlot(resourceGroupName, name, slot, options, callback) { +function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -28510,7 +32121,6 @@ function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -28533,12 +32143,18 @@ function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { if (name === 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.'); } @@ -28548,20 +32164,20 @@ function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { // 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'; + 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(apiVersion)); + queryParameters.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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -28579,7 +32195,21 @@ function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { } } } - httpRequest.body = null; + // 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) { @@ -28596,12 +32226,13 @@ function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -28621,7 +32252,7 @@ function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['StringDictionary']().mapper(); + let resultMapper = new client.models['SiteConfigResource']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -28636,11 +32267,12 @@ function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { }); } - /** - * @summary Gets the Git/FTP publishing credentials of an app. + * @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 the Git/FTP publishing credentials of an app. + * 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. @@ -28648,113 +32280,7 @@ function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { * @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. + * specified, the API will return configuration for the production slot. * * @param {object} [options] Optional Parameters. * @@ -28768,13 +32294,14 @@ function _listPublishingCredentialsSlot(resourceGroupName, name, slot, 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 PushSettings} for more information. + * 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 _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, options, callback) { +function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -28784,7 +32311,6 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -28807,15 +32333,15 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot if (name === 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.'); } @@ -28825,20 +32351,20 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot // 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'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -28856,21 +32382,7 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -28887,12 +32399,13 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -28912,7 +32425,7 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PushSettings']().mapper(); + let resultMapper = new client.models['SiteConfigurationSnapshotInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -28928,17 +32441,20 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot } /** - * @summary Gets the Push settings associated with web app. + * @summary Gets a snapshot of the configuration of an app at a previous point + * in time. * - * Gets the Push settings associated with web app. + * 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 web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -28952,13 +32468,13 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot * {Error} 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. + * 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 _listSitePushSettingsSlot(resourceGroupName, name, slot, options, callback) { +function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -28968,7 +32484,6 @@ function _listSitePushSettingsSlot(resourceGroupName, name, slot, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -28991,12 +32506,18 @@ function _listSitePushSettingsSlot(resourceGroupName, name, slot, options, callb if (name === 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.'); } @@ -29006,20 +32527,21 @@ function _listSitePushSettingsSlot(resourceGroupName, name, slot, options, callb // 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'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -29054,12 +32576,13 @@ function _listSitePushSettingsSlot(resourceGroupName, name, slot, options, callb try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -29079,7 +32602,7 @@ function _listSitePushSettingsSlot(resourceGroupName, name, slot, options, callb parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PushSettings']().mapper(); + let resultMapper = new client.models['SiteConfigResource']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -29095,17 +32618,17 @@ function _listSitePushSettingsSlot(resourceGroupName, name, slot, options, callb } /** - * @summary Gets the configuration of an app, such as platform version and - * bitness, default documents, virtual applications, Always On, etc. + * @summary Reverts the configuration of an app to a previous snapshot. * - * Gets the configuration of an app, such as platform version and bitness, - * default documents, virtual applications, Always On, etc. + * 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. * @@ -29120,14 +32643,13 @@ function _listSitePushSettingsSlot(resourceGroupName, name, slot, 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 SiteConfigResource} 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 _getConfigurationSlot(resourceGroupName, name, slot, options, callback) { +function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -29137,7 +32659,6 @@ function _getConfigurationSlot(resourceGroupName, name, slot, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -29160,12 +32681,18 @@ function _getConfigurationSlot(resourceGroupName, name, slot, options, callback) if (name === 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.'); } @@ -29175,20 +32702,21 @@ function _getConfigurationSlot(resourceGroupName, name, slot, options, callback) // 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'; + 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(apiVersion)); + queryParameters.push('api-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 @@ -29213,7 +32741,7 @@ function _getConfigurationSlot(resourceGroupName, name, slot, 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); @@ -29238,248 +32766,26 @@ function _getConfigurationSlot(resourceGroupName, name, slot, options, callback) } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 {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 {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 {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + // 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 * - * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web - * site to allow clients to connect over http2.0 + * Gets the last lines of docker logs for the given site * - * @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} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {string} [siteConfig.kind] Kind of resource. + * @param {string} name Name of web app. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will update configuration for the production slot. + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. * * @param {object} [options] Optional Parameters. * @@ -29493,13 +32799,12 @@ function _getConfigurationSlot(resourceGroupName, name, slot, 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 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) { +function _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -29509,7 +32814,6 @@ function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, s if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -29532,15 +32836,15 @@ function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, s if (name === 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.'); } @@ -29550,20 +32854,20 @@ function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, s // 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'; + 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(apiVersion)); + queryParameters.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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -29581,36 +32885,24 @@ function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, s } } } - // 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; + 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) { - let error = new Error(responseBody); + 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 { - parsedErrorResponse = JSON.parse(responseBody); + if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; @@ -29627,248 +32919,177 @@ function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, s } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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); - } - } + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } /** - * @summary Updates the configuration of an app. + * @summary Gets the ZIP archived docker log files for the given site * - * Updates the configuration of an app. + * 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 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 {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 {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} name Name of web app. * - * @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} slot Name of web app slot. If not specified then will + * default to production slot. * - * @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 {object} [options] Optional Parameters. * - * @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 {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [siteConfig.push.kind] Kind of resource. + * @param {function} callback - The callback. * - * @param {object} [siteConfig.apiDefinition] Information about the formal API - * definition for the app. + * @returns {function} callback(err, result, request, response) * - * @param {string} [siteConfig.apiDefinition.url] The URL of the API - * definition. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {string} [siteConfig.autoSwapSlotName] Auto-swap slot name. + * {object} [result] - The deserialized result object if an error did not occur. * - * @param {boolean} [siteConfig.localMySqlEnabled] true to enable - * local MySQL; otherwise, false. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * {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. * - * @param {boolean} [siteConfig.http20Enabled] Http20Enabled: configures a web - * site to allow clients to connect over http2.0 + * List continuous web jobs for an app, or a deployment slot. * - * @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} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {string} [siteConfig.kind] Kind of resource. + * @param {string} name Site name. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will update configuration for the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -29882,13 +33103,14 @@ function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, s * {Error} 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. + * 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 _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, options, callback) { +function _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -29898,7 +33120,6 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -29921,15 +33142,15 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, opt if (name === 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.'); } @@ -29939,20 +33160,20 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, opt // 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'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -29970,21 +33191,7 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, opt } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -30001,12 +33208,13 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, opt try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -30026,7 +33234,7 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, opt parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigResource']().mapper(); + let resultMapper = new client.models['ContinuousWebJobCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -30042,19 +33250,20 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, opt } /** - * @summary Gets a list of web app configuration snapshots identifiers. Each - * element of the list contains a timestamp and the ID of the snapshot. + * @summary Gets a continuous web job by its ID for an app, or a deployment + * slot. * - * 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 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 Name of the app. + * @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 will return configuration for the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -30068,14 +33277,13 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, 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 SiteConfigurationSnapshotInfoCollection} for - * more information. + * 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 _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, options, callback) { +function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -30085,7 +33293,6 @@ function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -30108,12 +33315,18 @@ function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, optio if (name === 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.'); } @@ -30123,13 +33336,14 @@ function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, optio // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -30161,7 +33375,7 @@ function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, optio return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -30196,7 +33410,7 @@ function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, optio parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigurationSnapshotInfoCollection']().mapper(); + let resultMapper = new client.models['ContinuousWebJob']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -30212,20 +33426,20 @@ function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, optio } /** - * @summary Gets a snapshot of the configuration of an app at a previous point - * in time. + * @summary Delete a continuous web job by its ID for an app, or a deployment + * slot. * - * Gets a snapshot of the configuration of an app at a previous point in time. + * 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 Name of the app. + * @param {string} name Site name. * - * @param {string} snapshotId The ID of the snapshot to read. + * @param {string} webJobName Name of Web Job. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will return configuration for the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -30238,14 +33452,13 @@ function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, 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 SiteConfigResource} 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 _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot, options, callback) { +function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -30255,7 +33468,6 @@ function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -30278,8 +33490,8 @@ function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot if (name === 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 (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.'); @@ -30287,6 +33499,9 @@ function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -30296,21 +33511,21 @@ function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot // 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}'; + 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('{snapshotId}', encodeURIComponent(snapshotId)); + 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(apiVersion)); + queryParameters.push('api-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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -30335,7 +33550,7 @@ function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot 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); @@ -30363,42 +33578,25 @@ function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @summary Start a continuous web job for an app, or a deployment slot. * - * Reverts the configuration of an app to a previous snapshot. + * 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 Name of the app. + * @param {string} name Site name. * - * @param {string} snapshotId The ID of the snapshot to read. + * @param {string} webJobName Name of Web Job. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will return configuration for the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -30417,7 +33615,7 @@ function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot, options, callback) { +function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -30427,7 +33625,6 @@ function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshot if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -30450,8 +33647,8 @@ function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshot if (name === 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 (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.'); @@ -30459,6 +33656,9 @@ function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshot if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -30468,14 +33668,14 @@ function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshot // 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'; + 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('{snapshotId}', encodeURIComponent(snapshotId)); + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -30507,7 +33707,7 @@ function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshot return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -30541,17 +33741,19 @@ function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshot } /** - * @summary Gets the last lines of docker logs for the given site + * @summary Stop a continuous web job for an app, or a deployment slot. * - * Gets the last lines of docker logs for the given site + * 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 Name of web app. + * @param {string} name Site name. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -30564,13 +33766,13 @@ function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshot * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [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. */ -function _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, callback) { +function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -30580,7 +33782,6 @@ function _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -30603,12 +33804,18 @@ function _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, ca if (name === 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.'); } @@ -30618,13 +33825,14 @@ function _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -30651,22 +33859,20 @@ function _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, ca } 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}`); + 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 { - if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); + parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; @@ -30683,25 +33889,26 @@ function _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, ca } return callback(error); } - // Create Result - let result = response; + let result = null; + if (responseBody === '') responseBody = null; + return callback(null, result, httpRequest, response); }); } /** - * @summary Gets the ZIP archived docker log files for the given site + * @summary List deployments for an app, or a deployment slot. * - * Gets the ZIP archived docker log files for the given site + * 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 web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -30715,12 +33922,13 @@ function _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, 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 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 _getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, callback) { +function _listDeploymentsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -30730,7 +33938,6 @@ function _getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -30759,6 +33966,9 @@ function _getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -30768,20 +33978,20 @@ function _getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, // 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'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -30801,29 +34011,28 @@ function _getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, } 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}`); + if (statusCode !== 200) { + let error = new Error(responseBody); 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); + parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -30833,25 +34042,45 @@ function _getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, } return callback(error); } - // Create Result - let result = response; + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 List continuous web jobs for an app, or a deployment slot. + * @summary Get a deployment by its ID for an app, or a deployment slot. * - * List continuous web jobs 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 Site name. + * @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. + * specified, the API gets a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -30865,14 +34094,13 @@ function _getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, 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 ContinuousWebJobCollection} for more - * information. + * 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 _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, callback) { +function _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -30882,7 +34110,6 @@ function _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -30905,12 +34132,18 @@ function _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, call if (name === 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.'); } @@ -30920,13 +34153,14 @@ function _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -30968,12 +34202,13 @@ function _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, call try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -30993,7 +34228,7 @@ function _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ContinuousWebJobCollection']().mapper(); + let resultMapper = new client.models['Deployment']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -31009,20 +34244,42 @@ function _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, call } /** - * @summary Gets a continuous web job by its ID for an app, or a deployment - * slot. + * @summary Create a deployment for an app, or a deployment slot. * - * Gets a continuous web job by its ID 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 Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @param {string} id ID of an existing deployment. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. + * 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. * @@ -31036,13 +34293,13 @@ function _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, call * {Error} 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. + * 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 _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -31052,7 +34309,6 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -31075,15 +34331,21 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, opt if (name === 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 (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.'); } @@ -31093,21 +34355,21 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, opt // 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}'; + 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('{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(apiVersion)); + queryParameters.push('api-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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -31125,14 +34387,28 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, opt } } } - httpRequest.body = null; + // 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 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -31142,12 +34418,13 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, opt try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -31167,7 +34444,7 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, opt parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ContinuousWebJob']().mapper(); + let resultMapper = new client.models['Deployment']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -31183,17 +34460,16 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, opt } /** - * @summary Delete a continuous web job by its ID for an app, or a deployment - * slot. + * @summary Delete a deployment 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. + * 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 Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @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. @@ -31215,7 +34491,7 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, opt * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -31225,7 +34501,6 @@ function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -31248,8 +34523,8 @@ function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, if (name === 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.'); @@ -31257,6 +34532,9 @@ function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -31266,14 +34544,14 @@ function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, // 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}'; + 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('{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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -31339,19 +34617,23 @@ function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, } /** - * @summary Start a continuous web job for an app, or a deployment slot. + * @summary List deployment log for specific deployment for an app, or a + * deployment slot. * - * Start a continuous web job 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 Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @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 deletes a deployment for the production slot. + * specified, the API returns deployments for the production slot. * * @param {object} [options] Optional Parameters. * @@ -31364,13 +34646,14 @@ function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -31380,7 +34663,6 @@ function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -31403,8 +34685,8 @@ function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, o if (name === 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.'); @@ -31412,6 +34694,9 @@ function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, o if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -31421,21 +34706,21 @@ function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, o // 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'; + 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('{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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -31460,7 +34745,7 @@ function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, o return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -31470,12 +34755,13 @@ function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, o try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -31488,25 +34774,84 @@ function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, 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['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 Stop a continuous web job for an app, or a deployment slot. + * @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. * - * Stop a continuous web job for an app, or a deployment slot. + * 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 Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @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 deletes a deployment for the production slot. + * specified, the API will perform discovery for the production slot. * * @param {object} [options] Optional Parameters. * @@ -31519,13 +34864,14 @@ function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, o * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _discoverBackupSlot(resourceGroupName, name, request, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -31535,7 +34881,6 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -31558,8 +34903,8 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op if (name === 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 (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.'); @@ -31567,6 +34912,9 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -31576,14 +34924,13 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op // 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'; + 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('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -31608,14 +34955,28 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op } } } - httpRequest.body = null; + // 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 !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -31625,12 +34986,13 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -31643,15 +35005,32 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 List deployments for an app, or a deployment slot. + * @summary Lists ownership identifiers for domain associated with web app. * - * List deployments for an app, or a deployment slot. + * Lists ownership identifiers for domain associated with web app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -31659,7 +35038,7 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op * @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. + * specified, the API will delete the binding for the production slot. * * @param {object} [options] Optional Parameters. * @@ -31673,13 +35052,13 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op * {Error} 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. + * 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 _listDeploymentsSlot(resourceGroupName, name, slot, options, callback) { +function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -31689,7 +35068,6 @@ function _listDeploymentsSlot(resourceGroupName, name, slot, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -31718,6 +35096,9 @@ function _listDeploymentsSlot(resourceGroupName, name, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -31727,13 +35108,13 @@ function _listDeploymentsSlot(resourceGroupName, name, slot, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -31775,12 +35156,13 @@ function _listDeploymentsSlot(resourceGroupName, name, slot, options, callback) try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -31800,7 +35182,7 @@ function _listDeploymentsSlot(resourceGroupName, name, slot, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DeploymentCollection']().mapper(); + let resultMapper = new client.models['IdentifierCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -31816,19 +35198,20 @@ function _listDeploymentsSlot(resourceGroupName, name, slot, options, callback) } /** - * @summary Get a deployment by its ID for an app, or a deployment slot. + * @summary Get domain ownership identifier for web app. * - * Get a deployment by its ID for an app, or a deployment slot. + * 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} id Deployment ID. + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API gets a deployment for the production slot. + * specified, the API will delete the binding for the production slot. * * @param {object} [options] Optional Parameters. * @@ -31842,13 +35225,13 @@ function _listDeploymentsSlot(resourceGroupName, name, slot, 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 Deployment} for more information. + * 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 _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback) { +function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -31858,7 +35241,6 @@ function _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -31881,8 +35263,8 @@ function _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback if (name === 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 (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.'); @@ -31890,6 +35272,9 @@ function _getDeploymentSlot(resourceGroupName, name, id, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -31899,14 +35284,14 @@ function _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback // 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}'; + 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('{id}', encodeURIComponent(id)); + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -31948,12 +35333,13 @@ function _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -31973,7 +35359,7 @@ function _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Deployment']().mapper(); + let resultMapper = new client.models['Identifier']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -31989,44 +35375,30 @@ function _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback } /** - * @summary Create a deployment for an app, or a deployment slot. + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. * - * Create a deployment for an app, or a deployment slot. + * 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} 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 {string} [deployment.deploymentId] Identifier for deployment. - * - * @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 {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. * - * @param {date} [deployment.endTime] End time. + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. * - * @param {boolean} [deployment.active] True if deployment is currently active, - * false if completed and null if not started. + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. * - * @param {string} [deployment.details] Details on deployment. + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. * - * @param {string} [deployment.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. * @@ -32040,13 +35412,13 @@ function _getDeploymentSlot(resourceGroupName, name, id, slot, 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 Deployment} for more information. + * 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 _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, options, callback) { +function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -32056,7 +35428,6 @@ function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -32079,18 +35450,21 @@ function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, op if (name === 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 (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 (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.'); } @@ -32100,14 +35474,14 @@ function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, op // 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}'; + 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('{id}', encodeURIComponent(id)); + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -32136,14 +35510,14 @@ function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, op 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'); + 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(deployment, null, 2)}.`); + `payload - ${JSON.stringify(domainOwnershipIdentifier, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -32163,12 +35537,13 @@ function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, op try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -32188,7 +35563,7 @@ function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, op parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Deployment']().mapper(); + let resultMapper = new client.models['Identifier']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -32204,19 +35579,20 @@ function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, op } /** - * @summary Delete a deployment by its ID for an app, or a deployment slot. + * @summary Deletes a domain ownership identifier for a web app. * - * Delete a deployment by its ID for an app, or a deployment slot. + * 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} id Deployment ID. + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. + * specified, the API will delete the binding for the production slot. * * @param {object} [options] Optional Parameters. * @@ -32235,7 +35611,7 @@ function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, op * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callback) { +function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -32245,7 +35621,6 @@ function _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -32268,8 +35643,8 @@ function _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callb if (name === 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 (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.'); @@ -32277,6 +35652,9 @@ function _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callb if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -32286,14 +35664,14 @@ function _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callb // 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}'; + 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('{id}', encodeURIComponent(id)); + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -32359,23 +35737,30 @@ function _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callb } /** - * @summary List deployment log for specific deployment for an app, or a - * deployment slot. + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. * - * List deployment log for specific deployment for an app, or a deployment - * slot. + * 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} 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} 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 returns deployments for the production slot. + * specified, the API will delete the binding for the production slot. * * @param {object} [options] Optional Parameters. * @@ -32389,13 +35774,13 @@ function _deleteDeploymentSlot(resourceGroupName, name, id, slot, 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 Deployment} for more information. + * 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 _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, callback) { +function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -32405,7 +35790,6 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -32428,8 +35812,11 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, call if (name === 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 (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.'); @@ -32437,6 +35824,9 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -32446,21 +35836,21 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, call // 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'; + 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('{id}', encodeURIComponent(id)); + 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(apiVersion)); + queryParameters.push('api-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 = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -32478,7 +35868,21 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, call } } } - httpRequest.body = null; + // 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) { @@ -32495,12 +35899,13 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, call try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -32520,7 +35925,7 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Deployment']().mapper(); + let resultMapper = new client.models['Identifier']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -32536,17 +35941,17 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, call } /** - * @summary Lists ownership identifiers for domain associated with web app. + * @summary Get the status of the last MSDeploy operation. * - * Lists ownership identifiers for domain associated with web app. + * 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 the app. + * @param {string} name Name of web 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} slot Name of web app slot. If not specified then will + * default to production slot. * * @param {object} [options] Optional Parameters. * @@ -32560,13 +35965,13 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, call * {Error} 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. + * 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 _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, options, callback) { +function _getMSDeployStatusSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -32576,7 +35981,6 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -32605,6 +36009,9 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, opti if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -32614,13 +36021,13 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, opti // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -32662,12 +36069,13 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, opti try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -32687,7 +36095,7 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, opti parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['IdentifierCollection']().mapper(); + let resultMapper = new client.models['MSDeployStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -32702,21 +36110,47 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, opti }); } + /** - * @summary Get domain ownership identifier for web app. + * @summary Invoke the MSDeploy web app extension. * - * Get domain ownership identifier for web app. + * Invoke the MSDeploy web app extension. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name Name of web app. * - * @param {string} domainOwnershipIdentifierName Name of domain ownership - * identifier. + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. * - * @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} 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. * @@ -32730,13 +36164,96 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, 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 Identifier} for more information. + * 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 _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, slot, options, callback) { +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') { @@ -32746,7 +36263,6 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -32769,15 +36285,15 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners if (name === 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.'); } @@ -32787,14 +36303,13 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners // 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}'; + 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('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -32826,7 +36341,7 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -32861,7 +36376,7 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Identifier']().mapper(); + let resultMapper = new client.models['MSDeployLog']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -32877,30 +36392,17 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners } /** - * @summary Creates a domain ownership identifier for web app, or updates an - * existing ownership identifier. + * @summary List the functions for a web site, or a deployment slot. * - * Creates a domain ownership identifier for web app, or updates an existing - * ownership identifier. + * 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 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} name Site name. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will delete the binding for the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -32914,13 +36416,14 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners * {Error} 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. + * 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 _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, options, callback) { +function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -32930,7 +36433,6 @@ function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, d if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -32953,18 +36455,15 @@ function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, d if (name === 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.'); } @@ -32974,21 +36473,20 @@ function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, d // 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}'; + 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('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -33006,28 +36504,14 @@ function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, d } } } - // 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; + httpRequest.body = null; // 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 !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -33062,7 +36546,7 @@ function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, d parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Identifier']().mapper(); + let resultMapper = new client.models['FunctionEnvelopeCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -33078,20 +36562,17 @@ function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, d } /** - * @summary Deletes a domain ownership identifier for a web app. + * @summary Fetch a short lived token that can be exchanged for a master key. * - * Deletes a domain ownership identifier for a web app. + * 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 the app. - * - * @param {string} domainOwnershipIdentifierName Name of domain ownership - * identifier. + * @param {string} name Name of web 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} slot Name of web app slot. If not specified then will + * default to production slot. * * @param {object} [options] Optional Parameters. * @@ -33104,13 +36585,13 @@ function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, d * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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 _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, slot, options, callback) { +function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -33120,7 +36601,6 @@ function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -33143,15 +36623,15 @@ function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn if (name === 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.'); } @@ -33161,21 +36641,20 @@ function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn // 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}'; + 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('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -33200,7 +36679,7 @@ function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -33210,12 +36689,13 @@ function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -33228,36 +36708,49 @@ function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn // Create Result let result = null; if (responseBody === '') responseBody = null; + // 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 Creates a domain ownership identifier for web app, or updates an - * existing ownership identifier. + * @summary Get function information by its ID for web site, or a deployment + * slot. * - * Creates a domain ownership identifier for web app, or updates an existing - * ownership identifier. + * 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 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} name Site name. * - * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * @param {string} functionName Function name. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will delete the binding for the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -33271,13 +36764,13 @@ function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn * {Error} 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. + * 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 _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, options, callback) { +function _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -33287,7 +36780,6 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -33310,11 +36802,8 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn if (name === 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 (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.'); @@ -33322,6 +36811,9 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -33331,21 +36823,21 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn // 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}'; + 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('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -33363,28 +36855,14 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn } } } - // 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; + httpRequest.body = null; // 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 !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -33419,7 +36897,7 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Identifier']().mapper(); + let resultMapper = new client.models['FunctionEnvelope']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -33434,18 +36912,44 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn }); } + /** - * @summary Get the status of the last MSDeploy operation. + * @summary Create function for web site, or a deployment slot. * - * Get the status of the last MSDeploy operation. + * 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 Name of web app. + * @param {string} name Site name. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -33459,13 +36963,97 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn * {Error} 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. + * 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 _getMSDeployStatusSlot(resourceGroupName, name, slot, options, callback) { +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') { @@ -33475,7 +37063,6 @@ function _getMSDeployStatusSlot(resourceGroupName, name, slot, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -33498,12 +37085,18 @@ function _getMSDeployStatusSlot(resourceGroupName, name, slot, options, callback if (name === 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.'); } @@ -33513,20 +37106,21 @@ function _getMSDeployStatusSlot(resourceGroupName, name, slot, options, callback // 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'; + 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(apiVersion)); + queryParameters.push('api-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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -33551,7 +37145,7 @@ function _getMSDeployStatusSlot(resourceGroupName, name, slot, options, callback return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 204 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -33579,152 +37173,26 @@ function _getMSDeployStatusSlot(resourceGroupName, name, slot, 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['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. + * @summary Get function secrets for a function in a web site, or a deployment + * slot. * - * Invoke the MSDeploy web app extension. + * 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 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 Site name. * - * @param {string} name Name of web app. + * @param {string} functionName Function name. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -33738,13 +37206,13 @@ function _createMSDeployOperationSlot(resourceGroupName, name, slot, mSDeploy, 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 MSDeployLog} for more information. + * 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 _getMSDeployLogSlot(resourceGroupName, name, slot, options, callback) { +function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -33754,7 +37222,6 @@ function _getMSDeployLogSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -33777,12 +37244,18 @@ function _getMSDeployLogSlot(resourceGroupName, name, slot, options, callback) { if (name === 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.'); } @@ -33792,20 +37265,21 @@ function _getMSDeployLogSlot(resourceGroupName, name, slot, options, callback) { // 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'; + 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(apiVersion)); + queryParameters.push('api-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 @@ -33830,7 +37304,7 @@ function _getMSDeployLogSlot(resourceGroupName, name, slot, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -33840,12 +37314,13 @@ function _getMSDeployLogSlot(resourceGroupName, name, slot, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -33865,7 +37340,7 @@ function _getMSDeployLogSlot(resourceGroupName, name, slot, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MSDeployLog']().mapper(); + let resultMapper = new client.models['FunctionSecrets']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -33881,17 +37356,17 @@ function _getMSDeployLogSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary List the functions for a web site, or a deployment slot. + * @summary Get hostname bindings for an app or a deployment slot. * - * List the functions for a web site, 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 Site name. + * @param {string} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. + * specified, the API gets hostname bindings for the production slot. * * @param {object} [options] Optional Parameters. * @@ -33905,14 +37380,14 @@ function _getMSDeployLogSlot(resourceGroupName, name, slot, 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 FunctionEnvelopeCollection} for more + * 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 _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, callback) { +function _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -33922,7 +37397,6 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -33951,6 +37425,9 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -33960,13 +37437,13 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -33998,7 +37475,7 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, call return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -34008,12 +37485,13 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, call try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -34033,7 +37511,7 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionEnvelopeCollection']().mapper(); + let resultMapper = new client.models['HostNameBindingCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -34049,17 +37527,21 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, call } /** - * @summary Fetch a short lived token that can be exchanged for a master key. + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). * - * Fetch a short lived token that can be exchanged for a master key. + * 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 web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -34072,13 +37554,14 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, call * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [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 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 _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, callback) { +function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -34088,7 +37571,6 @@ function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -34114,9 +37596,15 @@ function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, cal if (slot === 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.'); } @@ -34126,13 +37614,14 @@ function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, cal // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -34174,12 +37663,13 @@ function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, cal try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -34199,13 +37689,7 @@ function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, cal parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; + let resultMapper = new client.models['HostNameBinding']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -34221,20 +37705,45 @@ function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, cal } /** - * @summary Get function information by its ID for web site, or a deployment - * slot. + * @summary Creates a hostname binding for an app. * - * Get function information by its ID for web site, or a deployment slot. + * Creates a hostname binding for an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @param {string} name Name of the app. * - * @param {string} functionName Function name. + * @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 deletes a deployment for the production slot. + * specified, the API will create a binding for the production slot. * * @param {object} [options] Optional Parameters. * @@ -34248,13 +37757,13 @@ function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, 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 FunctionEnvelope} for more information. + * 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 _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, callback) { +function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, hostNameBinding, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -34264,7 +37773,6 @@ function _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -34287,8 +37795,11 @@ function _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, o if (name === 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 (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.'); @@ -34296,6 +37807,9 @@ function _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, o if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -34305,21 +37819,21 @@ function _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, o // 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}'; + 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('{functionName}', encodeURIComponent(functionName)); + 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(apiVersion)); + queryParameters.push('api-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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -34337,14 +37851,28 @@ function _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, o } } } - httpRequest.body = null; + // 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 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -34354,12 +37882,13 @@ function _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, o try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -34379,7 +37908,7 @@ function _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, o parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionEnvelope']().mapper(); + let resultMapper = new client.models['HostNameBinding']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -34394,127 +37923,20 @@ function _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, o }); } - /** - * @summary Create function for web site, or a deployment slot. + * @summary Deletes a hostname binding for an app. * - * Create function for web site, or a deployment slot. + * Deletes a hostname binding for an app. * * @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} name Name of the app. * * @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.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. + * specified, the API will delete the binding for the production slot. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. + * @param {string} hostName Hostname in the hostname binding. * * @param {object} [options] Optional Parameters. * @@ -34533,7 +37955,7 @@ function _createInstanceFunctionSlot(resourceGroupName, name, functionName, slot * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, callback) { +function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -34543,7 +37965,6 @@ function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -34566,15 +37987,18 @@ function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot if (name === 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 (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.'); } @@ -34584,14 +38008,14 @@ function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot // 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}'; + 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('{functionName}', encodeURIComponent(functionName)); 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -34623,7 +38047,7 @@ function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -34657,20 +38081,21 @@ function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot } /** - * @summary Get function secrets for a function in a web site, or a deployment - * slot. + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. * - * Get function secrets for a function in a web site, or a deployment slot. + * 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 Site name. + * @param {string} name The name of the web app. * - * @param {string} functionName Function name. + * @param {string} namespaceName The namespace for this hybrid connection. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. + * @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. * @@ -34684,13 +38109,13 @@ function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot * {Error} 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. + * 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 _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, options, callback) { +function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -34700,7 +38125,6 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -34723,8 +38147,11 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, o if (name === 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 (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.'); @@ -34732,6 +38159,9 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, o if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -34741,21 +38171,22 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, o // 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'; + 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('{functionName}', encodeURIComponent(functionName)); + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -34790,12 +38221,13 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, o try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -34815,7 +38247,7 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, o parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionSecrets']().mapper(); + let resultMapper = new client.models['HybridConnection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -34831,17 +38263,48 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, o } /** - * @summary Get hostname bindings for an app or a deployment slot. + * @summary Creates a new Hybrid Connection using a Service Bus relay. * - * Get hostname bindings for an app or a deployment slot. + * 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 Name of the app. + * @param {string} name The name of the web 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 {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. * @@ -34855,14 +38318,13 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, 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 HostNameBindingCollection} for more - * information. + * 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 _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callback) { +function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -34872,7 +38334,6 @@ function _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -34895,12 +38356,24 @@ function _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callb if (name === 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.'); } @@ -34910,20 +38383,22 @@ function _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings'; + 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(apiVersion)); + queryParameters.push('api-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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -34941,7 +38416,21 @@ function _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callb } } } - httpRequest.body = null; + // 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) { @@ -34958,12 +38447,13 @@ function _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callb try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -34983,7 +38473,7 @@ function _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callb parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HostNameBindingCollection']().mapper(); + let resultMapper = new client.models['HybridConnection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -34999,21 +38489,20 @@ function _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callb } /** - * @summary Get the named hostname binding for an app (or deployment slot, if - * specified). + * @summary Removes a Hybrid Connection from this site. * - * Get the named hostname binding for an app (or deployment slot, if - * specified). + * Removes a Hybrid Connection from this site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name The name of the web 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} namespaceName The namespace for this hybrid connection. * - * @param {string} hostName Hostname in the hostname binding. + * @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. * @@ -35026,14 +38515,13 @@ function _listHostNameBindingsSlot(resourceGroupName, name, slot, 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 HostNameBinding} 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 _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, callback) { +function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -35043,7 +38531,6 @@ function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -35066,15 +38553,21 @@ function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, option if (name === 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 (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.'); } @@ -35084,21 +38577,22 @@ function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, option // 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}'; + 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('{hostName}', encodeURIComponent(hostName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -35123,7 +38617,7 @@ function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, option return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -35151,68 +38645,54 @@ function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, option // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @summary Creates a new Hybrid Connection using a Service Bus relay. * - * Creates a hostname binding for an app. + * 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 Name of the app. + * @param {string} name The name of the web app. * - * @param {string} hostName Hostname in the hostname binding. + * @param {string} namespaceName The namespace for this hybrid connection. * - * @param {object} hostNameBinding Binding details. This is the JSON - * representation of a HostNameBinding object. + * @param {string} relayName The relay name for this hybrid connection. * - * @param {string} [hostNameBinding.siteName] App Service app name. + * @param {object} connectionEnvelope The details of the hybrid connection. * - * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain - * resource URI. + * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the + * Service Bus namespace. * - * @param {string} [hostNameBinding.azureResourceName] Azure resource name. + * @param {string} [connectionEnvelope.relayName] The name of the Service Bus + * relay. * - * @param {string} [hostNameBinding.azureResourceType] Azure resource type. - * Possible values include: 'Website', 'TrafficManager' + * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service + * Bus relay. * - * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS - * record type. Possible values include: 'CName', 'A' + * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. * - * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible - * values include: 'Verified', 'Managed' + * @param {number} [connectionEnvelope.port] The port of the endpoint. * - * @param {string} [hostNameBinding.sslState] SSL type. Possible values - * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' + * @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} [hostNameBinding.thumbprint] SSL certificate thumbprint + * @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} [hostNameBinding.kind] Kind of resource. + * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the + * service bus endpoint. By default this is .servicebus.windows.net * - * @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 {string} [connectionEnvelope.kind] Kind of resource. + * + * @param {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. * @@ -35226,13 +38706,13 @@ function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, 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 HostNameBinding} for more information. + * 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 _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, hostNameBinding, slot, options, callback) { +function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -35242,7 +38722,6 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -35265,11 +38744,14 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h if (name === 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 (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 (hostNameBinding === null || hostNameBinding === undefined) { - throw new Error('hostNameBinding cannot be null or undefined.'); + 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.'); @@ -35277,6 +38759,9 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -35286,21 +38771,22 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h // 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}'; + 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('{hostName}', encodeURIComponent(hostName)); + 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(apiVersion)); + queryParameters.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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -35322,14 +38808,14 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h 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'); + 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(hostNameBinding, null, 2)}.`); + `payload - ${JSON.stringify(connectionEnvelope, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -35349,12 +38835,13 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -35374,7 +38861,7 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HostNameBinding']().mapper(); + let resultMapper = new client.models['HybridConnection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -35390,19 +38877,20 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h } /** - * @summary Deletes a hostname binding for an app. + * @summary Gets the send key name and value for a Hybrid Connection. * - * Deletes a hostname binding for an app. + * 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 Name of the app. + * @param {string} name The name of the web 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} namespaceName The namespace for this hybrid connection. * - * @param {string} hostName Hostname in the hostname binding. + * @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. * @@ -35415,13 +38903,14 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, callback) { +function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, relayName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -35431,7 +38920,6 @@ function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -35454,15 +38942,21 @@ function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, opt if (name === 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 (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.'); } @@ -35472,21 +38966,22 @@ function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, opt // 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}'; + 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('{hostName}', encodeURIComponent(hostName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -35511,7 +39006,7 @@ function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, opt return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -35521,12 +39016,13 @@ function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, opt try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -35539,26 +39035,38 @@ function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, opt // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 a specific Service Bus Hybrid Connection used by this Web - * App. + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. * - * Retrieves a specific Service Bus Hybrid Connection 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} 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. @@ -35579,7 +39087,7 @@ function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, opt * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, callback) { +function _listHybridConnectionsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -35589,7 +39097,6 @@ function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayN if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -35612,18 +39119,15 @@ function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayN if (name === 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.'); } @@ -35633,15 +39137,13 @@ function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayN // 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}'; + 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('{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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -35683,12 +39185,13 @@ function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayN try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -35724,48 +39227,19 @@ function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayN } /** - * @summary Creates a new Hybrid Connection using a Service Bus relay. + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). * - * Creates a new Hybrid Connection using a Service Bus relay. + * 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 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} name Name of the app. * - * @param {string} slot The name of the slot for the web 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. * @@ -35779,13 +39253,14 @@ function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayN * {Error} 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. + * 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 _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, callback) { +function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -35795,7 +39270,6 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -35818,21 +39292,15 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN if (name === 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.'); } @@ -35842,22 +39310,20 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN // 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}'; + 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('{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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -35875,21 +39341,7 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -35906,12 +39358,13 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -35931,7 +39384,7 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HybridConnection']().mapper(); + let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -35947,20 +39400,19 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN } /** - * @summary Removes a Hybrid Connection from this site. + * @summary Gets a hybrid connection configuration by its name. * - * Removes a Hybrid Connection from this site. + * Gets a hybrid connection configuration by its name. * * @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} name Name of the app. * - * @param {string} relayName The relay name for this hybrid connection. + * @param {string} entityName Name of the hybrid connection. * - * @param {string} slot The name of the slot for the web app. + * @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. * @@ -35973,13 +39425,15 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, callback) { +function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -35989,7 +39443,6 @@ function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, rel if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -36012,11 +39465,8 @@ function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, rel if (name === 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 (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.'); @@ -36024,6 +39474,9 @@ function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, rel if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -36033,22 +39486,21 @@ function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, rel // 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}'; + 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('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -36073,7 +39525,7 @@ function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, rel return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -36083,12 +39535,13 @@ function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, rel try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -36101,54 +39554,64 @@ function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, rel // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 using a Service Bus relay. + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). * - * Creates a new Hybrid Connection using a Service Bus relay. + * 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 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} name Name of the app. * - * @param {object} connectionEnvelope The details of the hybrid connection. + * @param {string} entityName Name of the hybrid connection configuration. * - * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the - * Service Bus namespace. + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. * - * @param {string} [connectionEnvelope.relayName] The name of the Service Bus - * relay. + * @param {string} [connectionEnvelope.entityName] * - * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service - * Bus relay. + * @param {string} [connectionEnvelope.entityConnectionString] * - * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. + * @param {string} [connectionEnvelope.resourceType] * - * @param {number} [connectionEnvelope.port] The port of the endpoint. + * @param {string} [connectionEnvelope.resourceConnectionString] * - * @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.hostname] * - * @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 {number} [connectionEnvelope.port] * - * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the - * service bus endpoint. By default this is .servicebus.windows.net + * @param {string} [connectionEnvelope.biztalkUri] * * @param {string} [connectionEnvelope.kind] Kind of resource. * - * @param {string} slot The name of the slot for the web app. + * @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. * @@ -36162,13 +39625,14 @@ function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, rel * {Error} 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. + * 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 _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, callback) { +function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -36178,7 +39642,6 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -36201,11 +39664,8 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel if (name === 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 (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.'); @@ -36216,6 +39676,9 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -36225,22 +39688,21 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel // 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}'; + 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('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + 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(apiVersion)); + queryParameters.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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -36263,7 +39725,7 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel let requestModel = null; try { if (connectionEnvelope !== null && connectionEnvelope !== undefined) { - let requestModelMapper = new client.models['HybridConnection']().mapper(); + let requestModelMapper = new client.models['RelayServiceConnectionEntity']().mapper(); requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); requestContent = JSON.stringify(requestModel); } @@ -36289,12 +39751,13 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -36314,7 +39777,7 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HybridConnection']().mapper(); + let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -36330,20 +39793,19 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel } /** - * @summary Gets the send key name and value for a Hybrid Connection. + * @summary Deletes a relay service connection by its name. * - * Gets the send key name and value for a Hybrid Connection. + * Deletes a relay service connection by its name. * * @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} name Name of the app. * - * @param {string} relayName The relay name for this hybrid connection. + * @param {string} entityName Name of the hybrid connection configuration. * - * @param {string} slot The name of the slot for the web app. + * @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. * @@ -36356,14 +39818,13 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel * * {Error} 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [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) { +function _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -36373,7 +39834,6 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -36396,11 +39856,8 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r if (name === 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 (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.'); @@ -36408,6 +39865,9 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -36417,22 +39877,21 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r // 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'; + 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('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + 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(apiVersion)); + queryParameters.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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -36457,7 +39916,7 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -36485,39 +39944,47 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). * - * Retrieves all Service Bus Hybrid Connections used by this Web App. + * 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 The name of the web app. + * @param {string} name Name of the app. * - * @param {string} slot The name of the slot for the web 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. * @@ -36531,13 +39998,14 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r * {Error} 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. + * 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 _listHybridConnectionsSlot(resourceGroupName, name, slot, options, callback) { +function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -36547,7 +40015,6 @@ function _listHybridConnectionsSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -36570,12 +40037,21 @@ function _listHybridConnectionsSlot(resourceGroupName, name, slot, options, call if (name === 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.'); } @@ -36585,20 +40061,21 @@ function _listHybridConnectionsSlot(resourceGroupName, name, slot, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays'; + 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(apiVersion)); + queryParameters.push('api-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 = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -36616,7 +40093,21 @@ function _listHybridConnectionsSlot(resourceGroupName, name, slot, options, call } } } - httpRequest.body = null; + // 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) { @@ -36633,12 +40124,13 @@ function _listHybridConnectionsSlot(resourceGroupName, name, slot, options, call try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -36658,7 +40150,7 @@ function _listHybridConnectionsSlot(resourceGroupName, name, slot, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HybridConnection']().mapper(); + let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -36674,11 +40166,9 @@ function _listHybridConnectionsSlot(resourceGroupName, name, slot, options, call } /** - * @summary Gets hybrid connections configured for an app (or deployment slot, - * if specified). + * @summary Gets all scale-out instances of an app. * - * Gets hybrid connections configured for an app (or deployment slot, if - * specified). + * Gets all scale-out instances of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -36686,7 +40176,7 @@ function _listHybridConnectionsSlot(resourceGroupName, name, slot, options, call * @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. + * specified, the API gets the production slot instances. * * @param {object} [options] Optional Parameters. * @@ -36700,14 +40190,14 @@ function _listHybridConnectionsSlot(resourceGroupName, name, slot, options, call * {Error} 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 + * 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 _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options, callback) { +function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -36717,7 +40207,6 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -36746,6 +40235,9 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -36755,13 +40247,13 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -36803,12 +40295,13 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -36828,7 +40321,7 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); + let resultMapper = new client.models['WebAppInstanceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -36844,19 +40337,19 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options } /** - * @summary Gets a hybrid connection configuration by its name. + * @summary Get the status of the last MSDeploy operation. * - * Gets a hybrid connection configuration by its name. + * 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 the app. + * @param {string} name Name of web app. * - * @param {string} entityName Name of the hybrid connection. + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. * - * @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 {string} instanceId ID of web app instance. * * @param {object} [options] Optional Parameters. * @@ -36870,14 +40363,13 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, 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 RelayServiceConnectionEntity} for more - * information. + * 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 _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, callback) { +function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -36887,7 +40379,6 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slo if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -36910,15 +40401,18 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slo if (name === 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 (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.'); } @@ -36928,14 +40422,14 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slo // 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}'; + 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('{entityName}', encodeURIComponent(entityName)); 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -36977,12 +40471,13 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slo try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -37002,7 +40497,7 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slo parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); + let resultMapper = new client.models['MSDeployStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -37017,42 +40512,49 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slo }); } + /** - * @summary Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). + * @summary Invoke the MSDeploy web app extension. * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). + * Invoke the MSDeploy web app extension. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name Name of web app. * - * @param {string} entityName Name of the hybrid connection configuration. + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. * - * @param {object} connectionEnvelope Details of the hybrid connection - * configuration. + * @param {string} instanceId ID of web app instance. * - * @param {string} [connectionEnvelope.entityName] + * @param {object} mSDeploy Details of MSDeploy operation * - * @param {string} [connectionEnvelope.entityConnectionString] + * @param {string} [mSDeploy.packageUri] Package URI * - * @param {string} [connectionEnvelope.resourceType] + * @param {string} [mSDeploy.connectionString] SQL Connection String * - * @param {string} [connectionEnvelope.resourceConnectionString] + * @param {string} [mSDeploy.dbType] Database Type * - * @param {string} [connectionEnvelope.hostname] + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. * - * @param {number} [connectionEnvelope.port] + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. * - * @param {string} [connectionEnvelope.biztalkUri] + * @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 {string} [connectionEnvelope.kind] Kind of resource. + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. * - * @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 {string} [mSDeploy.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -37066,14 +40568,98 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slo * {Error} 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. + * 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 _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, callback) { +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') { @@ -37083,7 +40669,6 @@ function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, enti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -37106,18 +40691,18 @@ function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, enti if (name === 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 (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.'); } @@ -37127,21 +40712,21 @@ function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, enti // 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}'; + 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('{entityName}', encodeURIComponent(entityName)); 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -37159,28 +40744,14 @@ function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, enti } } } - // 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; + httpRequest.body = null; // 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 !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -37215,7 +40786,7 @@ function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, enti parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); + let resultMapper = new client.models['MSDeployLog']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -37231,19 +40802,23 @@ function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, enti } /** - * @summary Deletes a relay service connection by its name. + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. * - * Deletes a relay service connection by its name. + * 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 Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. + * @param {string} name Site name. * * @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. + * 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. * @@ -37256,13 +40831,14 @@ function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, enti * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, callback) { +function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -37272,7 +40848,6 @@ function _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -37295,15 +40870,18 @@ function _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, if (name === 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 (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.'); } @@ -37313,21 +40891,21 @@ function _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, // 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}'; + 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('{entityName}', encodeURIComponent(entityName)); 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -37380,47 +40958,48 @@ function _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). + * 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 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} name Site name. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} processId PID. * * @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. + * 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. * @@ -37434,14 +41013,13 @@ function _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, * {Error} 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. + * 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 _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, callback) { +function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -37451,7 +41029,6 @@ function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -37474,18 +41051,21 @@ function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, if (name === 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 (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.'); } @@ -37495,21 +41075,22 @@ function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, // 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}'; + 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('{entityName}', encodeURIComponent(entityName)); + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -37527,28 +41108,14 @@ function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, } } } - // 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; + httpRequest.body = null; // 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 !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -37583,7 +41150,7 @@ function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); + let resultMapper = new client.models['ProcessInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -37599,17 +41166,25 @@ function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, } /** - * @summary Gets all scale-out instances of an app. + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. * - * Gets all scale-out instances of an app. + * 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 Name of the app. + * @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 gets the production slot instances. + * 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. * @@ -37622,15 +41197,13 @@ function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, * * {Error} 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [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) { +function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -37640,7 +41213,6 @@ function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -37663,12 +41235,21 @@ function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, ca if (name === 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.'); } @@ -37678,20 +41259,22 @@ function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances'; + 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(apiVersion)); + queryParameters.push('api-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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -37716,7 +41299,7 @@ function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, ca return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 204 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -37744,42 +41327,31 @@ function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, ca // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. * - * Get the status of the last MSDeploy operation. + * 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 Name of web app. + * @param {string} name Site name. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @param {string} processId PID. * - * @param {string} instanceId ID of web app instance. + * @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. * @@ -37793,13 +41365,12 @@ function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, 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 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) { +function _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -37809,7 +41380,6 @@ function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceI if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -37832,6 +41402,9 @@ function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceI if (name === 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.'); } @@ -37841,6 +41414,9 @@ function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceI if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -37850,14 +41426,15 @@ function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceI // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -37884,20 +41461,22 @@ function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceI } 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) { - let error = new Error(responseBody); + 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 { - parsedErrorResponse = JSON.parse(responseBody); + if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; @@ -37914,159 +41493,33 @@ function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceI } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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); - } - } + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } - /** - * @summary Invoke the MSDeploy web app extension. + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. * - * Invoke the MSDeploy web app extension. + * 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 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 Site name. * - * @param {string} name Name of web app. + * @param {string} processId PID. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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 web app instance. + * @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. * @@ -38080,13 +41533,14 @@ function _createInstanceMSDeployOperationSlot(resourceGroupName, name, slot, ins * {Error} 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. + * 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 _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, options, callback) { +function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -38096,7 +41550,6 @@ function _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -38119,6 +41572,9 @@ function _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, if (name === 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.'); } @@ -38128,6 +41584,9 @@ function _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -38137,14 +41596,15 @@ function _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -38211,7 +41671,7 @@ function _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MSDeployLog']().mapper(); + let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -38227,17 +41687,21 @@ function _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, } /** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. + * @summary Get process information by its ID 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. + * 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. * @@ -38257,13 +41721,13 @@ function _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, * {Error} 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. + * 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 _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, options, callback) { +function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -38273,7 +41737,6 @@ function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -38296,6 +41759,12 @@ function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, o if (name === 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.'); } @@ -38305,6 +41774,9 @@ function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, o if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -38314,14 +41786,16 @@ function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, o // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -38388,7 +41862,7 @@ function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, o parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfoCollection']().mapper(); + let resultMapper = new client.models['ProcessModuleInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -38404,11 +41878,11 @@ function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, o } /** - * @summary Get process information by its ID for a specific scaled-out + * @summary List the threads in a process 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. + * 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. @@ -38436,13 +41910,14 @@ function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, 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 ProcessInfo} for more information. + * 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 _getInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { +function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -38452,7 +41927,6 @@ function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, insta if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -38487,6 +41961,9 @@ function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, insta if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -38496,7 +41973,7 @@ function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, insta // 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}'; + 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)); @@ -38504,7 +41981,7 @@ function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, insta requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); 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('&'); } @@ -38571,7 +42048,7 @@ function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, insta parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfo']().mapper(); + let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -38587,12 +42064,12 @@ function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, insta } /** - * @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 + * @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. * @@ -38600,6 +42077,8 @@ function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, insta * * @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. * @@ -38618,13 +42097,14 @@ function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, insta * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { +function _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -38634,7 +42114,6 @@ function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, in if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -38660,6 +42139,9 @@ function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, in 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.'); } @@ -38669,6 +42151,9 @@ function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, in if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -38678,22 +42163,23 @@ function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, in // 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}'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -38718,7 +42204,7 @@ function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, in return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -38746,31 +42232,212 @@ function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, in // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 a memory dump of a process by its ID for a specific scaled-out - * instance in a web site. + * @summary Shows whether an app can be cloned to another resource group or + * subscription. * - * Get a memory dump of a process by its ID for a specific scaled-out instance - * in a web site. + * 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 Site name. + * @param {string} name Name of the app. * - * @param {string} processId PID. + * @param {string} slot Name of the deployment slot. By default, this API + * returns information on the production slot. * - * @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 {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.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} 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. * @@ -38784,12 +42451,13 @@ function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, in * {Error} 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 _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { +function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -38799,7 +42467,6 @@ function _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, i if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -38822,18 +42489,15 @@ function _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, i if (name === 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.'); } @@ -38843,22 +42507,20 @@ function _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, i // 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'; + 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('{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(apiVersion)); + queryParameters.push('api-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 @@ -38878,29 +42540,28 @@ function _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, i } 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}`); + if (statusCode !== 200) { + let error = new Error(responseBody); 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); + parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -38910,33 +42571,44 @@ function _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, i } return callback(error); } - // Create Result - let result = response; + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 List module information for a process by its ID for a specific - * scaled-out instance in a web site. + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. + * 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 Site name. - * - * @param {string} processId PID. + * @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 {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". + * specified, the API will get metric definitions of the production slot. * * @param {object} [options] Optional Parameters. * @@ -38950,14 +42622,14 @@ function _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, i * {Error} 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 + * 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 _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { +function _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -38967,7 +42639,6 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slo if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -38990,18 +42661,15 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slo if (name === 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.'); } @@ -39011,15 +42679,13 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slo // 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'; + 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('{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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -39051,7 +42717,7 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slo return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -39061,12 +42727,13 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slo try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -39086,7 +42753,7 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slo parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); + let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -39102,30 +42769,29 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slo } /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). * - * Get process information by its ID for a specific scaled-out instance in a - * web site. + * 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 Site name. - * - * @param {string} processId PID. - * - * @param {string} baseAddress Module base address. + * @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 {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". + * 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 * @@ -39136,13 +42802,14 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slo * {Error} 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. + * 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 _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, callback) { +function _listMetricsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -39152,7 +42819,8 @@ function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseA if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; + 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') { @@ -39175,21 +42843,21 @@ function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseA if (name === 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 (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.'); } @@ -39199,16 +42867,19 @@ function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseA // 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}'; + 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('{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(apiVersion)); + 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('&'); } @@ -39240,7 +42911,7 @@ function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseA return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -39250,12 +42921,13 @@ function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseA try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -39275,7 +42947,7 @@ function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseA parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfo']().mapper(); + let resultMapper = new client.models['ResourceMetricCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -39291,25 +42963,18 @@ function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseA } /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. + * 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 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} name Name of web app. * - * @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 {string} slot Name of the deployment slot. * * @param {object} [options] Optional Parameters. * @@ -39323,14 +42988,13 @@ function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseA * {Error} 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. + * 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 _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { +function _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -39340,7 +43004,6 @@ function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slo if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -39363,18 +43026,15 @@ function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slo if (name === 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.'); } @@ -39384,15 +43044,13 @@ function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slo // 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'; + 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('{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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -39424,7 +43082,7 @@ function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slo return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -39434,12 +43092,13 @@ function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slo try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -39459,7 +43118,7 @@ function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slo parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); + let resultMapper = new client.models['MigrateMySqlStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -39475,27 +43134,22 @@ function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slo } /** - * @summary Get thread information by Thread ID for a specific process, in a - * specific scaled-out instance in a web site. + * @summary Gets all network features used by the app (or deployment slot, if + * specified). * - * Get thread information by Thread ID for a specific process, in a specific - * scaled-out instance in a web site. + * 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 Site name. - * - * @param {string} processId PID. + * @param {string} name Name of the app. * - * @param {string} threadId TID. + * @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 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". + * specified, the API will get network features for the production slot. * * @param {object} [options] Optional Parameters. * @@ -39509,13 +43163,13 @@ function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slo * {Error} 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. + * 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 _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, callback) { +function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -39525,7 +43179,6 @@ function _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -39548,21 +43201,18 @@ function _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threa if (name === 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 (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 (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.'); } @@ -39572,16 +43222,14 @@ function _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threa // 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}'; + 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('{processId}', encodeURIComponent(processId)); - requestUrl = requestUrl.replace('{threadId}', encodeURIComponent(threadId)); + requestUrl = requestUrl.replace('{view}', encodeURIComponent(view)); 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -39648,7 +43296,7 @@ function _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threa parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfo']().mapper(); + let resultMapper = new client.models['NetworkFeatures']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -39664,22 +43312,27 @@ function _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threa } /** - * @summary Shows whether an app can be cloned to another resource group or - * subscription. + * @summary Start capturing network packets for the site. * - * Shows whether an app can be cloned to another resource group or - * subscription. + * Start capturing network packets for the site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name The name of the web app. * - * @param {string} slot Name of the deployment slot. By default, this API - * returns information on the production slot. + * @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 * @@ -39689,14 +43342,13 @@ function _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threa * * {Error} 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. + * {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 _isCloneableSlot(resourceGroupName, name, slot, options, callback) { +function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -39706,7 +43358,9 @@ function _isCloneableSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; + 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') { @@ -39729,12 +43383,24 @@ function _isCloneableSlot(resourceGroupName, name, slot, options, callback) { if (name === 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.'); } @@ -39744,13 +43410,22 @@ function _isCloneableSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/iscloneable'; + 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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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('&'); } @@ -39792,12 +43467,13 @@ function _isCloneableSlot(resourceGroupName, name, slot, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -39817,7 +43493,13 @@ function _isCloneableSlot(resourceGroupName, name, slot, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteCloneability']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -39833,17 +43515,16 @@ function _isCloneableSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary This is to allow calling via powershell and ARM template. + * @summary Stop ongoing capturing network packets for the site. * - * This is to allow calling via powershell and ARM template. + * Stop ongoing capturing network packets for the site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name The name of the web 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 {string} slot The name of the slot for this web app. * * @param {object} [options] Optional Parameters. * @@ -39856,14 +43537,13 @@ function _isCloneableSlot(resourceGroupName, name, slot, 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 FunctionSecrets} for more information. + * {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 _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, callback) { +function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -39873,7 +43553,6 @@ function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -39902,6 +43581,9 @@ function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, c if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -39911,13 +43593,13 @@ function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, c // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listsyncfunctiontriggerstatus'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -39959,12 +43641,13 @@ function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, c try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -39984,7 +43667,13 @@ function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, c parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionSecrets']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -40000,10 +43689,11 @@ function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, c } /** - * @summary Gets all metric definitions of an app (or deployment slot, if - * specified). + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). * - * Gets all metric definitions of 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. @@ -40011,7 +43701,8 @@ function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, c * @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. + * specified, the API generate a new publishing password for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -40024,15 +43715,13 @@ function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, 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 ResourceMetricDefinitionCollection} 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 _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, callback) { +function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -40042,7 +43731,6 @@ function _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -40071,6 +43759,9 @@ function _listMetricDefinitionsSlot(resourceGroupName, name, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -40080,20 +43771,20 @@ function _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/metricdefinitions'; + 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(apiVersion)); + queryParameters.push('api-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 @@ -40118,7 +43809,7 @@ function _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, call 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); @@ -40146,6 +43837,172 @@ function _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, call // 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; @@ -40153,7 +44010,7 @@ function _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); + let resultMapper = new client.models['PerfMonCounterCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -40169,29 +44026,20 @@ function _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, call } /** - * @summary Gets performance metrics of an app (or deployment slot, if - * specified). + * @summary Gets web app's event logs. * - * Gets performance metrics of an app (or deployment slot, if specified). + * Gets web app's event logs. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name Name of web 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 {string} slot Name of web app slot. If not specified then will + * default to 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 * @@ -40202,14 +44050,13 @@ function _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, call * {Error} 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. + * 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 _listMetricsSlot(resourceGroupName, name, slot, options, callback) { +function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -40219,9 +44066,6 @@ function _listMetricsSlot(resourceGroupName, name, slot, options, callback) { 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; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -40247,15 +44091,12 @@ function _listMetricsSlot(resourceGroupName, name, slot, options, callback) { if (slot === 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.'); } @@ -40265,19 +44106,13 @@ function _listMetricsSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/metrics'; + 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 = []; - 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -40319,12 +44154,13 @@ function _listMetricsSlot(resourceGroupName, name, slot, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -40344,7 +44180,7 @@ function _listMetricsSlot(resourceGroupName, name, slot, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricCollection']().mapper(); + let resultMapper = new client.models['SitePhpErrorLogFlag']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -40360,18 +44196,17 @@ function _listMetricsSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary Returns the status of MySql in app migration, if one is active, and - * whether or not MySql in app is enabled + * @summary Gets the premier add-ons of an app. * - * Returns the status of MySql in app migration, if one is active, and whether - * or not MySql in app is enabled + * 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 web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of the deployment slot. + * @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. * @@ -40385,13 +44220,13 @@ function _listMetricsSlot(resourceGroupName, name, slot, 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 MigrateMySqlStatus} for more information. + * 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 _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, callback) { +function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -40401,7 +44236,6 @@ function _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -40430,6 +44264,9 @@ function _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -40439,13 +44276,13 @@ function _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, call // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -40487,12 +44324,13 @@ function _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, call try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -40512,7 +44350,7 @@ function _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MigrateMySqlStatus']().mapper(); + let resultMapper = new client.models['PremierAddOn']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -40528,22 +44366,19 @@ function _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, call } /** - * @summary Gets all network features used by the app (or deployment slot, if - * specified). + * @summary Gets a named add-on of an app. * - * Gets all network features used by the app (or deployment slot, if - * specified). + * 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} view The type of view. This can either be "summary" or - * "detailed". + * @param {string} premierAddOnName Add-on name. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get network features for the production slot. + * specified, the API will get the named add-on for the production slot. * * @param {object} [options] Optional Parameters. * @@ -40557,13 +44392,13 @@ function _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, call * {Error} 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. + * 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 _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, callback) { +function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -40573,7 +44408,6 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -40596,8 +44430,8 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, if (name === 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 (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.'); @@ -40605,6 +44439,9 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -40614,14 +44451,14 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, // 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}'; + 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('{view}', encodeURIComponent(view)); + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -40653,7 +44490,7 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -40663,12 +44500,13 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -40688,7 +44526,7 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['NetworkFeatures']().mapper(); + let resultMapper = new client.models['PremierAddOn']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -40704,26 +44542,42 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, } /** - * @summary Start capturing network packets for the site. + * @summary Updates a named add-on of an app. * - * Start capturing network packets for the site. + * Updates a named add-on of an 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} name Name of the app. * - * @param {string} slot The name of the slot for this web app. + * @param {string} premierAddOnName Add-on name. * - * @param {object} [options] Optional Parameters. + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. * - * @param {number} [options.durationInSeconds] The duration to keep capturing - * in seconds. + * @param {string} [premierAddOn.sku] Premier add on SKU. * - * @param {number} [options.maxFrameLength] The maximum frame length in bytes - * (Optional). + * @param {string} [premierAddOn.product] Premier add on Product. * - * @param {string} [options.sasUrl] The Blob URL to store capture file. + * @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 @@ -40734,13 +44588,14 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [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 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 _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, callback) { +function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -40750,10 +44605,6 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, c 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; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -40776,21 +44627,21 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, c if (name === 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 (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 (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.'); } @@ -40800,29 +44651,21 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, c // 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'; + 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 = []; - 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(apiVersion)); + queryParameters.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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -40840,7 +44683,21 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, c } } } - httpRequest.body = null; + // 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) { @@ -40857,12 +44714,13 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, c try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -40882,13 +44740,7 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, c parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; + let resultMapper = new client.models['PremierAddOn']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -40904,16 +44756,19 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, c } /** - * @summary Stop ongoing capturing network packets for the site. + * @summary Delete a premier add-on from an app. * - * Stop ongoing capturing network packets for the site. + * Delete a premier add-on from an 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} name Name of the app. * - * @param {string} slot The name of the slot for this web 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. * @@ -40926,13 +44781,13 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, c * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [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. */ -function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, callback) { +function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -40942,7 +44797,6 @@ function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -40965,12 +44819,18 @@ function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, ca if (name === 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.'); } @@ -40980,20 +44840,21 @@ function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, ca // 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'; + 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(apiVersion)); + queryParameters.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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -41046,49 +44907,42 @@ function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, ca // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Generates a new publishing password for an app (or deployment slot, - * if specified). + * @summary Updates a named add-on of an app. * - * Generates a new publishing password for an app (or deployment slot, if - * specified). + * 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 generate a new publishing password for the production - * slot. + * specified, the API will update the named add-on for the production slot. * * @param {object} [options] Optional Parameters. * @@ -41101,13 +44955,14 @@ function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, ca * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, callback) { +function _updatePremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -41117,7 +44972,6 @@ function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -41140,12 +44994,21 @@ function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, o if (name === 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.'); } @@ -41155,20 +45018,21 @@ function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, o // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/newpassword'; + 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(apiVersion)); + queryParameters.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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -41186,14 +45050,28 @@ function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, o } } } - httpRequest.body = null; + // 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 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -41203,12 +45081,13 @@ function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, o try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -41221,31 +45100,44 @@ function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, 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['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 perfmon counters for web app. + * @summary Gets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Gets perfmon counters for web app. + * 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 Name of web app. + * @param {string} name The name of the web app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @param {string} slot The name of the slot for the 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 * @@ -41256,14 +45148,13 @@ function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, 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 PerfMonCounterCollection} for more - * information. + * 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 _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callback) { +function _getPrivateAccessSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -41273,8 +45164,6 @@ function _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -41300,12 +45189,12 @@ function _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callba if (slot === 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.'); } @@ -41315,16 +45204,13 @@ function _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callba // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/perfcounters'; + 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 = []; - 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('&'); } @@ -41366,12 +45252,13 @@ function _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callba try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -41391,7 +45278,7 @@ function _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callba parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PerfMonCounterCollection']().mapper(); + let resultMapper = new client.models['PrivateAccess']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -41407,17 +45294,27 @@ function _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callba } /** - * @summary Gets web app's event logs. + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Gets web app's event logs. + * 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 Name of web app. + * @param {string} name The name of the web app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -41431,13 +45328,13 @@ function _listPerfMonCountersSlot(resourceGroupName, name, slot, 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 SitePhpErrorLogFlag} for more information. + * 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 _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, callback) { +function _putPrivateAccessVnetSlot(resourceGroupName, name, access, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -41447,7 +45344,6 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -41470,12 +45366,18 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal if (name === 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.'); } @@ -41485,20 +45387,20 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/phplogging'; + 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(apiVersion)); + queryParameters.push('api-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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -41516,7 +45418,21 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal } } } - httpRequest.body = null; + // 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) { @@ -41533,12 +45449,13 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -41558,7 +45475,7 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SitePhpErrorLogFlag']().mapper(); + let resultMapper = new client.models['PrivateAccess']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -41574,17 +45491,19 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal } /** - * @summary Gets the premier add-ons of an app. + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. * - * Gets the premier add-ons of an app. + * 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 Name of the app. + * @param {string} name Site name. * * @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. + * specified, the API returns deployments for the production slot. * * @param {object} [options] Optional Parameters. * @@ -41598,13 +45517,13 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, 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 PremierAddOn} for more information. + * 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 _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback) { +function _listProcessesSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -41614,7 +45533,6 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -41643,6 +45561,9 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -41652,13 +45573,13 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -41690,7 +45611,7 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -41725,7 +45646,7 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PremierAddOn']().mapper(); + let resultMapper = new client.models['ProcessInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -41741,19 +45662,21 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback } /** - * @summary Gets a named add-on of an app. + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. * - * Gets a named add-on of an app. + * 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 Name of the app. + * @param {string} name Site name. * - * @param {string} premierAddOnName Add-on name. + * @param {string} processId PID. * * @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. + * specified, the API returns deployments for the production slot. * * @param {object} [options] Optional Parameters. * @@ -41767,13 +45690,13 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, 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 PremierAddOn} for more information. + * 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 _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, callback) { +function _getProcessSlot(resourceGroupName, name, processId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -41783,7 +45706,6 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -41806,8 +45728,8 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, o if (name === 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 (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.'); @@ -41815,6 +45737,9 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, o if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -41824,14 +45749,14 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, o // 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}'; + 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('{premierAddOnName}', encodeURIComponent(premierAddOnName)); + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -41863,7 +45788,7 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, o return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -41898,7 +45823,7 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, o parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PremierAddOn']().mapper(); + let resultMapper = new client.models['ProcessInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -41914,46 +45839,21 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, o } /** - * @summary Updates a named add-on of an app. + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. * - * Updates a named add-on of an app. + * 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 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.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * - * @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 {string} name Site name. * - * @param {object} [premierAddOn.tags] Resource tags. + * @param {string} processId PID. * * @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. + * specified, the API returns deployments for the production slot. * * @param {object} [options] Optional Parameters. * @@ -41966,14 +45866,13 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, 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 PremierAddOn} 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 _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options, callback) { +function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -41983,7 +45882,6 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -42006,11 +45904,8 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier if (name === 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 (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.'); @@ -42018,6 +45913,9 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -42027,21 +45925,21 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier // 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}'; + 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('{premierAddOnName}', encodeURIComponent(premierAddOnName)); + 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(apiVersion)); + queryParameters.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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -42059,28 +45957,14 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 204 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -42108,42 +45992,27 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. * - * Delete a premier add-on from an app. + * 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 Name of the app. + * @param {string} name Site name. * - * @param {string} premierAddOnName Add-on name. + * @param {string} processId PID. * * @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. + * specified, the API returns deployments for the production slot. * * @param {object} [options] Optional Parameters. * @@ -42156,13 +46025,13 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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 _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, callback) { +function _getProcessDumpSlot(resourceGroupName, name, processId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -42172,7 +46041,6 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -42195,8 +46063,8 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot if (name === 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 (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.'); @@ -42204,6 +46072,9 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -42213,21 +46084,21 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot // 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}'; + 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('{premierAddOnName}', encodeURIComponent(premierAddOnName)); + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -42247,20 +46118,22 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot } 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) { - let error = new Error(responseBody); + 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 { - parsedErrorResponse = JSON.parse(responseBody); + if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; @@ -42277,26 +46150,27 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; + // Create Result + let result = response; 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. + * @summary List module information for a process by its ID 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. + * 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. * @@ -42312,13 +46186,14 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot * {Error} 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. + * 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 _listProcessesSlot(resourceGroupName, name, slot, options, callback) { +function _listProcessModulesSlot(resourceGroupName, name, processId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -42328,7 +46203,6 @@ function _listProcessesSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -42351,12 +46225,18 @@ function _listProcessesSlot(resourceGroupName, name, slot, options, callback) { if (name === 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.'); } @@ -42366,13 +46246,14 @@ function _listProcessesSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -42439,7 +46320,7 @@ function _listProcessesSlot(resourceGroupName, name, slot, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfoCollection']().mapper(); + let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -42468,6 +46349,8 @@ function _listProcessesSlot(resourceGroupName, name, slot, options, callback) { * * @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. * @@ -42483,13 +46366,13 @@ function _listProcessesSlot(resourceGroupName, name, slot, 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 ProcessInfo} for more information. + * 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 _getProcessSlot(resourceGroupName, name, processId, slot, options, callback) { +function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -42499,7 +46382,6 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -42525,12 +46407,18 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, options, call 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.'); } @@ -42540,14 +46428,15 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, options, call // 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}'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -42614,7 +46503,7 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfo']().mapper(); + let resultMapper = new client.models['ProcessModuleInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -42630,11 +46519,11 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, options, call } /** - * @summary Terminate a process by its ID for a web site, or a deployment slot, - * or specific scaled-out instance in a web site. + * @summary List the threads in a process by its ID for a 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. + * 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. @@ -42657,13 +46546,15 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, options, call * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteProcessSlot(resourceGroupName, name, processId, slot, options, callback) { +function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -42673,7 +46564,6 @@ function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -42705,6 +46595,9 @@ function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, c if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -42714,21 +46607,21 @@ function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, c // 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}'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -42753,7 +46646,7 @@ function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, c return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -42781,17 +46674,34 @@ function _deleteProcessSlot(resourceGroupName, name, processId, slot, 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['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 a memory dump of a process by its ID for a specific scaled-out - * instance in a web site. + * @summary Get thread information by Thread ID for a specific process, in 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. + * 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. @@ -42800,6 +46710,8 @@ function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, c * * @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. * @@ -42815,12 +46727,13 @@ function _deleteProcessSlot(resourceGroupName, name, processId, slot, 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 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 _getProcessDumpSlot(resourceGroupName, name, processId, slot, options, callback) { +function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -42830,7 +46743,6 @@ function _getProcessDumpSlot(resourceGroupName, name, processId, slot, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -42856,12 +46768,18 @@ function _getProcessDumpSlot(resourceGroupName, name, processId, slot, options, 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.'); } @@ -42871,14 +46789,15 @@ function _getProcessDumpSlot(resourceGroupName, name, processId, slot, options, // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -42905,22 +46824,20 @@ function _getProcessDumpSlot(resourceGroupName, name, processId, slot, options, } 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}`); + let error = new Error(responseBody); 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); + parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; @@ -42937,29 +46854,43 @@ function _getProcessDumpSlot(resourceGroupName, name, processId, slot, options, } return callback(error); } - // Create Result - let result = response; + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 List module information for a process by its ID for a specific - * scaled-out instance in a web site. + * @summary Get public certificates for an app or a deployment slot. * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. + * 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 Site name. - * - * @param {string} processId PID. + * @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. + * specified, the API gets hostname bindings for the production slot. * * @param {object} [options] Optional Parameters. * @@ -42973,14 +46904,14 @@ function _getProcessDumpSlot(resourceGroupName, name, processId, slot, 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 ProcessModuleInfoCollection} for more + * 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 _listProcessModulesSlot(resourceGroupName, name, processId, slot, options, callback) { +function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -42990,7 +46921,6 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -43013,15 +46943,15 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio if (name === 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.'); } @@ -43031,14 +46961,13 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio // 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'; + 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('{processId}', encodeURIComponent(processId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -43070,7 +46999,7 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -43080,12 +47009,13 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -43105,7 +47035,7 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); + let resultMapper = new client.models['PublicCertificateCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -43121,23 +47051,21 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio } /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. + * @summary Get the named public certificate for an app (or deployment slot, if + * specified). * - * Get process information by its ID for a specific scaled-out instance in a - * web site. + * 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 Site name. - * - * @param {string} processId PID. - * - * @param {string} baseAddress Module base address. + * @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. + * specified, the API the named binding for the production slot. + * + * @param {string} publicCertificateName Public certificate name. * * @param {object} [options] Optional Parameters. * @@ -43151,13 +47079,13 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, 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 ProcessModuleInfo} for more information. + * 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 _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, options, callback) { +function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -43167,7 +47095,6 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -43190,18 +47117,18 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, if (name === 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 (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.'); } @@ -43211,15 +47138,14 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, // 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}'; + 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('{processId}', encodeURIComponent(processId)); - requestUrl = requestUrl.replace('{baseAddress}', encodeURIComponent(baseAddress)); 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -43251,7 +47177,7 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -43261,12 +47187,13 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -43286,7 +47213,7 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfo']().mapper(); + let resultMapper = new client.models['PublicCertificate']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -43302,21 +47229,30 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, } /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. + * @summary Creates a hostname binding for an app. * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. + * Creates a hostname binding for an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @param {string} name Name of the app. * - * @param {string} processId PID. + * @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 returns deployments for the production slot. + * specified, the API will create a binding for the production slot. * * @param {object} [options] Optional Parameters. * @@ -43330,14 +47266,13 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, * {Error} 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. + * 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 _listProcessThreadsSlot(resourceGroupName, name, processId, slot, options, callback) { +function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCertificateName, publicCertificate, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -43347,7 +47282,6 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -43370,8 +47304,11 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio if (name === 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 (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.'); @@ -43379,6 +47316,9 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -43388,21 +47328,21 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio // 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'; + 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('{processId}', encodeURIComponent(processId)); + 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(apiVersion)); + queryParameters.push('api-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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -43420,14 +47360,28 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio } } } - httpRequest.body = null; + // 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 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -43437,12 +47391,13 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -43462,7 +47417,7 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); + let resultMapper = new client.models['PublicCertificate']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -43478,23 +47433,19 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio } /** - * @summary Get thread information by Thread ID for a specific process, in a - * specific scaled-out instance in a web site. + * @summary Deletes a hostname binding for an app. * - * Get thread information by Thread ID for a specific process, in a specific - * scaled-out instance in a web site. + * Deletes a hostname binding for an app. * * @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} 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. + * specified, the API will delete the binding for the production slot. + * + * @param {string} publicCertificateName Public certificate name. * * @param {object} [options] Optional Parameters. * @@ -43507,14 +47458,13 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, 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 ProcessThreadInfo} 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 _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, options, callback) { +function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -43524,7 +47474,6 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -43547,18 +47496,18 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo if (name === 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 (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.'); } @@ -43568,22 +47517,21 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo // 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}'; + 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('{processId}', encodeURIComponent(processId)); - requestUrl = requestUrl.replace('{threadId}', encodeURIComponent(threadId)); 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(apiVersion)); + queryParameters.push('api-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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -43608,7 +47556,7 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -43636,32 +47584,16 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @summary Gets the publishing profile for an app (or deployment slot, if + * specified). * - * Get public certificates for an app or a deployment slot. + * 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. @@ -43669,10 +47601,15 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo * @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. + * specified, the API will get the publishing profile for the production slot. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -43683,14 +47620,12 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo * {Error} 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) { +function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -43700,7 +47635,7 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; + let format = (options && options.format !== undefined) ? options.format : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -43729,29 +47664,40 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (format !== null && format !== undefined && typeof format.valueOf() !== 'string') { + throw new Error('format must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.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 publishingProfileOptions; + if (format !== null && format !== undefined) { + publishingProfileOptions = new client.models['CsmPublishingProfileOptions'](); + publishingProfileOptions.format = format; + } // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates'; + 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(apiVersion)); + queryParameters.push('api-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 @@ -43769,29 +47715,46 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal } } } - httpRequest.body = null; + // 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(responseBody); + 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 { - parsedErrorResponse = JSON.parse(responseBody); + 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; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -43801,37 +47764,19 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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); - } - } + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } /** - * @summary Get the named public certificate for an app (or deployment slot, if - * specified). + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * Get the named public certificate for an app (or deployment slot, if - * specified). + * 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. @@ -43839,9 +47784,7 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal * @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. + * specified, the API resets configuration settings for the production slot. * * @param {object} [options] Optional Parameters. * @@ -43854,14 +47797,13 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, 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 PublicCertificate} 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 _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, options, callback) { +function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -43871,7 +47813,6 @@ function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertific if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -43897,12 +47838,12 @@ function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertific if (slot === 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.'); } @@ -43912,21 +47853,20 @@ function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertific // 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}'; + 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('{publicCertificateName}', encodeURIComponent(publicCertificateName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -43979,56 +47919,34 @@ function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertific // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @summary Restarts an app (or deployment slot, if specified). * - * Creates a hostname binding for an app. + * 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} 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. + * 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 * @@ -44038,14 +47956,13 @@ function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertific * * {Error} 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [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) { +function _restartSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -44055,7 +47972,8 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; + 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') { @@ -44078,18 +47996,21 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer if (name === 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 (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.'); } @@ -44099,21 +48020,26 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer // 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}'; + 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('{publicCertificateName}', encodeURIComponent(publicCertificateName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'PUT'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -44131,21 +48057,7 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -44180,42 +48092,148 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @summary Restores an app from a backup blob in Azure Storage. * - * Deletes a hostname binding for an app. + * 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 delete the binding for the production slot. + * specified, the API will restore a backup of 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 _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. * @@ -44234,7 +48252,179 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, options, callback) { +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') { @@ -44244,7 +48434,6 @@ function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCerti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -44270,12 +48459,12 @@ function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCerti if (slot === 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.'); } @@ -44285,21 +48474,20 @@ function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCerti // 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}'; + 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('{publicCertificateName}', encodeURIComponent(publicCertificateName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -44324,7 +48512,7 @@ function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCerti return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -44352,32 +48540,47 @@ function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCerti // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 the publishing profile for an app (or deployment slot, if - * specified). + * @summary Get site extension information by its ID for a web site, or a + * deployment slot. * - * Gets the publishing profile for an app (or deployment slot, if specified). + * 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 Name of the app. + * @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 will get the publishing profile for the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.format] Name of the format. Valid values are: - * FileZilla3 - * WebDeploy -- default - * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -44388,12 +48591,13 @@ function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCerti * {Error} 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 _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, options, callback) { +function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -44403,8 +48607,6 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, if (!callback) { throw new Error('callback cannot be null.'); } - let format = (options && options.format !== undefined) ? options.format : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -44427,14 +48629,17 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, if (name === 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 (format !== null && format !== undefined && typeof format.valueOf() !== 'string') { - throw new Error('format must be of type string.'); + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -44442,28 +48647,24 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, } catch (error) { return callback(error); } - let publishingProfileOptions; - if (format !== null && format !== undefined) { - publishingProfileOptions = new client.models['CsmPublishingProfileOptions'](); - publishingProfileOptions.format = format; - } // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publishxml'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -44481,38 +48682,22 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, } } } - // 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; + 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) { - let error = new Error(`Unexpected status code: ${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 { - if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); + parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; @@ -44529,58 +48714,46 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, } return callback(error); } - // Create Result - let result = response; + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Recovers a web app to a previous snapshot. + * @summary Install site extension on a web site, or a deployment slot. * - * Recovers a web app to a previous snapshot. + * 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 Name of web app. - * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. - * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} name Site name. * - * @param {string} [recoveryEntity.kind] Kind of resource. + * @param {string} siteExtensionId Site extension name. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -44593,13 +48766,14 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, callback) { +function _installSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -44612,7 +48786,7 @@ function _recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, ca } // Send request - this.beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, (err, parsedResult, httpRequest, response) => { + this.beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -44631,6 +48805,20 @@ function _recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, ca 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); }); @@ -44638,19 +48826,19 @@ function _recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, ca } /** - * @summary Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * @summary Remove a site extension from a web site, or a deployment slot. * - * Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * 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 Name of the app. + * @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 resets configuration settings for the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -44669,7 +48857,7 @@ function _recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, ca * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, callback) { +function _deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -44679,7 +48867,6 @@ function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -44702,12 +48889,18 @@ function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, cal if (name === 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.'); } @@ -44717,20 +48910,21 @@ function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, cal // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resetSlotConfig'; + 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(apiVersion)); + queryParameters.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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -44755,7 +48949,7 @@ function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, cal return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 204 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -44789,27 +48983,29 @@ function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, cal } /** - * @summary Restarts an app (or deployment slot, if specified). + * @summary Get the difference in configuration settings between two web app + * slots. * - * Restarts an app (or deployment slot, if specified). + * 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 {string} slot Name of the deployment slot. If a slot is not - * specified, the API will restart the production slot. + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. * - * @param {object} [options] Optional Parameters. + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. * - * @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} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. * - * @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 {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 @@ -44820,13 +49016,15 @@ function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, cal * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _restartSlot(resourceGroupName, name, slot, options, callback) { +function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -44836,9 +49034,6 @@ function _restartSlot(resourceGroupName, name, slot, options, callback) { 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; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -44861,18 +49056,18 @@ function _restartSlot(resourceGroupName, name, slot, options, callback) { if (name === 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 (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.'); } @@ -44882,19 +49077,13 @@ function _restartSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restart'; + 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 = []; - 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -44919,7 +49108,21 @@ function _restartSlot(resourceGroupName, name, slot, options, callback) { } } } - httpRequest.body = null; + // 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) { @@ -44936,12 +49139,13 @@ function _restartSlot(resourceGroupName, name, slot, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -44954,23 +49158,117 @@ function _restartSlot(resourceGroupName, name, slot, 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['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 Get list of siteextensions for a web site, or a deployment slot. + * @summary Swaps two deployment slots of an app. * - * Get list of siteextensions for a web site, or a deployment slot. + * Swaps two deployment slots of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @param {string} name Name of the app. * - * @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} 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. * @@ -44984,14 +49282,13 @@ function _restartSlot(resourceGroupName, name, slot, 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 SiteExtensionInfoCollection} for more - * information. + * 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 _listSiteExtensionsSlot(resourceGroupName, name, slot, options, callback) { +function _listSnapshotsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -45001,7 +49298,6 @@ function _listSiteExtensionsSlot(resourceGroupName, name, slot, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -45030,6 +49326,9 @@ function _listSiteExtensionsSlot(resourceGroupName, name, slot, options, callbac if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -45039,13 +49338,13 @@ function _listSiteExtensionsSlot(resourceGroupName, name, slot, options, callbac // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -45077,7 +49376,7 @@ function _listSiteExtensionsSlot(resourceGroupName, name, slot, options, callbac return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -45087,12 +49386,13 @@ function _listSiteExtensionsSlot(resourceGroupName, name, slot, options, callbac try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -45112,7 +49412,7 @@ function _listSiteExtensionsSlot(resourceGroupName, name, slot, options, callbac parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteExtensionInfoCollection']().mapper(); + let resultMapper = new client.models['SnapshotCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -45128,21 +49428,18 @@ function _listSiteExtensionsSlot(resourceGroupName, name, slot, options, callbac } /** - * @summary Get site extension information by its ID for a web site, or a - * deployment slot. + * @summary Gets the source control configuration of an app. * - * Get site extension information by its ID for a web site, or a deployment - * slot. + * Gets the source control configuration of an app. * * @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} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. + * specified, the API will get the source control configuration for the + * production slot. * * @param {object} [options] Optional Parameters. * @@ -45156,13 +49453,13 @@ function _listSiteExtensionsSlot(resourceGroupName, name, slot, 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 SiteExtensionInfo} for more information. + * 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 _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, callback) { +function _getSourceControlSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -45172,7 +49469,6 @@ function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -45195,15 +49491,15 @@ function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, o if (name === 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.'); } @@ -45213,14 +49509,13 @@ function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, o // 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}'; + 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('{siteExtensionId}', encodeURIComponent(siteExtensionId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -45252,7 +49547,7 @@ function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, o return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -45262,12 +49557,13 @@ function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, o try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -45287,7 +49583,7 @@ function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, o parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteExtensionInfo']().mapper(); + let resultMapper = new client.models['SiteSourceControl']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -45297,6 +49593,40 @@ function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, o 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); }); @@ -45304,19 +49634,40 @@ function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, o /** - * @summary Install site extension on a web site, or a deployment slot. + * @summary Updates the source control configuration of an app. * - * Install site extension on a web site, or a deployment slot. + * Updates the source control configuration of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @param {string} name Name of the app. * - * @param {string} siteExtensionId Site extension name. + * @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 deletes a deployment for the production slot. + * specified, the API will update the source control configuration for the + * production slot. * * @param {object} [options] Optional Parameters. * @@ -45330,13 +49681,13 @@ function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, 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 SiteExtensionInfo} for more information. + * 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 _installSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, callback) { +function _createOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -45349,7 +49700,7 @@ function _installSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slo } // Send request - this.beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, (err, parsedResult, httpRequest, response) => { + this.beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -45373,7 +49724,7 @@ function _installSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slo parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteExtensionInfo']().mapper(); + let resultMapper = new client.models['SiteSourceControl']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -45389,19 +49740,18 @@ function _installSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slo } /** - * @summary Remove a site extension from a web site, or a deployment slot. + * @summary Deletes the source control configuration of an app. * - * Remove a site extension from a web site, or a deployment slot. + * Deletes the source control configuration of an app. * * @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} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. + * specified, the API will delete the source control configuration for the + * production slot. * * @param {object} [options] Optional Parameters. * @@ -45420,7 +49770,7 @@ function _installSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slo * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, callback) { +function _deleteSourceControlSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -45430,7 +49780,6 @@ function _deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -45453,15 +49802,15 @@ function _deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot if (name === 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.'); } @@ -45471,14 +49820,13 @@ function _deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot // 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}'; + 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('{siteExtensionId}', encodeURIComponent(siteExtensionId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -45510,7 +49858,7 @@ function _deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -45544,27 +49892,40 @@ function _deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot } /** - * @summary Get the difference in configuration settings between two web app - * slots. + * @summary Updates the source control configuration of an app. * - * Get the difference in configuration settings between two web app slots. + * 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} slotSwapEntity JSON object that contains the target slot - * name. See example. + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. * - * @param {string} slotSwapEntity.targetSlot Destination deployment slot during - * swap operation. + * @param {string} [siteSourceControl.repoUrl] Repository or source control + * URL. * - * @param {boolean} slotSwapEntity.preserveVnet true to preserve - * Virtual Network to the slot during swap; otherwise, false. + * @param {string} [siteSourceControl.branch] Name of branch to use for + * deployment. * - * @param {string} slot Name of the source slot. If a slot is not specified, - * the production slot is used as the source slot. + * @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. * @@ -45578,14 +49939,13 @@ function _deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot * {Error} 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. + * 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 _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, options, callback) { +function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -45595,7 +49955,6 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -45618,8 +49977,8 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, if (name === 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 (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.'); @@ -45627,6 +49986,9 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -45636,20 +49998,20 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsdiffs'; + 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(apiVersion)); + queryParameters.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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -45671,14 +50033,14 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, 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'); + 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(slotSwapEntity, null, 2)}.`); + `payload - ${JSON.stringify(siteSourceControl, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -45688,7 +50050,7 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -45698,12 +50060,13 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -45723,7 +50086,7 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SlotDifferenceCollection']().mapper(); + let resultMapper = new client.models['SiteSourceControl']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -45733,33 +50096,57 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, 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. + * @summary Starts an app (or deployment slot, if specified). * - * Swaps two deployment slots of an app. + * 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} 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 {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. * @@ -45778,75 +50165,7 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, * * {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) { +function _startSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -45856,7 +50175,6 @@ function _listSnapshotsSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -45885,6 +50203,9 @@ function _listSnapshotsSlot(resourceGroupName, name, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -45894,20 +50215,20 @@ function _listSnapshotsSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshots'; + 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(apiVersion)); + queryParameters.push('api-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 @@ -45960,32 +50281,15 @@ function _listSnapshotsSlot(resourceGroupName, name, slot, 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['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. + * @summary Stops an app (or deployment slot, if specified). * - * Gets the source control configuration of an app. + * Stops an app (or deployment slot, if specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -45993,8 +50297,7 @@ function _listSnapshotsSlot(resourceGroupName, name, slot, options, callback) { * @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. + * specified, the API will stop the production slot. * * @param {object} [options] Optional Parameters. * @@ -46007,14 +50310,13 @@ function _listSnapshotsSlot(resourceGroupName, name, slot, 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 SiteSourceControl} 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 _getSourceControlSlot(resourceGroupName, name, slot, options, callback) { +function _stopSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -46024,7 +50326,6 @@ function _getSourceControlSlot(resourceGroupName, name, slot, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -46053,6 +50354,9 @@ function _getSourceControlSlot(resourceGroupName, name, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -46062,20 +50366,20 @@ function _getSourceControlSlot(resourceGroupName, name, slot, options, callback) // 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'; + 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(apiVersion)); + queryParameters.push('api-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 @@ -46100,7 +50404,7 @@ function _getSourceControlSlot(resourceGroupName, name, slot, options, callback) return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -46128,182 +50432,23 @@ function _getSourceControlSlot(resourceGroupName, name, slot, 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['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. + * @summary Sync web app repository. * - * Deletes the source control configuration of an app. + * Sync web app repository. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name Name of web 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 {string} slot Name of web app slot. If not specified then will + * default to production slot. * * @param {object} [options] Optional Parameters. * @@ -46322,7 +50467,7 @@ function _createOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceCon * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteSourceControlSlot(resourceGroupName, name, slot, options, callback) { +function _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -46332,7 +50477,6 @@ function _deleteSourceControlSlot(resourceGroupName, name, slot, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -46361,6 +50505,9 @@ function _deleteSourceControlSlot(resourceGroupName, name, slot, options, callba if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -46370,20 +50517,20 @@ function _deleteSourceControlSlot(resourceGroupName, name, slot, options, callba // 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'; + 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(apiVersion)); + queryParameters.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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -46408,7 +50555,7 @@ function _deleteSourceControlSlot(resourceGroupName, name, slot, options, callba return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -46442,40 +50589,168 @@ function _deleteSourceControlSlot(resourceGroupName, name, slot, options, callba } /** - * @summary Updates the source control configuration of an app. + * @summary Syncs function trigger metadata to the scale controller * - * Updates the source control configuration of an app. + * 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} siteSourceControl JSON representation of a SiteSourceControl - * object. See example. + * @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 {string} [siteSourceControl.repoUrl] Repository or source control - * URL. + * @param {object} [options] Optional Parameters. * - * @param {string} [siteSourceControl.branch] Name of branch to use for - * deployment. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} [siteSourceControl.isManualIntegration] true - * to limit to manual integration; false to enable continuous - * integration (which configures webhooks into online repos like GitHub). + * @param {function} callback - The callback. * - * @param {boolean} [siteSourceControl.deploymentRollbackEnabled] - * true to enable deployment rollback; otherwise, - * false. + * @returns {function} callback(err, result, request, response) * - * @param {boolean} [siteSourceControl.isMercurial] true for a - * Mercurial repository; false for a Git repository. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {string} [siteSourceControl.kind] Kind of resource. + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [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 will update the source control configuration for the - * production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -46489,13 +50764,14 @@ function _deleteSourceControlSlot(resourceGroupName, name, slot, 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 SiteSourceControl} for more information. + * 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 _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, callback) { +function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -46505,7 +50781,6 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -46528,15 +50803,15 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl if (name === 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.'); } @@ -46546,20 +50821,20 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl // 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'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -46577,28 +50852,14 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl } } } - // 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; + httpRequest.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); @@ -46608,12 +50869,13 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -46633,7 +50895,7 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteSourceControl']().mapper(); + let resultMapper = new client.models['TriggeredWebJobCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -46643,40 +50905,26 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl 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); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Starts an app (or deployment slot, if specified). + * @summary Gets a triggered web job by its ID for an app, or a deployment + * slot. * - * Starts an app (or deployment slot, if specified). + * 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 Name of the app. + * @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 will start the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -46689,13 +50937,14 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _startSlot(resourceGroupName, name, slot, options, callback) { +function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -46705,7 +50954,6 @@ function _startSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -46728,12 +50976,18 @@ function _startSlot(resourceGroupName, name, slot, options, callback) { if (name === 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.'); } @@ -46743,20 +50997,21 @@ function _startSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/start'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -46781,7 +51036,7 @@ function _startSlot(resourceGroupName, name, slot, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -46809,23 +51064,43 @@ function _startSlot(resourceGroupName, name, slot, 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['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 Stops an app (or deployment slot, if specified). + * @summary Delete a triggered web job by its ID for an app, or a deployment + * slot. * - * Stops an app (or deployment slot, if specified). + * 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 Name of the app. + * @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 will stop the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -46844,7 +51119,7 @@ function _startSlot(resourceGroupName, name, slot, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _stopSlot(resourceGroupName, name, slot, options, callback) { +function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -46854,7 +51129,6 @@ function _stopSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -46877,12 +51151,18 @@ function _stopSlot(resourceGroupName, name, slot, options, callback) { if (name === 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.'); } @@ -46892,20 +51172,21 @@ function _stopSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop'; + 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(apiVersion)); + queryParameters.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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -46930,7 +51211,7 @@ function _stopSlot(resourceGroupName, name, slot, 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); @@ -46964,17 +51245,20 @@ function _stopSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary Sync web app repository. + * @summary List a triggered web job's history for an app, or a deployment + * slot. * - * Sync web app repository. + * 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 Name of web app. + * @param {string} name Site name. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -46987,13 +51271,15 @@ function _stopSlot(resourceGroupName, name, slot, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { +function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -47003,7 +51289,6 @@ function _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -47026,12 +51311,18 @@ function _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { if (name === 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.'); } @@ -47041,20 +51332,21 @@ function _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sync'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -47079,7 +51371,7 @@ function _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -47107,23 +51399,46 @@ function _syncRepositorySlot(resourceGroupName, name, slot, 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['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 Syncs function trigger metadata to the scale controller + * @summary Gets a triggered web job's history by its ID for an app, , or a + * deployment slot. * - * Syncs function trigger metadata to the scale controller + * 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 Name of the app. + * @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 will restore a backup of the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -47136,13 +51451,14 @@ function _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callback) { +function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -47152,7 +51468,6 @@ function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -47175,12 +51490,21 @@ function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callb if (name === 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.'); } @@ -47190,20 +51514,22 @@ function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/syncfunctiontriggers'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -47228,7 +51554,7 @@ function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callb return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -47256,21 +51582,40 @@ function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callb // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 List triggered web jobs for an app, or a deployment slot. + * @summary Run a triggered web job for an app, or a deployment slot. * - * List triggered web jobs 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. * @@ -47285,15 +51630,13 @@ function _syncFunctionTriggersSlot(resourceGroupName, name, slot, 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 TriggeredWebJobCollection} 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 _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callback) { +function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -47303,7 +51646,6 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -47326,12 +51668,18 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb if (name === 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.'); } @@ -47341,20 +51689,21 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs'; + 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(apiVersion)); + queryParameters.push('api-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 @@ -47379,7 +51728,7 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -47407,46 +51756,34 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @summary Gets the quota usage information of an app (or deployment slot, if + * specified). * - * Gets a triggered web job by its ID for an app, or a deployment slot. + * 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 Site name. - * - * @param {string} webJobName Name of Web Job. + * @param {string} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. + * 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 * @@ -47457,13 +51794,14 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, 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 TriggeredWebJob} for more information. + * 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 _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -47473,7 +51811,7 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; + let filter = (options && options.filter !== undefined) ? options.filter : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -47496,15 +51834,18 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti if (name === 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 (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.'); } @@ -47514,14 +51855,16 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti // 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}'; + 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('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -47553,7 +51896,7 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -47563,12 +51906,13 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -47588,7 +51932,7 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TriggeredWebJob']().mapper(); + let resultMapper = new client.models['CsmUsageQuotaCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -47604,20 +51948,19 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti } /** - * @summary Delete a triggered web job by its ID for an app, or a deployment - * slot. + * @summary Gets the virtual networks the app (or deployment slot) is connected + * to. * - * Delete a triggered web job by its ID for an app, or a deployment slot. + * 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 Site name. - * - * @param {string} webJobName Name of Web Job. + * @param {string} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. + * specified, the API will get virtual network connections for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -47630,13 +51973,13 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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 _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -47646,7 +51989,6 @@ function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -47669,15 +52011,15 @@ function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, o if (name === 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.'); } @@ -47687,21 +52029,20 @@ function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, o // 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}'; + 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('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -47726,7 +52067,7 @@ function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, o return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -47736,12 +52077,13 @@ function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, o try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -47754,26 +52096,58 @@ function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, 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 = { + 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 List a triggered web job's history for an app, or a deployment - * slot. + * @summary Gets a virtual network the app (or deployment slot) is connected to + * by name. * - * List a triggered web job's history for an app, or a deployment slot. + * 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 Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @param {string} vnetName Name of the virtual network. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. + * specified, the API will get the named virtual network for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -47787,14 +52161,13 @@ function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, 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 TriggeredJobHistoryCollection} for more - * information. + * 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 _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -47804,7 +52177,6 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -47827,8 +52199,8 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl if (name === 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 (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.'); @@ -47836,6 +52208,9 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -47845,14 +52220,14 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl // 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'; + 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('{webJobName}', encodeURIComponent(webJobName)); + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -47884,7 +52259,7 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -47894,12 +52269,13 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -47919,7 +52295,7 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TriggeredJobHistoryCollection']().mapper(); + let resultMapper = new client.models['VnetInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -47935,23 +52311,36 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl } /** - * @summary Gets a triggered web job's history by its ID for an app, , or a - * deployment slot. + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). * - * Gets a triggered web job's history by its ID for an app, , or a deployment - * slot. + * 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 Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @param {string} vnetName Name of an existing Virtual Network. * - * @param {string} id History ID. + * @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 deletes a deployment for the production slot. + * specified, the API will add or update connections for the production slot. * * @param {object} [options] Optional Parameters. * @@ -47965,13 +52354,13 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl * {Error} 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. + * 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 _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, slot, options, callback) { +function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -47981,7 +52370,6 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -48004,11 +52392,11 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, if (name === 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 (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 (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 (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.'); @@ -48016,6 +52404,9 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -48025,22 +52416,21 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, // 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}'; + 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('{webJobName}', encodeURIComponent(webJobName)); - requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); + 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(apiVersion)); + queryParameters.push('api-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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -48058,14 +52448,28 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, } } } - httpRequest.body = null; + // 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 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -48075,12 +52479,13 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -48100,7 +52505,7 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TriggeredJobHistory']().mapper(); + let resultMapper = new client.models['VnetInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -48116,19 +52521,21 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, } /** - * @summary Run a triggered web job for an app, or a deployment slot. + * @summary Deletes a connection from an app (or deployment slot to a named + * virtual network. * - * Run a triggered web job for an app, or a deployment slot. + * 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 Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @param {string} vnetName Name of the virtual network. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. + * specified, the API will delete the connection for the production slot. * * @param {object} [options] Optional Parameters. * @@ -48147,7 +52554,7 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -48157,7 +52564,6 @@ function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -48180,8 +52586,8 @@ function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti if (name === 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 (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.'); @@ -48189,6 +52595,9 @@ function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -48198,21 +52607,21 @@ function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti // 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'; + 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('{webJobName}', encodeURIComponent(webJobName)); + 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(apiVersion)); + queryParameters.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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -48271,28 +52680,39 @@ function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti } /** - * @summary Gets the quota usage information of an app (or deployment slot, if - * specified). + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). * - * Gets the quota usage information of an app (or deployment slot, if - * specified). + * 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 get quota information of the production slot. + * specified, the API will add or update connections for 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 * @@ -48303,14 +52723,13 @@ function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, 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 CsmUsageQuotaCollection} for more - * information. + * 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 _listUsagesSlot(resourceGroupName, name, slot, options, callback) { +function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -48320,8 +52739,6 @@ function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -48344,15 +52761,21 @@ function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { if (name === 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 (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.'); } @@ -48362,23 +52785,21 @@ function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/usages'; + 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 = []; - 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -48396,7 +52817,21 @@ function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { } } } - httpRequest.body = null; + // 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) { @@ -48413,12 +52848,13 @@ function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -48438,7 +52874,7 @@ function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['CsmUsageQuotaCollection']().mapper(); + let resultMapper = new client.models['VnetInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -48454,19 +52890,23 @@ function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary Gets the virtual networks the app (or deployment slot) is connected - * to. + * @summary Gets an app's Virtual Network gateway. * - * Gets the virtual networks the app (or deployment slot) is connected to. + * 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 virtual network connections for the production - * slot. + * specified, the API will get a gateway for the production slot's Virtual + * Network. * * @param {object} [options] Optional Parameters. * @@ -48479,13 +52919,14 @@ function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { * * {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 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 _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callback) { +function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -48495,7 +52936,6 @@ function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -48518,12 +52958,21 @@ function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callba if (name === 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.'); } @@ -48533,13 +52982,15 @@ function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callba // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -48571,7 +53022,7 @@ function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callba return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -48606,21 +53057,7 @@ function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callba 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' - } - } - } - }; + let resultMapper = new client.models['VnetGateway']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -48636,21 +53073,34 @@ function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callba } /** - * @summary Gets a virtual network the app (or deployment slot) is connected to - * by name. + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). * - * Gets a virtual network the app (or deployment slot) is connected to by name. + * 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} 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 get the named virtual network for the production - * slot. + * specified, the API will add or update a gateway for the production slot's + * Virtual Network. * * @param {object} [options] Optional Parameters. * @@ -48664,13 +53114,13 @@ function _listVnetConnectionsSlot(resourceGroupName, name, slot, 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 VnetInfo} for more information. + * 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 _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options, callback) { +function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -48680,7 +53130,6 @@ function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -48706,12 +53155,21 @@ function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options 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.'); } @@ -48721,21 +53179,22 @@ function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options // 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}'; + 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(apiVersion)); + queryParameters.push('api-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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -48753,7 +53212,21 @@ function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options } } } - httpRequest.body = null; + // 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) { @@ -48770,12 +53243,13 @@ function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -48795,7 +53269,7 @@ function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VnetInfo']().mapper(); + let resultMapper = new client.models['VnetGateway']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -48811,36 +53285,34 @@ function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options } /** - * @summary Adds a Virtual Network connection to an app or slot (PUT) or - * updates the connection properties (PATCH). + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). * - * Adds a Virtual Network connection to an app or slot (PUT) or updates the - * connection properties (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 an existing Virtual Network. + * @param {string} vnetName Name of the Virtual Network. * - * @param {object} connectionEnvelope Properties of the Virtual Network - * connection. See example. + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". * - * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's - * resource ID. + * @param {object} connectionEnvelope The properties to update this gateway + * with. * - * @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.vnetName] The Virtual Network name. * - * @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.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 connections for the production slot. + * specified, the API will add or update a gateway for the production slot's + * Virtual Network. * * @param {object} [options] Optional Parameters. * @@ -48854,13 +53326,13 @@ function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, 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 VnetInfo} for more information. + * 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 _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, slot, options, callback) { +function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -48870,7 +53342,6 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -48896,6 +53367,9 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co 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.'); } @@ -48905,6 +53379,9 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -48914,21 +53391,22 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co // 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}'; + 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(apiVersion)); + queryParameters.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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -48951,7 +53429,7 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co let requestModel = null; try { if (connectionEnvelope !== null && connectionEnvelope !== undefined) { - let requestModelMapper = new client.models['VnetInfo']().mapper(); + let requestModelMapper = new client.models['VnetGateway']().mapper(); requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); requestContent = JSON.stringify(requestModel); } @@ -48977,12 +53455,13 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -49002,7 +53481,7 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VnetInfo']().mapper(); + let resultMapper = new client.models['VnetGateway']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -49018,21 +53497,17 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co } /** - * @summary Deletes a connection from an app (or deployment slot to a named - * virtual network. + * @summary List webjobs for an app, or a deployment slot. * - * Deletes a connection from an app (or deployment slot to a named virtual - * network. + * 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 Name of the app. - * - * @param {string} vnetName Name of the virtual network. + * @param {string} name Site name. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will delete the connection for the production slot. + * specified, the API returns deployments for the production slot. * * @param {object} [options] Optional Parameters. * @@ -49045,13 +53520,14 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options, callback) { +function _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -49061,7 +53537,6 @@ function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -49084,15 +53559,15 @@ function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, opti if (name === 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.'); } @@ -49102,21 +53577,20 @@ function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, opti // 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}'; + 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('{vnetName}', encodeURIComponent(vnetName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -49141,7 +53615,7 @@ function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, opti return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -49151,12 +53625,13 @@ function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, opti try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -49169,42 +53644,42 @@ function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, opti // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Adds a Virtual Network connection to an app or slot (PUT) or - * updates the connection properties (PATCH). + * @summary Get webjob information for an app, or a deployment slot. * - * Adds a Virtual Network connection to an app or slot (PUT) or updates the - * connection properties (PATCH). + * 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 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} name Site name. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} webJobName Name of the web job. * * @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. + * specified, the API returns deployments for the production slot. * * @param {object} [options] Optional Parameters. * @@ -49218,13 +53693,13 @@ function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, 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 VnetInfo} for more information. + * 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 _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connectionEnvelope, slot, options, callback) { +function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -49234,7 +53709,6 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -49257,11 +53731,8 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection if (name === 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 (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.'); @@ -49269,6 +53740,9 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -49278,21 +53752,21 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection // 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}'; + 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('{vnetName}', encodeURIComponent(vnetName)); + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -49310,21 +53784,7 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -49341,12 +53801,13 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -49366,7 +53827,7 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VnetInfo']().mapper(); + let resultMapper = new client.models['WebJob']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -49382,23 +53843,24 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection } /** - * @summary Gets an app's Virtual Network gateway. + * @summary Get the difference in configuration settings between two web app + * slots. * - * Gets an app's Virtual Network gateway. + * 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 {string} vnetName Name of the Virtual Network. + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. * - * @param {string} gatewayName Name of the gateway. Currently, the only - * supported string is "primary". + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. * - * @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 {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. * * @param {object} [options] Optional Parameters. * @@ -49412,13 +53874,14 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection * {Error} 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. + * 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 _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, slot, options, callback) { +function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEntity, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -49428,7 +53891,6 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -49451,18 +53913,15 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa if (name === 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 (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.'); } @@ -49472,22 +53931,19 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa // 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}'; + 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('{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(apiVersion)); + queryParameters.push('api-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 @@ -49505,14 +53961,28 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa } } } - httpRequest.body = null; + // 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 !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -49522,12 +53992,13 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -49547,7 +54018,7 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VnetGateway']().mapper(); + let resultMapper = new client.models['SlotDifferenceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -49562,35 +54033,90 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa }); } + /** - * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it - * (PATCH). + * @summary Swaps two deployment slots of an app. * - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * 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 {string} vnetName Name of the Virtual Network. + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. * - * @param {string} gatewayName Name of the gateway. Currently, the only - * supported string is "primary". + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. * - * @param {object} connectionEnvelope The properties to update this gateway - * with. + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. * - * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * @param {object} [options] Optional Parameters. * - * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN - * package can be downloaded. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {function} callback - The callback. * - * @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. + * @returns {function} callback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {object} [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. * @@ -49604,13 +54130,13 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa * {Error} 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. + * 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 _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot, options, callback) { +function _listSnapshots(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -49620,7 +54146,6 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -49643,21 +54168,12 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN if (name === 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.'); } @@ -49667,22 +54183,19 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN // 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}'; + 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('{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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -49700,21 +54213,7 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -49731,12 +54230,13 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -49756,7 +54256,7 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VnetGateway']().mapper(); + let resultMapper = new client.models['SnapshotCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -49772,35 +54272,15 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN } /** - * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it - * (PATCH). + * @summary Gets the source control configuration of an app. * - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * 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} 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 @@ -49813,13 +54293,13 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN * {Error} 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. + * 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 _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot, options, callback) { +function _getSourceControl(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -49829,7 +54309,6 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -49852,21 +54331,12 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat if (name === 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.'); } @@ -49876,22 +54346,19 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat // 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}'; + 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('{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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -49909,28 +54376,14 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat } } } - // 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; + httpRequest.body = null; // 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 !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -49940,12 +54393,13 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -49965,7 +54419,144 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VnetGateway']().mapper(); + 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) { @@ -49974,24 +54565,21 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } - } - return callback(null, result, httpRequest, response); + return callback(null, result, httpRequest, response); + }); }); } /** - * @summary List webjobs for an app, or a deployment slot. + * @summary Deletes the source control configuration of an app. * - * List webjobs for an app, or a deployment slot. + * Deletes the source control configuration of an app. * * @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} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -50004,14 +54592,13 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat * * {Error} 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [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) { +function _deleteSourceControl(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -50021,7 +54608,6 @@ function _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -50044,12 +54630,12 @@ function _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { if (name === 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.'); } @@ -50059,20 +54645,19 @@ function _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs'; + 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('{slot}', encodeURIComponent(slot)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -50097,7 +54682,7 @@ function _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 202 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -50125,42 +54710,42 @@ function _listWebJobsSlot(resourceGroupName, name, slot, 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['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. + * @summary Updates the source control configuration of an app. * - * Get webjob information for an app, or a deployment slot. + * Updates the source control configuration of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of the web job. + * @param {object} siteSourceControl JSON representation of a SiteSourceControl + * object. See example. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. + * @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. * @@ -50174,13 +54759,13 @@ function _listWebJobsSlot(resourceGroupName, name, slot, 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 WebJob} for more information. + * 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 _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _updateSourceControl(resourceGroupName, name, siteSourceControl, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -50190,7 +54775,6 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -50213,15 +54797,15 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call if (name === 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 (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.'); } @@ -50231,21 +54815,19 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call // 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}'; + 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('{webJobName}', encodeURIComponent(webJobName)); - requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -50263,14 +54845,28 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call } } } - httpRequest.body = null; + // 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) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -50280,12 +54876,13 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -50305,7 +54902,7 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebJob']().mapper(); + let resultMapper = new client.models['SiteSourceControl']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -50315,31 +54912,55 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call 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 the difference in configuration settings between two web app - * slots. + * @summary Starts an app (or deployment slot, if specified). * - * Get the difference in configuration settings between two web app slots. + * 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} 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 @@ -50351,15 +54972,13 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call * * {Error} 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [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) { +function _start(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -50369,7 +54988,6 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -50392,12 +55010,12 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt if (name === 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.'); } @@ -50407,12 +55025,12 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsdiffs'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -50437,21 +55055,7 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -50486,48 +55090,21 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @summary Stops an app (or deployment slot, if specified). * - * Swaps two deployment slots of an app. + * 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} 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 @@ -50545,73 +55122,7 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt * * {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) { +function _stop(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -50621,7 +55132,6 @@ function _listSnapshots(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -50647,6 +55157,9 @@ function _listSnapshots(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -50656,19 +55169,19 @@ function _listSnapshots(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshots'; + 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(apiVersion)); + queryParameters.push('api-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 @@ -50721,37 +55234,20 @@ function _listSnapshots(resourceGroupName, name, 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['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. + * @summary Sync web app repository. * - * Gets the source control configuration of an app. + * Sync web app repository. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name Name of web app. * * @param {object} [options] Optional Parameters. * @@ -50764,14 +55260,13 @@ function _listSnapshots(resourceGroupName, name, 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 SiteSourceControl} 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 _getSourceControl(resourceGroupName, name, options, callback) { +function _syncRepository(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -50781,7 +55276,6 @@ function _getSourceControl(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -50807,6 +55301,9 @@ function _getSourceControl(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -50816,19 +55313,19 @@ function _getSourceControl(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'; + 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(apiVersion)); + queryParameters.push('api-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 @@ -50853,7 +55350,7 @@ function _getSourceControl(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -50881,169 +55378,15 @@ function _getSourceControl(resourceGroupName, name, 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['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. + * @summary Syncs function trigger metadata to the scale controller * - * Deletes the source control configuration of an app. + * Syncs function trigger metadata to the scale controller * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -51067,7 +55410,7 @@ function _createOrUpdateSourceControl(resourceGroupName, name, siteSourceControl * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteSourceControl(resourceGroupName, name, options, callback) { +function _syncFunctionTriggers(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -51077,7 +55420,6 @@ function _deleteSourceControl(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -51103,6 +55445,9 @@ function _deleteSourceControl(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -51112,19 +55457,19 @@ function _deleteSourceControl(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'; + 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(apiVersion)); + queryParameters.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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -51149,7 +55494,7 @@ function _deleteSourceControl(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202 && statusCode !== 404) { + if (statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -51183,36 +55528,14 @@ function _deleteSourceControl(resourceGroupName, name, options, callback) { } /** - * @summary Updates the source control configuration of an app. + * @summary List triggered web jobs for an app, or a deployment slot. * - * Updates the source control configuration of an app. + * 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 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} name Site name. * * @param {object} [options] Optional Parameters. * @@ -51226,13 +55549,14 @@ function _deleteSourceControl(resourceGroupName, name, 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 SiteSourceControl} for more information. + * 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 _updateSourceControl(resourceGroupName, name, siteSourceControl, options, callback) { +function _listTriggeredWebJobs(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -51242,7 +55566,6 @@ function _updateSourceControl(resourceGroupName, name, siteSourceControl, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -51265,12 +55588,12 @@ function _updateSourceControl(resourceGroupName, name, siteSourceControl, option if (name === 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.'); } @@ -51280,19 +55603,19 @@ function _updateSourceControl(resourceGroupName, name, siteSourceControl, option // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -51310,28 +55633,14 @@ function _updateSourceControl(resourceGroupName, name, siteSourceControl, option } } } - // 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; + httpRequest.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); @@ -51341,12 +55650,13 @@ function _updateSourceControl(resourceGroupName, name, siteSourceControl, option try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -51366,7 +55676,7 @@ function _updateSourceControl(resourceGroupName, name, siteSourceControl, option parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteSourceControl']().mapper(); + let resultMapper = new client.models['TriggeredWebJobCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -51376,37 +55686,23 @@ function _updateSourceControl(resourceGroupName, name, siteSourceControl, option 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); - } - } return callback(null, result, httpRequest, response); }); } /** - * @summary Starts an app (or deployment slot, if specified). + * @summary Gets a triggered web job by its ID for an app, or a deployment + * slot. * - * Starts an app (or deployment slot, if specified). + * 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 Name of the app. + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. * * @param {object} [options] Optional Parameters. * @@ -51419,13 +55715,14 @@ function _updateSourceControl(resourceGroupName, name, siteSourceControl, option * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _start(resourceGroupName, name, options, callback) { +function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -51435,7 +55732,6 @@ function _start(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -51458,9 +55754,15 @@ function _start(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -51470,19 +55772,20 @@ function _start(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/start'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -51507,7 +55810,7 @@ function _start(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -51535,162 +55838,40 @@ function _start(resourceGroupName, name, options, callback) { // 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + 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 (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); } - return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; return callback(null, result, httpRequest, response); }); } /** - * @summary Sync web app repository. + * @summary Delete a triggered web job by its ID for an app, or a deployment + * slot. * - * Sync web app repository. + * 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 Name of web app. + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. * * @param {object} [options] Optional Parameters. * @@ -51709,7 +55890,7 @@ function _stop(resourceGroupName, name, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _syncRepository(resourceGroupName, name, options, callback) { +function _deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -51719,7 +55900,6 @@ function _syncRepository(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -51742,9 +55922,15 @@ function _syncRepository(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -51754,19 +55940,20 @@ function _syncRepository(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sync'; + 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(apiVersion)); + queryParameters.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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -51791,7 +55978,7 @@ function _syncRepository(resourceGroupName, name, 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); @@ -51825,14 +56012,17 @@ function _syncRepository(resourceGroupName, name, options, callback) { } /** - * @summary Syncs function trigger metadata to the scale controller + * @summary List a triggered web job's history for an app, or a deployment + * slot. * - * Syncs function trigger metadata to the scale controller + * 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 Name of the app. + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. * * @param {object} [options] Optional Parameters. * @@ -51845,13 +56035,15 @@ function _syncRepository(resourceGroupName, name, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _syncFunctionTriggers(resourceGroupName, name, options, callback) { +function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -51861,7 +56053,6 @@ function _syncFunctionTriggers(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -51884,9 +56075,15 @@ function _syncFunctionTriggers(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -51896,19 +56093,20 @@ function _syncFunctionTriggers(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/syncfunctiontriggers'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -51933,7 +56131,7 @@ function _syncFunctionTriggers(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -51961,21 +56159,44 @@ function _syncFunctionTriggers(resourceGroupName, name, 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['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 List triggered web jobs for an app, or a deployment slot. + * @summary Gets a triggered web job's history by its ID for an app, , or a + * deployment slot. * - * List triggered web jobs 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 @@ -51988,14 +56209,13 @@ function _syncFunctionTriggers(resourceGroupName, name, 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 TriggeredWebJobCollection} for more - * information. + * 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 _listTriggeredWebJobs(resourceGroupName, name, options, callback) { +function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -52005,7 +56225,6 @@ function _listTriggeredWebJobs(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -52028,9 +56247,18 @@ function _listTriggeredWebJobs(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -52040,12 +56268,14 @@ function _listTriggeredWebJobs(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -52077,7 +56307,7 @@ function _listTriggeredWebJobs(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -52112,7 +56342,7 @@ function _listTriggeredWebJobs(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TriggeredWebJobCollection']().mapper(); + let resultMapper = new client.models['TriggeredJobHistory']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -52128,10 +56358,9 @@ function _listTriggeredWebJobs(resourceGroupName, name, options, callback) { } /** - * @summary Gets a triggered web job by its ID for an app, or a deployment - * slot. + * @summary Run a triggered web job for an app, or a deployment slot. * - * Gets a triggered web job by its ID 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. @@ -52151,14 +56380,13 @@ function _listTriggeredWebJobs(resourceGroupName, name, 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 TriggeredWebJob} 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 _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callback) { +function _runTriggeredWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -52168,7 +56396,6 @@ function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -52197,6 +56424,9 @@ function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callb if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -52206,20 +56436,20 @@ function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}'; + 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(apiVersion)); + queryParameters.push('api-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 @@ -52272,6 +56502,168 @@ function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callb // 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; @@ -52279,7 +56671,7 @@ function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callb parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TriggeredWebJob']().mapper(); + let resultMapper = new client.models['CsmUsageQuotaCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -52295,17 +56687,15 @@ function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callb } /** - * @summary Delete a triggered web job by its ID for an app, or a deployment - * slot. + * @summary Gets the virtual networks the app (or deployment slot) is connected + * to. * - * Delete a triggered web job by its ID for an app, or a deployment slot. + * 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 Site name. - * - * @param {string} webJobName Name of Web Job. + * @param {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -52318,13 +56708,13 @@ function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callb * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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 _deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, callback) { +function _listVnetConnections(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -52334,7 +56724,6 @@ function _deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -52357,12 +56746,12 @@ function _deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, ca if (name === 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.'); } @@ -52372,20 +56761,19 @@ function _deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}'; + 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('{webJobName}', encodeURIComponent(webJobName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -52410,7 +56798,7 @@ function _deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, ca return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -52420,12 +56808,13 @@ function _deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, ca try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -52438,23 +56827,54 @@ function _deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, ca // Create Result let result = null; if (responseBody === '') responseBody = null; + // 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 List a triggered web job's history for an app, or a deployment - * slot. + * @summary Gets a virtual network the app (or deployment slot) is connected to + * by name. * - * List a triggered web job's history for an app, or a deployment slot. + * 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 Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @param {string} vnetName Name of the virtual network. * * @param {object} [options] Optional Parameters. * @@ -52468,14 +56888,13 @@ function _deleteTriggeredWebJob(resourceGroupName, name, webJobName, 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 TriggeredJobHistoryCollection} for more - * information. + * 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 _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, options, callback) { +function _getVnetConnection(resourceGroupName, name, vnetName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -52485,7 +56904,6 @@ function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -52508,12 +56926,15 @@ function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, option if (name === 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 (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.'); } @@ -52523,13 +56944,13 @@ function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, option // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history'; + 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('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); 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('&'); } @@ -52561,7 +56982,7 @@ function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, option return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -52571,12 +56992,13 @@ function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, option try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -52596,7 +57018,7 @@ function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, option parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TriggeredJobHistoryCollection']().mapper(); + let resultMapper = new client.models['VnetInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -52612,20 +57034,33 @@ function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, option } /** - * @summary Gets a triggered web job's history by its ID for an app, , or a - * deployment slot. + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). * - * Gets a triggered web job's history by its ID for an app, , or a deployment - * slot. + * 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 Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @param {string} vnetName Name of an existing Virtual Network. * - * @param {string} id History ID. + * @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. * @@ -52639,13 +57074,13 @@ function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, 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 TriggeredJobHistory} for more information. + * 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 _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, options, callback) { +function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -52655,7 +57090,6 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -52678,15 +57112,18 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt if (name === 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 (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 (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 (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.'); } @@ -52696,21 +57133,20 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt // 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}'; + 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('{webJobName}', encodeURIComponent(webJobName)); - requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -52728,14 +57164,28 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt } } } - httpRequest.body = null; + // 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 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -52745,12 +57195,13 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -52770,7 +57221,7 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TriggeredJobHistory']().mapper(); + let resultMapper = new client.models['VnetInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -52786,16 +57237,18 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt } /** - * @summary Run a triggered web job for an app, or a deployment slot. + * @summary Deletes a connection from an app (or deployment slot to a named + * virtual network. * - * Run a triggered web job for an app, or a deployment slot. + * 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 Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @param {string} vnetName Name of the virtual network. * * @param {object} [options] Optional Parameters. * @@ -52814,7 +57267,7 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _runTriggeredWebJob(resourceGroupName, name, webJobName, options, callback) { +function _deleteVnetConnection(resourceGroupName, name, vnetName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -52824,7 +57277,6 @@ function _runTriggeredWebJob(resourceGroupName, name, webJobName, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -52847,12 +57299,15 @@ function _runTriggeredWebJob(resourceGroupName, name, webJobName, options, callb if (name === 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 (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.'); } @@ -52862,20 +57317,20 @@ function _runTriggeredWebJob(resourceGroupName, name, webJobName, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/run'; + 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('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -52934,24 +57389,35 @@ function _runTriggeredWebJob(resourceGroupName, name, webJobName, options, callb } /** - * @summary Gets the quota usage information of an app (or deployment slot, if - * specified). + * @summary Adds a Virtual Network connection to an app or slot (PUT) or + * updates the connection properties (PATCH). * - * Gets the quota usage information of an app (or deployment slot, if - * specified). + * 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 {object} [options] Optional Parameters. + * @param {string} vnetName Name of an existing Virtual Network. * - * @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} 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 @@ -52963,14 +57429,13 @@ function _runTriggeredWebJob(resourceGroupName, name, webJobName, 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 CsmUsageQuotaCollection} for more - * information. + * 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 _listUsages(resourceGroupName, name, options, callback) { +function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -52980,8 +57445,6 @@ function _listUsages(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -53004,12 +57467,18 @@ function _listUsages(resourceGroupName, name, options, callback) { if (name === 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 (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.'); } @@ -53019,22 +57488,20 @@ function _listUsages(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/usages'; + 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 = []; - 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -53052,7 +57519,21 @@ function _listUsages(resourceGroupName, name, options, callback) { } } } - httpRequest.body = null; + // 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) { @@ -53069,12 +57550,13 @@ function _listUsages(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -53094,7 +57576,7 @@ function _listUsages(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['CsmUsageQuotaCollection']().mapper(); + let resultMapper = new client.models['VnetInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -53110,16 +57592,20 @@ function _listUsages(resourceGroupName, name, options, callback) { } /** - * @summary Gets the virtual networks the app (or deployment slot) is connected - * to. + * @summary Gets an app's Virtual Network gateway. * - * Gets the virtual networks the app (or deployment slot) is connected to. + * 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 @@ -53131,13 +57617,14 @@ function _listUsages(resourceGroupName, name, options, callback) { * * {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 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 _listVnetConnections(resourceGroupName, name, options, callback) { +function _getVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53147,7 +57634,6 @@ function _listVnetConnections(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -53170,9 +57656,18 @@ function _listVnetConnections(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -53182,12 +57677,14 @@ function _listVnetConnections(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -53219,7 +57716,7 @@ function _listVnetConnections(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -53254,21 +57751,7 @@ function _listVnetConnections(resourceGroupName, name, 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: 'VnetInfoElementType', - type: { - name: 'Composite', - className: 'VnetInfo' - } - } - } - }; + let resultMapper = new client.models['VnetGateway']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -53284,17 +57767,30 @@ function _listVnetConnections(resourceGroupName, name, options, callback) { } /** - * @summary Gets a virtual network the app (or deployment slot) is connected to - * by name. + * @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". * - * Gets a virtual network the app (or deployment slot) is connected to by name. + * @param {object} connectionEnvelope The properties to update this gateway + * with. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. * - * @param {string} name Name of the app. + * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN + * package can be downloaded. * - * @param {string} vnetName Name of the virtual network. + * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -53308,13 +57804,13 @@ function _listVnetConnections(resourceGroupName, name, 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 VnetInfo} for more information. + * 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 _getVnetConnection(resourceGroupName, name, vnetName, options, callback) { +function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53324,7 +57820,6 @@ function _getVnetConnection(resourceGroupName, name, vnetName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -53350,9 +57845,18 @@ function _getVnetConnection(resourceGroupName, name, vnetName, options, callback 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.'); } @@ -53362,20 +57866,21 @@ function _getVnetConnection(resourceGroupName, name, vnetName, options, callback // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'; + 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(apiVersion)); + queryParameters.push('api-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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -53393,7 +57898,21 @@ function _getVnetConnection(resourceGroupName, name, vnetName, options, callback } } } - httpRequest.body = null; + // 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) { @@ -53410,12 +57929,13 @@ function _getVnetConnection(resourceGroupName, name, vnetName, options, callback try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -53435,7 +57955,7 @@ function _getVnetConnection(resourceGroupName, name, vnetName, options, callback parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VnetInfo']().mapper(); + let resultMapper = new client.models['VnetGateway']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -53451,31 +57971,28 @@ function _getVnetConnection(resourceGroupName, name, vnetName, options, callback } /** - * @summary Adds a Virtual Network connection to an app or slot (PUT) or - * updates the connection properties (PATCH). + * @summary Adds a gateway to a connected Virtual Network (PUT) or updates it + * (PATCH). * - * Adds a Virtual Network connection to an app or slot (PUT) or updates the - * connection properties (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 an existing Virtual Network. + * @param {string} vnetName Name of the Virtual Network. * - * @param {object} connectionEnvelope Properties of the Virtual Network - * connection. See example. + * @param {string} gatewayName Name of the gateway. Currently, the only + * supported string is "primary". * - * @param {string} [connectionEnvelope.vnetResourceId] The Virtual Network's - * resource ID. + * @param {object} connectionEnvelope The properties to update this gateway + * with. * - * @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.vnetName] The Virtual Network name. * - * @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.vpnPackageUri The URI where the VPN + * package can be downloaded. * * @param {string} [connectionEnvelope.kind] Kind of resource. * @@ -53491,13 +58008,13 @@ function _getVnetConnection(resourceGroupName, name, vnetName, 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 VnetInfo} for more information. + * 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 _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, options, callback) { +function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53507,7 +58024,6 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -53533,12 +58049,18 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec 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.'); } @@ -53548,20 +58070,21 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'; + 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(apiVersion)); + queryParameters.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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -53584,7 +58107,7 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec let requestModel = null; try { if (connectionEnvelope !== null && connectionEnvelope !== undefined) { - let requestModelMapper = new client.models['VnetInfo']().mapper(); + let requestModelMapper = new client.models['VnetGateway']().mapper(); requestModel = client.serialize(requestModelMapper, connectionEnvelope, 'connectionEnvelope'); requestContent = JSON.stringify(requestModel); } @@ -53610,12 +58133,13 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -53635,7 +58159,7 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VnetInfo']().mapper(); + let resultMapper = new client.models['VnetGateway']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -53651,18 +58175,14 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec } /** - * @summary Deletes a connection from an app (or deployment slot to a named - * virtual network. + * @summary List webjobs for an app, or a deployment slot. * - * Deletes a connection from an app (or deployment slot to a named virtual - * network. + * 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 Name of the app. - * - * @param {string} vnetName Name of the virtual network. + * @param {string} name Site name. * * @param {object} [options] Optional Parameters. * @@ -53675,13 +58195,14 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteVnetConnection(resourceGroupName, name, vnetName, options, callback) { +function _listWebJobs(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53691,7 +58212,6 @@ function _deleteVnetConnection(resourceGroupName, name, vnetName, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -53714,12 +58234,12 @@ function _deleteVnetConnection(resourceGroupName, name, vnetName, options, callb if (name === 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.'); } @@ -53729,20 +58249,19 @@ function _deleteVnetConnection(resourceGroupName, name, vnetName, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'; + 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('{vnetName}', encodeURIComponent(vnetName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -53767,7 +58286,7 @@ function _deleteVnetConnection(resourceGroupName, name, vnetName, options, callb return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -53777,12 +58296,13 @@ function _deleteVnetConnection(resourceGroupName, name, vnetName, options, callb try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -53795,39 +58315,39 @@ function _deleteVnetConnection(resourceGroupName, name, vnetName, options, callb // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Adds a Virtual Network connection to an app or slot (PUT) or - * updates the connection properties (PATCH). + * @summary Get webjob information for an app, or a deployment slot. * - * Adds a Virtual Network connection to an app or slot (PUT) or updates the - * connection properties (PATCH). + * 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 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} name Site name. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} webJobName Name of the web job. * * @param {object} [options] Optional Parameters. * @@ -53841,13 +58361,13 @@ function _deleteVnetConnection(resourceGroupName, name, vnetName, 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 VnetInfo} for more information. + * 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 _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnvelope, options, callback) { +function _getWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53857,7 +58377,6 @@ function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnve if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -53880,15 +58399,15 @@ function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnve if (name === 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 (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.'); } @@ -53898,20 +58417,20 @@ function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnve // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}'; + 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('{vnetName}', encodeURIComponent(vnetName)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -53929,21 +58448,7 @@ function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnve } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -53960,12 +58465,13 @@ function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnve try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -53985,7 +58491,7 @@ function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnve parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VnetInfo']().mapper(); + let resultMapper = new client.models['WebJob']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -54001,203 +58507,371 @@ function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnve } /** - * @summary Gets an app's Virtual Network gateway. + * @summary Creates a new web, mobile, or API app in an existing resource + * group, or updates an existing app. * - * Gets an app's Virtual Network gateway. + * 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 Name of the app. + * @param {string} name Unique name of the app to create or update. To create + * or update a deployment slot, use the {slot} parameter. * - * @param {string} vnetName Name of the Virtual Network. + * @param {object} siteEnvelope A JSON representation of the app properties. + * See example. * - * @param {string} gatewayName Name of the gateway. Currently, the only - * supported string is "primary". + * @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 {object} [options] Optional Parameters. + * @param {array} [siteEnvelope.hostNameSslStates] Hostname SSL states are used + * to manage the SSL bindings for app's hostnames. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {string} [siteEnvelope.serverFarmId] Resource ID of the associated + * App Service plan, formatted as: + * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". * - * @param {function} callback - The callback. + * @param {boolean} [siteEnvelope.reserved] true if reserved; + * otherwise, false. * - * @returns {function} callback(err, result, request, response) + * @param {boolean} [siteEnvelope.isXenon] 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 {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. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @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. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link VnetGateway} for more information. + * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service + * Environment. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @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. * - * {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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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). + * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] + * true to configure load balancing for source and destination + * app. * - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * @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} resourceGroupName Name of the resource group to which the - * resource belongs. + * @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 {string} name Name of the app. + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests * - * @param {string} vnetName Name of the Virtual Network. + * @param {object} [siteEnvelope.identity] * - * @param {string} gatewayName Name of the gateway. Currently, the only - * supported string is "primary". + * @param {string} [siteEnvelope.identity.type] Type of managed service + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' * - * @param {object} connectionEnvelope The properties to update this gateway - * with. + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * - * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * @param {string} [siteEnvelope.kind] Kind of resource. * - * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN - * package can be downloaded. + * @param {string} siteEnvelope.location Resource Location. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {object} [siteEnvelope.tags] Resource tags. * * @param {object} [options] Optional Parameters. * @@ -54211,13 +58885,13 @@ function _getVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayNam * {Error} 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. + * 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 _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, options, callback) { +function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -54227,7 +58901,6 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -54250,18 +58923,15 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, if (name === 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 (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.'); } @@ -54271,14 +58941,12 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, // 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}'; + 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('{vnetName}', encodeURIComponent(vnetName)); - requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); 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('&'); } @@ -54307,14 +58975,14 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, 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'); + 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(connectionEnvelope, null, 2)}.`); + `payload - ${JSON.stringify(siteEnvelope, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -54324,7 +58992,7 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, 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); @@ -54334,12 +59002,13 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -54359,7 +59028,7 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['VnetGateway']().mapper(); + let resultMapper = new client.models['Site']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -54369,36 +59038,81 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, 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 Adds a gateway to a connected Virtual Network (PUT) or updates it - * (PATCH). + * @summary Restores a specific backup to another app (or deployment slot, if + * specified). * - * Adds a gateway to a connected Virtual Network (PUT) or updates it (PATCH). + * 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} vnetName Name of the Virtual Network. + * @param {string} backupId ID of the backup. * - * @param {string} gatewayName Name of the gateway. Currently, the only - * supported string is "primary". + * @param {object} request Information on restore request . * - * @param {object} connectionEnvelope The properties to update this gateway - * with. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @param {string} [connectionEnvelope.vnetName] The Virtual Network name. + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @param {string} connectionEnvelope.vpnPackageUri The URI where the VPN - * package can be downloaded. + * @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} [connectionEnvelope.kind] Kind of resource. + * @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. * @@ -54411,14 +59125,13 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, * * {Error} 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [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) { +function _beginRestore(resourceGroupName, name, backupId, request, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -54428,7 +59141,6 @@ function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gateway if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -54451,18 +59163,18 @@ function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gateway if (name === 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 (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 (connectionEnvelope === null || connectionEnvelope === undefined) { - throw new Error('connectionEnvelope cannot be null or undefined.'); + 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.'); } @@ -54472,21 +59184,20 @@ function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gateway // 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}'; + 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('{vnetName}', encodeURIComponent(vnetName)); - requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); + requestUrl = requestUrl.replace('{backupId}', encodeURIComponent(backupId)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -54508,14 +59219,14 @@ function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gateway 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'); + 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(connectionEnvelope, null, 2)}.`); + `payload - ${JSON.stringify(request, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -54525,167 +59236,7 @@ function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gateway return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // 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); @@ -54703,49 +59254,30 @@ function _listWebJobs(resourceGroupName, name, options, callback) { let resultMapper = new client.models['CloudError']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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); + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred 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 webjob information for an app, or a deployment slot. + * @summary Gets the Git/FTP publishing credentials of an app. * - * Get webjob information for an app, or a deployment slot. + * 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 Site name. - * - * @param {string} webJobName Name of the web job. + * @param {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -54759,13 +59291,13 @@ function _listWebJobs(resourceGroupName, name, 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 WebJob} for more information. + * 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 _getWebJob(resourceGroupName, name, webJobName, options, callback) { +function _beginListPublishingCredentials(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -54775,7 +59307,6 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -54798,12 +59329,12 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { if (name === 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.'); } @@ -54813,20 +59344,19 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs/{webJobName}'; + 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('{webJobName}', encodeURIComponent(webJobName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -54861,12 +59391,13 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -54886,7 +59417,7 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebJob']().mapper(); + let resultMapper = new client.models['User']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -54902,387 +59433,42 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { } /** - * @summary Creates a new web, mobile, or API app in an existing resource - * group, or updates an existing app. + * @summary Invoke the MSDeploy web app extension. * - * Creates a new web, mobile, or API app in an existing resource group, or - * updates an existing app. + * Invoke the MSDeploy web app extension. * * @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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. + * @param {string} name Name of web app. * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. + * @param {object} mSDeploy Details of MSDeploy operation * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [mSDeploy.packageUri] Package URI * - * @param {string} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * @param {string} [mSDeploy.connectionString] SQL Connection String * - * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site - * to accept only https requests. Issues redirect for - * http requests + * @param {string} [mSDeploy.dbType] Database Type * - * @param {object} [siteEnvelope.identity] + * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy + * Parameters file. Must not be set if SetParameters is used. * - * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be + * set if SetParametersXmlFileUri is used. * - * @param {string} [siteEnvelope.kind] Kind of resource. + * @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 {string} siteEnvelope.location Resource Location. + * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the + * MSDeploy operation executes. + * Setting is false by default. * - * @param {object} [siteEnvelope.tags] Resource tags. + * @param {string} [mSDeploy.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -55296,13 +59482,13 @@ function _getWebJob(resourceGroupName, name, webJobName, 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 Site} for more information. + * 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 _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, callback) { +function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -55312,7 +59498,6 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -55335,12 +59520,15 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca if (name === 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 (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.'); } @@ -55350,12 +59538,12 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -55384,14 +59572,14 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca 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'); + 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(siteEnvelope, null, 2)}.`); + `payload - ${JSON.stringify(mSDeploy, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -55401,7 +59589,7 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 202) { + if (statusCode !== 201 && statusCode !== 409) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -55430,13 +59618,13 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 200) { + 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['Site']().mapper(); + let resultMapper = new client.models['MSDeployStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -55446,81 +59634,45 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca 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). + * @summary Create function for web site, or a deployment slot. * - * Restores a specific backup to another app (or deployment slot, if - * specified). + * 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 Name of the app. - * - * @param {string} backupId ID of the backup. - * - * @param {object} request Information on restore request . + * @param {string} name Site name. * - * @param {string} request.storageAccountUrl SAS URL to the container. + * @param {string} functionName Function name. * - * @param {string} [request.blobName] Name of a blob which contains the backup. + * @param {object} functionEnvelope Function details. * - * @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} [functionEnvelope.functionAppId] Function App ID. * - * @param {string} [request.siteName] Name of an app. + * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. * - * @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 {string} [functionEnvelope.scriptHref] Script URI. * - * @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 {string} [functionEnvelope.configHref] Config URI. * - * @param {boolean} [request.ignoreDatabases] Ignore the databases and only - * restore the site content + * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. * - * @param {string} [request.appServicePlan] Specify app service plan that will - * own restored site. + * @param {string} [functionEnvelope.href] Function URI. * - * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * @param {object} [functionEnvelope.config] Config information. * - * @param {boolean} [request.adjustConnectionStrings] true if - * SiteConfig.ConnectionStrings should be set in new app; otherwise, - * false. + * @param {object} [functionEnvelope.files] File list. * - * @param {string} [request.hostingEnvironment] App Service Environment name, - * if needed (only when restoring an app to an App Service Environment). + * @param {string} [functionEnvelope.testData] Test data used when testing via + * the Azure Portal. * - * @param {string} [request.kind] Kind of resource. + * @param {string} [functionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -55534,13 +59686,13 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, 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 RestoreResponse} for more information. + * 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 _beginRestore(resourceGroupName, name, backupId, request, options, callback) { +function _beginCreateFunction(resourceGroupName, name, functionName, functionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -55550,7 +59702,6 @@ function _beginRestore(resourceGroupName, name, backupId, request, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -55573,15 +59724,18 @@ function _beginRestore(resourceGroupName, name, backupId, request, options, call if (name === 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 (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 (request === null || request === undefined) { - throw new Error('request cannot be null or undefined.'); + 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.'); } @@ -55591,20 +59745,20 @@ function _beginRestore(resourceGroupName, name, backupId, request, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore'; + 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('{backupId}', encodeURIComponent(backupId)); + requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -55626,14 +59780,14 @@ function _beginRestore(resourceGroupName, name, backupId, request, options, call 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'); + 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(request, null, 2)}.`); + `payload - ${JSON.stringify(functionEnvelope, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -55643,7 +59797,7 @@ function _beginRestore(resourceGroupName, name, backupId, request, options, call return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -55653,12 +59807,13 @@ function _beginRestore(resourceGroupName, name, backupId, request, options, call try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -55672,13 +59827,13 @@ function _beginRestore(resourceGroupName, name, backupId, request, options, call let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 200) { + 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['RestoreResponse']().mapper(); + let resultMapper = new client.models['FunctionEnvelope']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -55694,14 +59849,44 @@ function _beginRestore(resourceGroupName, name, backupId, request, options, call } /** - * @summary Gets the Git/FTP publishing credentials of an app. + * @summary Invoke the MSDeploy web app extension. * - * Gets the Git/FTP publishing credentials of an app. + * Invoke the MSDeploy web app extension. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @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. * @@ -55715,13 +59900,13 @@ function _beginRestore(resourceGroupName, name, backupId, request, options, call * {Error} 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. + * 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 _beginListPublishingCredentials(resourceGroupName, name, options, callback) { +function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -55731,7 +59916,6 @@ function _beginListPublishingCredentials(resourceGroupName, name, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -55754,9 +59938,18 @@ function _beginListPublishingCredentials(resourceGroupName, name, options, callb if (name === 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.'); } @@ -55766,19 +59959,20 @@ function _beginListPublishingCredentials(resourceGroupName, name, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list'; + 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(apiVersion)); + queryParameters.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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -55796,14 +59990,28 @@ function _beginListPublishingCredentials(resourceGroupName, name, options, callb } } } - httpRequest.body = null; + // 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 !== 200) { + if (statusCode !== 201 && statusCode !== 409) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -55832,13 +60040,13 @@ function _beginListPublishingCredentials(resourceGroupName, name, options, callb let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 200) { + 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['User']().mapper(); + let resultMapper = new client.models['MSDeployStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -55854,42 +60062,33 @@ function _beginListPublishingCredentials(resourceGroupName, name, options, callb } /** - * @summary Invoke the MSDeploy web app extension. + * @summary Restores a web app. * - * Invoke the MSDeploy web app extension. + * 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} 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 {object} migrationOptions Migration migrationOptions. * - * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy - * Parameters file. Must not be set if SetParameters is used. + * @param {string} migrationOptions.azurefilesConnectionString AzureFiles + * connection string. * - * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be - * set if SetParametersXmlFileUri is used. + * @param {string} migrationOptions.azurefilesShare AzureFiles share. * - * @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} [migrationOptions.switchSiteAfterMigration] + * trueif the app should be switched over; otherwise, + * false. * - * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the - * MSDeploy operation executes. - * Setting is false by default. + * @param {boolean} [migrationOptions.blockWriteAccessToSite] true + * if the app should be read only during copy operation; otherwise, + * false. * - * @param {string} [mSDeploy.kind] Kind of resource. + * @param {string} [migrationOptions.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -55903,13 +60102,14 @@ function _beginListPublishingCredentials(resourceGroupName, name, 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 MSDeployStatus} for more information. + * 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 _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, options, callback) { +function _beginMigrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -55919,9 +60119,11 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // 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.'); } @@ -55942,12 +60144,15 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, option if (name === 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 (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.'); } @@ -55957,12 +60162,13 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, option // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'; + 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('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('subscriptionName=' + encodeURIComponent(subscriptionName)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -55991,14 +60197,14 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, option 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'); + 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(mSDeploy, null, 2)}.`); + `payload - ${JSON.stringify(migrationOptions, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -56008,7 +60214,7 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, option return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 409) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -56018,12 +60224,13 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, option try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -56037,13 +60244,13 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, option let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (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(); + let resultMapper = new client.models['StorageMigrationResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -56059,37 +60266,26 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, option } /** - * @summary Create function for web site, or a deployment slot. + * @summary Migrates a local (in-app) MySql database to a remote MySql + * database. * - * Create function for web site, or a deployment slot. + * 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 Site name. - * - * @param {string} functionName Function name. - * - * @param {object} functionEnvelope Function details. - * - * @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 {string} name Name of web app. * - * @param {object} [functionEnvelope.config] Config information. + * @param {object} migrationRequestEnvelope MySql migration options. * - * @param {object} [functionEnvelope.files] File list. + * @param {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. * - * @param {string} [functionEnvelope.testData] Test data used when testing via - * the Azure Portal. + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' * - * @param {string} [functionEnvelope.kind] Kind of resource. + * @param {string} [migrationRequestEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -56103,13 +60299,13 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, 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 FunctionEnvelope} for more information. + * 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 _beginCreateFunction(resourceGroupName, name, functionName, functionEnvelope, options, callback) { +function _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -56119,7 +60315,6 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -56142,15 +60337,15 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv if (name === 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 (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.'); } @@ -56160,20 +60355,19 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'; + 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('{functionName}', encodeURIComponent(functionName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -56195,14 +60389,14 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv 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'); + 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(functionEnvelope, null, 2)}.`); + `payload - ${JSON.stringify(migrationRequestEnvelope, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -56212,7 +60406,7 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -56222,12 +60416,13 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -56241,13 +60436,13 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (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(); + let resultMapper = new client.models['Operation']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -56263,44 +60458,54 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv } /** - * @summary Invoke the MSDeploy web app extension. + * @summary Restores an app from a backup blob in Azure Storage. * - * Invoke the MSDeploy web app extension. + * 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 web app. + * @param {string} name Name of the app. * - * @param {string} instanceId ID of web app instance. + * @param {object} request Information on restore request . * - * @param {object} mSDeploy Details of MSDeploy operation + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @param {string} [mSDeploy.packageUri] Package URI + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @param {string} [mSDeploy.connectionString] SQL Connection String + * @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} [mSDeploy.dbType] Database Type + * @param {string} [request.siteName] Name of an app. * - * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy - * Parameters file. Must not be set if SetParameters is used. + * @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 {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be - * set if SetParametersXmlFileUri is used. + * @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} [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} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the - * MSDeploy operation executes. - * Setting is false by default. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * @param {string} [mSDeploy.kind] Kind of resource. + * @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. * @@ -56313,14 +60518,13 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv * * {Error} 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [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) { +function _beginRestoreFromBackupBlob(resourceGroupName, name, request, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -56330,7 +60534,6 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -56353,15 +60556,15 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance if (name === 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 (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.'); } @@ -56371,20 +60574,19 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance // 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'; + 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('{instanceId}', encodeURIComponent(instanceId)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -56406,14 +60608,14 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance 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'); + 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(mSDeploy, null, 2)}.`); + `payload - ${JSON.stringify(request, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -56423,7 +60625,7 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 409) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -56451,56 +60653,35 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance // 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. + * @summary Restores a deleted web app to this web app. * - * @param {string} subscriptionName Azure subscription. + * 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} migrationOptions Migration migrationOptions. - * - * @param {string} migrationOptions.azurefilesConnectionString AzureFiles - * connection string. + * @param {object} restoreRequest Deleted web app restore information. * - * @param {string} migrationOptions.azurefilesShare AzureFiles share. + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} * - * @param {boolean} [migrationOptions.switchSiteAfterMigration] - * trueif the app should be switched over; otherwise, - * false. + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. * - * @param {boolean} [migrationOptions.blockWriteAccessToSite] true - * if the app should be read only during copy operation; otherwise, - * false. + * @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} [migrationOptions.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -56513,15 +60694,13 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance * * {Error} 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [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) { +function _beginRestoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -56531,12 +60710,8 @@ function _beginMigrateStorage(subscriptionName, resourceGroupName, name, migrati if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // 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.'); } @@ -56557,201 +60732,14 @@ function _beginMigrateStorage(subscriptionName, resourceGroupName, name, migrati if (name === 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 (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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.'); @@ -56762,12 +60750,12 @@ function _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, o // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -56796,14 +60784,14 @@ function _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, o 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'); + 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(migrationRequestEnvelope, null, 2)}.`); + `payload - ${JSON.stringify(restoreRequest, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -56813,7 +60801,7 @@ function _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, o 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); @@ -56841,69 +60829,53 @@ function _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, 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['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 Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -56922,7 +60894,7 @@ function _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, o * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginRecover(resourceGroupName, name, recoveryEntity, options, callback) { +function _beginRestoreSnapshot(resourceGroupName, name, restoreRequest, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -56932,7 +60904,6 @@ function _beginRecover(resourceGroupName, name, recoveryEntity, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -56955,12 +60926,15 @@ function _beginRecover(resourceGroupName, name, recoveryEntity, options, callbac if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (recoveryEntity === null || recoveryEntity === undefined) { - throw new Error('recoveryEntity cannot be null or undefined.'); + 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.'); } @@ -56970,12 +60944,12 @@ function _beginRecover(resourceGroupName, name, recoveryEntity, options, callbac // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/recover'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -57004,14 +60978,14 @@ function _beginRecover(resourceGroupName, name, recoveryEntity, options, callbac let requestContent = null; let requestModel = null; try { - if (recoveryEntity !== null && recoveryEntity !== undefined) { - let requestModelMapper = new client.models['SnapshotRecoveryRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, recoveryEntity, 'recoveryEntity'); + 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(recoveryEntity, null, 2)}.`); + `payload - ${JSON.stringify(restoreRequest, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -57094,7 +61068,6 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -57123,6 +61096,9 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -57138,7 +61114,7 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op requestUrl = requestUrl.replace('{siteExtensionId}', encodeURIComponent(siteExtensionId)); 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('&'); } @@ -57267,6 +61243,8 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -57285,6 +61263,9 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op * @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. @@ -57483,6 +61464,12 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op * @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. * @@ -57493,6 +61480,13 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op * 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. @@ -57568,43 +61562,6 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -57612,7 +61569,10 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -57625,19 +61585,6 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -57664,11 +61611,6 @@ function _beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, o if (!callback) { throw new Error('callback cannot be null.'); } - let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; - let skipCustomDomainVerification = (options && options.skipCustomDomainVerification !== undefined) ? options.skipCustomDomainVerification : undefined; - let forceDnsRegistration = (options && options.forceDnsRegistration !== undefined) ? options.forceDnsRegistration : undefined; - let ttlInSeconds = (options && options.ttlInSeconds !== undefined) ? options.ttlInSeconds : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -57697,21 +61639,12 @@ function _beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, o if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { - throw new Error('skipDnsRegistration must be of type boolean.'); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined && typeof skipCustomDomainVerification !== 'boolean') { - throw new Error('skipCustomDomainVerification must be of type boolean.'); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined && typeof forceDnsRegistration !== 'boolean') { - throw new Error('forceDnsRegistration must be of type boolean.'); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined && typeof ttlInSeconds.valueOf() !== 'string') { - throw new Error('ttlInSeconds must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -57727,19 +61660,7 @@ function _beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, o requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { - queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined) { - queryParameters.push('skipCustomDomainVerification=' + encodeURIComponent(skipCustomDomainVerification.toString())); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined) { - queryParameters.push('forceDnsRegistration=' + encodeURIComponent(forceDnsRegistration.toString())); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined) { - queryParameters.push('ttlInSeconds=' + encodeURIComponent(ttlInSeconds)); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -57795,12 +61716,13 @@ function _beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, o try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -57895,7 +61817,7 @@ function _beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, o * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -57920,8 +61842,7 @@ function _beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, 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 RestoreResponse} 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. * @@ -57937,7 +61858,6 @@ function _beginRestoreSlot(resourceGroupName, name, backupId, request, slot, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -57972,6 +61892,9 @@ function _beginRestoreSlot(resourceGroupName, name, backupId, request, slot, opt if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -57988,7 +61911,7 @@ function _beginRestoreSlot(resourceGroupName, name, backupId, request, slot, opt requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -58034,7 +61957,7 @@ function _beginRestoreSlot(resourceGroupName, name, backupId, request, slot, opt 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); @@ -58062,23 +61985,6 @@ function _beginRestoreSlot(resourceGroupName, name, backupId, request, slot, opt // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RestoreResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } return callback(null, result, httpRequest, response); }); @@ -58126,7 +62032,6 @@ function _beginListPublishingCredentialsSlot(resourceGroupName, name, slot, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58155,6 +62060,9 @@ function _beginListPublishingCredentialsSlot(resourceGroupName, name, slot, opti if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -58170,7 +62078,7 @@ function _beginListPublishingCredentialsSlot(resourceGroupName, name, slot, opti requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -58212,12 +62120,13 @@ function _beginListPublishingCredentialsSlot(resourceGroupName, name, slot, opti try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -58321,7 +62230,6 @@ function _beginCreateMSDeployOperationSlot(resourceGroupName, name, slot, mSDepl if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58353,6 +62261,9 @@ function _beginCreateMSDeployOperationSlot(resourceGroupName, name, slot, mSDepl if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -58368,7 +62279,7 @@ function _beginCreateMSDeployOperationSlot(resourceGroupName, name, slot, mSDepl requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -58481,6 +62392,8 @@ function _beginCreateMSDeployOperationSlot(resourceGroupName, name, slot, mSDepl * * @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. @@ -58528,7 +62441,6 @@ function _beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58563,6 +62475,9 @@ function _beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -58579,7 +62494,7 @@ function _beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -58626,6 +62541,227 @@ function _beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, } 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); @@ -58660,7 +62796,7 @@ function _beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionEnvelope']().mapper(); + let resultMapper = new client.models['MSDeployStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -58676,47 +62812,57 @@ function _beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, } /** - * @summary Invoke the MSDeploy web app extension. + * @summary Restores an app from a backup blob in Azure Storage. * - * Invoke the MSDeploy web app extension. + * 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 web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @param {object} request Information on restore request . * - * @param {string} instanceId ID of web app instance. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @param {object} mSDeploy Details of MSDeploy operation + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @param {string} [mSDeploy.packageUri] Package URI + * @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} [mSDeploy.connectionString] SQL Connection String + * @param {string} [request.siteName] Name of an app. * - * @param {string} [mSDeploy.dbType] Database Type + * @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 {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy - * Parameters file. Must not be set if SetParameters is used. + * @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 {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be - * set if SetParametersXmlFileUri is used. + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * @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 {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the - * MSDeploy operation executes. - * Setting is false by default. + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * - * @param {string} [mSDeploy.kind] Kind of resource. + * @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. * @@ -58729,14 +62875,13 @@ function _beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, * * {Error} 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [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) { +function _beginRestoreFromBackupBlobSlot(resourceGroupName, name, request, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -58746,7 +62891,6 @@ function _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58769,18 +62913,18 @@ function _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot if (name === 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 (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.'); } @@ -58790,21 +62934,20 @@ function _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot // 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'; + 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('{instanceId}', encodeURIComponent(instanceId)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -58826,14 +62969,14 @@ function _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot 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'); + 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(mSDeploy, null, 2)}.`); + `payload - ${JSON.stringify(request, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -58843,7 +62986,7 @@ function _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 409) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -58871,69 +63014,236 @@ function _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 201) { - let parsedResponse = 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 { - 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'); + parsedErrorResponse = JSON.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); }); } /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will * default to production slot. @@ -58955,7 +63265,7 @@ function _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, callback) { +function _beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -58965,7 +63275,6 @@ function _beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58988,8 +63297,8 @@ function _beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, option if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (recoveryEntity === null || recoveryEntity === undefined) { - throw new Error('recoveryEntity cannot be null or undefined.'); + 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.'); @@ -58997,6 +63306,9 @@ function _beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, option if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -59006,13 +63318,13 @@ function _beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, option // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/recover'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -59041,14 +63353,14 @@ function _beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, option let requestContent = null; let requestModel = null; try { - if (recoveryEntity !== null && recoveryEntity !== undefined) { - let requestModelMapper = new client.models['SnapshotRecoveryRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, recoveryEntity, 'recoveryEntity'); + 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(recoveryEntity, null, 2)}.`); + `payload - ${JSON.stringify(restoreRequest, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -59134,7 +63446,6 @@ function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -59166,6 +63477,9 @@ function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -59182,7 +63496,7 @@ function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -59330,7 +63644,6 @@ function _beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -59362,6 +63675,9 @@ function _beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, optio if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -59377,7 +63693,7 @@ function _beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, optio requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -59520,7 +63836,6 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -59552,6 +63867,9 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -59567,7 +63885,7 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -59623,12 +63941,13 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -59743,7 +64062,6 @@ function _beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -59772,6 +64090,9 @@ function _beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, o if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -59786,7 +64107,7 @@ function _beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, o requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -59925,7 +64246,6 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -59954,6 +64274,9 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -59968,7 +64291,7 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -60024,12 +64347,13 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -60187,12 +64511,13 @@ function _listNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -60316,12 +64641,13 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -60445,12 +64771,13 @@ function _listBackupsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -60575,12 +64902,13 @@ function _listConfigurationsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -60707,12 +65035,13 @@ function _listConfigurationSnapshotInfoNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -60837,12 +65166,13 @@ function _listContinuousWebJobsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -60966,12 +65296,13 @@ function _listDeploymentsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -61095,12 +65426,13 @@ function _listDomainOwnershipIdentifiersNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -61355,12 +65687,13 @@ function _listHostNameBindingsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -61485,12 +65818,13 @@ function _listInstanceIdentifiersNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -62011,12 +66345,13 @@ function _listMetricDefinitionsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -62142,12 +66477,13 @@ function _listMetricsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -62272,12 +66608,13 @@ function _listPerfMonCountersNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -62797,12 +67134,13 @@ function _listPublicCertificatesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -63056,12 +67394,13 @@ function _listSlotsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -63185,12 +67524,13 @@ function _listBackupsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -63315,12 +67655,13 @@ function _listConfigurationsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -63447,12 +67788,13 @@ function _listConfigurationSnapshotInfoSlotNext(nextPageLink, options, callback) try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -63577,12 +67919,13 @@ function _listContinuousWebJobsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -63706,12 +68049,13 @@ function _listDeploymentsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -63835,12 +68179,13 @@ function _listDomainOwnershipIdentifiersSlotNext(nextPageLink, options, callback try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -64095,12 +68440,13 @@ function _listHostNameBindingsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -64225,12 +68571,13 @@ function _listInstanceIdentifiersSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -64751,12 +69098,13 @@ function _listMetricDefinitionsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -64882,12 +69230,13 @@ function _listMetricsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -65012,12 +69361,13 @@ function _listPerfMonCountersSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -65537,12 +69887,13 @@ function _listPublicCertificatesSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -65798,12 +70149,13 @@ function _listSlotDifferencesSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -65927,12 +70279,13 @@ function _listSnapshotsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -66057,12 +70410,13 @@ function _listTriggeredWebJobsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -66320,12 +70674,13 @@ function _listUsagesSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -66449,12 +70804,13 @@ function _listWebJobsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -66580,12 +70936,13 @@ function _listSlotDifferencesFromProductionNext(nextPageLink, options, callback) try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -66709,12 +71066,13 @@ function _listSnapshotsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -66839,12 +71197,13 @@ function _listTriggeredWebJobsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -67102,12 +71461,13 @@ function _listUsagesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -67231,12 +71591,13 @@ function _listWebJobsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -67289,7 +71650,6 @@ class WebApps { this._applySlotConfigToProduction = _applySlotConfigToProduction; this._backup = _backup; this._listBackups = _listBackups; - this._discoverRestore = _discoverRestore; this._getBackupStatus = _getBackupStatus; this._deleteBackup = _deleteBackup; this._listBackupStatusSecrets = _listBackupStatusSecrets; @@ -67313,6 +71673,10 @@ class WebApps { 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; @@ -67320,7 +71684,7 @@ class WebApps { this._getConfigurationSnapshot = _getConfigurationSnapshot; this._recoverSiteConfigurationSnapshot = _recoverSiteConfigurationSnapshot; this._getWebSiteContainerLogs = _getWebSiteContainerLogs; - this._getWebSiteContainerLogsZip = _getWebSiteContainerLogsZip; + this._getContainerLogsZip = _getContainerLogsZip; this._listContinuousWebJobs = _listContinuousWebJobs; this._getContinuousWebJob = _getContinuousWebJob; this._deleteContinuousWebJob = _deleteContinuousWebJob; @@ -67331,6 +71695,7 @@ class WebApps { this._createDeployment = _createDeployment; this._deleteDeployment = _deleteDeployment; this._listDeploymentLog = _listDeploymentLog; + this._discoverBackup = _discoverBackup; this._listDomainOwnershipIdentifiers = _listDomainOwnershipIdentifiers; this._getDomainOwnershipIdentifier = _getDomainOwnershipIdentifier; this._createOrUpdateDomainOwnershipIdentifier = _createOrUpdateDomainOwnershipIdentifier; @@ -67389,6 +71754,9 @@ class WebApps { 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; @@ -67402,9 +71770,11 @@ class WebApps { this._createOrUpdatePublicCertificate = _createOrUpdatePublicCertificate; this._deletePublicCertificate = _deletePublicCertificate; this._listPublishingProfileXmlWithSecrets = _listPublishingProfileXmlWithSecrets; - this._recover = _recover; this._resetProductionSlotConfig = _resetProductionSlotConfig; this._restart = _restart; + this._restoreFromBackupBlob = _restoreFromBackupBlob; + this._restoreFromDeletedApp = _restoreFromDeletedApp; + this._restoreSnapshot = _restoreSnapshot; this._listSiteExtensions = _listSiteExtensions; this._getSiteExtension = _getSiteExtension; this._installSiteExtension = _installSiteExtension; @@ -67418,7 +71788,6 @@ class WebApps { this._applySlotConfigurationSlot = _applySlotConfigurationSlot; this._backupSlot = _backupSlot; this._listBackupsSlot = _listBackupsSlot; - this._discoverRestoreSlot = _discoverRestoreSlot; this._getBackupStatusSlot = _getBackupStatusSlot; this._deleteBackupSlot = _deleteBackupSlot; this._listBackupStatusSecretsSlot = _listBackupStatusSecretsSlot; @@ -67440,6 +71809,10 @@ class WebApps { 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; @@ -67447,7 +71820,7 @@ class WebApps { this._getConfigurationSnapshotSlot = _getConfigurationSnapshotSlot; this._recoverSiteConfigurationSnapshotSlot = _recoverSiteConfigurationSnapshotSlot; this._getWebSiteContainerLogsSlot = _getWebSiteContainerLogsSlot; - this._getWebSiteContainerLogsZipSlot = _getWebSiteContainerLogsZipSlot; + this._getContainerLogsZipSlot = _getContainerLogsZipSlot; this._listContinuousWebJobsSlot = _listContinuousWebJobsSlot; this._getContinuousWebJobSlot = _getContinuousWebJobSlot; this._deleteContinuousWebJobSlot = _deleteContinuousWebJobSlot; @@ -67458,6 +71831,7 @@ class WebApps { this._createDeploymentSlot = _createDeploymentSlot; this._deleteDeploymentSlot = _deleteDeploymentSlot; this._listDeploymentLogSlot = _listDeploymentLogSlot; + this._discoverBackupSlot = _discoverBackupSlot; this._listDomainOwnershipIdentifiersSlot = _listDomainOwnershipIdentifiersSlot; this._getDomainOwnershipIdentifierSlot = _getDomainOwnershipIdentifierSlot; this._createOrUpdateDomainOwnershipIdentifierSlot = _createOrUpdateDomainOwnershipIdentifierSlot; @@ -67514,6 +71888,9 @@ class WebApps { 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; @@ -67527,9 +71904,11 @@ class WebApps { this._createOrUpdatePublicCertificateSlot = _createOrUpdatePublicCertificateSlot; this._deletePublicCertificateSlot = _deletePublicCertificateSlot; this._listPublishingProfileXmlWithSecretsSlot = _listPublishingProfileXmlWithSecretsSlot; - this._recoverSlot = _recoverSlot; this._resetSlotConfigurationSlot = _resetSlotConfigurationSlot; this._restartSlot = _restartSlot; + this._restoreFromBackupBlobSlot = _restoreFromBackupBlobSlot; + this._restoreFromDeletedAppSlot = _restoreFromDeletedAppSlot; + this._restoreSnapshotSlot = _restoreSnapshotSlot; this._listSiteExtensionsSlot = _listSiteExtensionsSlot; this._getSiteExtensionSlot = _getSiteExtensionSlot; this._installSiteExtensionSlot = _installSiteExtensionSlot; @@ -67598,7 +71977,9 @@ class WebApps { this._beginCreateInstanceMSDeployOperation = _beginCreateInstanceMSDeployOperation; this._beginMigrateStorage = _beginMigrateStorage; this._beginMigrateMySql = _beginMigrateMySql; - this._beginRecover = _beginRecover; + this._beginRestoreFromBackupBlob = _beginRestoreFromBackupBlob; + this._beginRestoreFromDeletedApp = _beginRestoreFromDeletedApp; + this._beginRestoreSnapshot = _beginRestoreSnapshot; this._beginInstallSiteExtension = _beginInstallSiteExtension; this._beginCreateOrUpdateSlot = _beginCreateOrUpdateSlot; this._beginRestoreSlot = _beginRestoreSlot; @@ -67606,7 +71987,9 @@ class WebApps { this._beginCreateMSDeployOperationSlot = _beginCreateMSDeployOperationSlot; this._beginCreateInstanceFunctionSlot = _beginCreateInstanceFunctionSlot; this._beginCreateInstanceMSDeployOperationSlot = _beginCreateInstanceMSDeployOperationSlot; - this._beginRecoverSlot = _beginRecoverSlot; + this._beginRestoreFromBackupBlobSlot = _beginRestoreFromBackupBlobSlot; + this._beginRestoreFromDeletedAppSlot = _beginRestoreFromDeletedAppSlot; + this._beginRestoreSnapshotSlot = _beginRestoreSnapshotSlot; this._beginInstallSiteExtensionSlot = _beginInstallSiteExtensionSlot; this._beginSwapSlotSlot = _beginSwapSlotSlot; this._beginCreateOrUpdateSourceControlSlot = _beginCreateOrUpdateSourceControlSlot; @@ -67969,6 +72352,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -67987,6 +72372,9 @@ class WebApps { * @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. @@ -68185,6 +72573,12 @@ class WebApps { * @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. * @@ -68195,6 +72589,13 @@ class WebApps { * 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. @@ -68270,43 +72671,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -68314,7 +72678,10 @@ class WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -68377,6 +72744,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -68395,6 +72764,9 @@ class WebApps { * @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. @@ -68593,6 +72965,12 @@ class WebApps { * @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. * @@ -68603,6 +72981,13 @@ class WebApps { * 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. @@ -68678,43 +73063,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -68722,7 +73070,10 @@ class WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -68914,6 +73265,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -68932,6 +73285,9 @@ class WebApps { * @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. @@ -69130,6 +73486,12 @@ class WebApps { * @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. * @@ -69140,6 +73502,13 @@ class WebApps { * 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. @@ -69215,43 +73584,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -69313,6 +73645,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -69331,6 +73665,9 @@ class WebApps { * @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. @@ -69529,6 +73866,12 @@ class WebApps { * @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. * @@ -69539,6 +73882,13 @@ class WebApps { * 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. @@ -69614,43 +73964,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -69927,8 +74240,6 @@ class WebApps { * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName 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. @@ -69959,9 +74270,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -70002,8 +74310,6 @@ class WebApps { * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName 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. @@ -70034,9 +74340,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -70178,184 +74481,6 @@ class WebApps { } } - /** - * @summary Discovers an existing app backup that can be restored from a blob - * in Azure storage. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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. - */ - discoverRestoreWithHttpOperationResponse(resourceGroupName, name, request, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._discoverRestore(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. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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. - */ - discoverRestore(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._discoverRestore(resourceGroupName, name, request, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._discoverRestore(resourceGroupName, name, request, options, optionalCallback); - } - } - /** * @summary Gets a backup of an app by its ID. * @@ -70567,8 +74692,6 @@ class WebApps { * * @param {object} request Information on backup request. * - * @param {string} request.backupRequestName 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. @@ -70599,9 +74722,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -70649,8 +74769,6 @@ class WebApps { * * @param {object} request Information on backup request. * - * @param {string} request.backupRequestName 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. @@ -70681,9 +74799,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -70776,7 +74891,7 @@ class WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -70794,7 +74909,7 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -70855,7 +74970,7 @@ class WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -70878,7 +74993,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {RestoreResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -70886,8 +75001,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} 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. * @@ -71277,6 +75391,9 @@ class WebApps { * 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 @@ -71455,6 +75572,9 @@ class WebApps { * 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 @@ -71684,8 +75804,6 @@ class WebApps { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName 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. @@ -71716,9 +75834,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -71758,8 +75873,6 @@ class WebApps { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName 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. @@ -71790,9 +75903,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -73172,7 +77282,126 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listSlotConfigurationNames(resourceGroupName, name, options, optionalCallback) { + 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 {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 {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') { @@ -73181,39 +77410,136 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listSlotConfigurationNames(resourceGroupName, name, options, (err, result, request, response) => { + self._updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listSlotConfigurationNames(resourceGroupName, name, options, optionalCallback); + return self._updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, options, optionalCallback); } } /** - * @summary Updates the names of application settings and connection string - * that remain with the slot during swap operation. + * @summary Gets a Swift Virtual Network connection. * - * Updates the names of application settings and connection string that remain - * with the slot during swap operation. + * 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} slotConfigNames Names of application settings and connection - * strings. See example. + * @param {object} [options] Optional Parameters. * - * @param {array} [slotConfigNames.connectionStringNames] List of connection - * string names. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} [slotConfigNames.appSettingNames] List of application - * settings names. + * @returns {Promise} A promise is returned * - * @param {string} [slotConfigNames.kind] Kind of resource. + * @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. * @@ -73222,15 +77548,15 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - updateSlotConfigurationNamesWithHttpOperationResponse(resourceGroupName, name, slotConfigNames, options) { + createOrUpdateSwiftVirtualNetworkConnectionWithHttpOperationResponse(resourceGroupName, name, connectionEnvelope, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, options, (err, result, request, response) => { + self._createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -73241,27 +77567,32 @@ class WebApps { } /** - * @summary Updates the names of application settings and connection string - * that remain with the slot during swap operation. + * @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. * - * Updates the names of application settings and connection string that remain - * with the slot during swap operation. + * 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} slotConfigNames Names of application settings and connection - * strings. See example. + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. * - * @param {array} [slotConfigNames.connectionStringNames] List of connection - * string names. + * @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 {array} [slotConfigNames.appSettingNames] List of application - * settings names. + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. * - * @param {string} [slotConfigNames.kind] Kind of resource. + * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -73275,7 +77606,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {SlotConfigNamesResource} - The deserialized result object. + * @resolve {SwiftVirtualNetwork} - The deserialized result object. * * @reject {Error} - The error object. * @@ -73284,14 +77615,13 @@ class WebApps { * {Error} 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. + * 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. */ - updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, options, optionalCallback) { + createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -73300,14 +77630,235 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, options, (err, result, request, response) => { + self._createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, options, optionalCallback); + 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); } } @@ -73434,6 +77985,9 @@ class WebApps { * * @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. * @@ -73611,6 +78165,12 @@ class WebApps { * @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 @@ -73620,6 +78180,13 @@ class WebApps { * 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. @@ -73674,6 +78241,9 @@ class WebApps { * * @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. * @@ -73851,6 +78421,12 @@ class WebApps { * @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 @@ -73860,6 +78436,13 @@ class WebApps { * 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. @@ -73936,6 +78519,9 @@ class WebApps { * * @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. * @@ -74113,6 +78699,12 @@ class WebApps { * @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 @@ -74122,6 +78714,13 @@ class WebApps { * 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. @@ -74176,6 +78775,9 @@ class WebApps { * * @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. * @@ -74353,6 +78955,12 @@ class WebApps { * @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 @@ -74362,6 +78970,13 @@ class WebApps { * 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. @@ -74813,11 +79428,11 @@ class WebApps { * * @reject {Error} - The error object. */ - getWebSiteContainerLogsZipWithHttpOperationResponse(resourceGroupName, name, options) { + getContainerLogsZipWithHttpOperationResponse(resourceGroupName, name, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getWebSiteContainerLogsZip(resourceGroupName, name, options, (err, result, request, response) => { + self._getContainerLogsZip(resourceGroupName, name, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -74863,7 +79478,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getWebSiteContainerLogsZip(resourceGroupName, name, options, optionalCallback) { + getContainerLogsZip(resourceGroupName, name, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -74872,14 +79487,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getWebSiteContainerLogsZip(resourceGroupName, name, options, (err, result, request, response) => { + self._getContainerLogsZip(resourceGroupName, name, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getWebSiteContainerLogsZip(resourceGroupName, name, options, optionalCallback); + return self._getContainerLogsZip(resourceGroupName, name, options, optionalCallback); } } @@ -75529,7 +80144,348 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getDeployment(resourceGroupName, name, id, options, optionalCallback) { + 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') { @@ -75538,174 +80494,70 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployment(resourceGroupName, name, id, options, (err, result, request, response) => { + self._listDeploymentLog(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); + return self._listDeploymentLog(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 {string} [deployment.deploymentId] Identifier for deployment. - * - * @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. + * @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. * - * Create a deployment for an app, or a deployment slot. + * 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 {string} id ID of an existing deployment. - * - * @param {object} deployment Deployment details. - * - * @param {string} [deployment.deploymentId] Identifier for deployment. - * - * @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. + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. * - * {Promise} A promise is returned + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @resolve {Deployment} - The deserialized result object. + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @reject {Error} - The error object. + * @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. * - * {function} optionalCallback(err, result, request, response) + * @param {string} [request.siteName] Name of an app. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Deployment} for more information. + * @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. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * {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. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * Delete a deployment by its ID for an app, or a deployment slot. + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. * - * @param {string} name Name of the app. + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). * - * @param {string} id Deployment ID. + * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -75714,15 +80566,15 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - deleteDeploymentWithHttpOperationResponse(resourceGroupName, name, id, options) { + discoverBackupWithHttpOperationResponse(resourceGroupName, name, request, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteDeployment(resourceGroupName, name, id, options, (err, result, request, response) => { + self._discoverBackup(resourceGroupName, name, request, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -75733,119 +80585,58 @@ class WebApps { } /** - * @summary Delete a deployment by its ID for an app, or a deployment slot. + * @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. * - * Delete a deployment by its ID for an app, or a deployment slot. + * 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 {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 {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @param {string} name Name of the app. + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @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 {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 {object} [options] Optional Parameters. + * @param {string} [request.siteName] Name of an app. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. * - * @returns {Promise} A promise is returned + * @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. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * @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. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * List deployment log for specific deployment for an app, or a deployment - * slot. + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. * - * @param {string} name Name of the app. + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). * - * @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} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -75859,7 +80650,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Deployment} - The deserialized result object. + * @resolve {RestoreRequest} - The deserialized result object. * * @reject {Error} - The error object. * @@ -75868,13 +80659,13 @@ class WebApps { * {Error} 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. + * 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. */ - listDeploymentLog(resourceGroupName, name, id, options, optionalCallback) { + discoverBackup(resourceGroupName, name, request, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -75883,14 +80674,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listDeploymentLog(resourceGroupName, name, id, options, (err, result, request, response) => { + self._discoverBackup(resourceGroupName, name, request, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listDeploymentLog(resourceGroupName, name, id, options, optionalCallback); + return self._discoverBackup(resourceGroupName, name, request, options, optionalCallback); } } @@ -77045,6 +81836,8 @@ class WebApps { * * @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. @@ -77103,6 +81896,8 @@ class WebApps { * * @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. @@ -81911,12 +86706,6 @@ class WebApps { * * @param {string} [premierAddOn.vendor] Premier add on Vendor. * - * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * * @param {string} [premierAddOn.marketplacePublisher] Premier add on * Marketplace publisher. * @@ -81975,12 +86764,6 @@ class WebApps { * * @param {string} [premierAddOn.vendor] Premier add on Vendor. * - * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * * @param {string} [premierAddOn.marketplacePublisher] Premier add on * Marketplace publisher. * @@ -82135,6 +86918,346 @@ class WebApps { } } + /** + * @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. @@ -83449,46 +88572,402 @@ class WebApps { } /** - * @summary Recovers a web app to a previous snapshot. + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * Recovers a web app to a previous snapshot. + * 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 web app. + * @param {string} name Name of the app. * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} [options] Optional Parameters. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @returns {Promise} A promise is returned * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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. + * @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. * - * @param {boolean} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. + * Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {boolean} [recoveryEntity.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} 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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -83501,11 +88980,11 @@ class WebApps { * * @reject {Error} - The error object. */ - recoverWithHttpOperationResponse(resourceGroupName, name, recoveryEntity, options) { + restoreFromDeletedAppWithHttpOperationResponse(resourceGroupName, name, restoreRequest, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._recover(resourceGroupName, name, recoveryEntity, options, (err, result, request, response) => { + self._restoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -83516,46 +88995,29 @@ class WebApps { } /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores a deleted web app to this web app. * - * Recovers a web app to a previous snapshot. + * 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Deleted web app restore information. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @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} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -83583,7 +89045,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - recover(resourceGroupName, name, recoveryEntity, options, optionalCallback) { + restoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -83592,132 +89054,62 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._recover(resourceGroupName, name, recoveryEntity, options, (err, result, request, response) => { + self._restoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._recover(resourceGroupName, name, recoveryEntity, options, optionalCallback); + return self._restoreFromDeletedApp(resourceGroupName, name, restoreRequest, 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. + * @summary Restores a web app from a snapshot. * - * Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * 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 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 + * @param {string} name Name of web app. * - * @resolve {null} - The deserialized result object. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @reject {Error} - The error object. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * {function} optionalCallback(err, result, request, response) + * @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. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. + * @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. * - * {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). + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. * - * Restarts an app (or deployment slot, if specified). + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @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} name Name of the app. + * @param {string} [restoreRequest.kind] Kind of resource. * * @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 * @@ -83727,11 +89119,11 @@ class WebApps { * * @reject {Error} - The error object. */ - restartWithHttpOperationResponse(resourceGroupName, name, options) { + restoreSnapshotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._restart(resourceGroupName, name, options, (err, result, request, response) => { + self._restoreSnapshot(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -83742,24 +89134,49 @@ class WebApps { } /** - * @summary Restarts an app (or deployment slot, if specified). + * @summary Restores a web app from a snapshot. * - * Restarts an app (or deployment slot, if specified). + * 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 the app. + * @param {string} name Name of web app. * - * @param {object} [options] Optional Parameters. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @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 {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @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} [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 @@ -83785,7 +89202,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - restart(resourceGroupName, name, options, optionalCallback) { + restoreSnapshot(resourceGroupName, name, restoreRequest, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -83794,14 +89211,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._restart(resourceGroupName, name, options, (err, result, request, response) => { + self._restoreSnapshot(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._restart(resourceGroupName, name, options, optionalCallback); + return self._restoreSnapshot(resourceGroupName, name, restoreRequest, options, optionalCallback); } } @@ -84409,6 +89826,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -84427,6 +89846,9 @@ class WebApps { * @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. @@ -84625,6 +90047,12 @@ class WebApps { * @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. * @@ -84635,6 +90063,13 @@ class WebApps { * 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. @@ -84710,43 +90145,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -84754,7 +90152,10 @@ class WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -84767,19 +90168,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -84833,6 +90221,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -84851,6 +90241,9 @@ class WebApps { * @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. @@ -85049,6 +90442,12 @@ class WebApps { * @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. * @@ -85059,6 +90458,13 @@ class WebApps { * 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. @@ -85134,43 +90540,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -85178,7 +90547,10 @@ class WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -85191,19 +90563,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -85272,9 +90631,6 @@ class WebApps { * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -85321,9 +90677,6 @@ class WebApps { * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -85398,6 +90751,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -85416,6 +90771,9 @@ class WebApps { * @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. @@ -85614,6 +90972,12 @@ class WebApps { * @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. * @@ -85624,6 +90988,13 @@ class WebApps { * 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. @@ -85699,43 +91070,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -85747,19 +91081,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -85813,6 +91134,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -85831,6 +91154,9 @@ class WebApps { * @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. @@ -86029,6 +91355,12 @@ class WebApps { * @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. * @@ -86039,6 +91371,13 @@ class WebApps { * 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. @@ -86114,43 +91453,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -86162,19 +91464,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -86455,8 +91744,6 @@ class WebApps { * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName 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. @@ -86487,9 +91774,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -86533,8 +91817,6 @@ class WebApps { * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName 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. @@ -86565,9 +91847,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -86718,190 +91997,6 @@ class WebApps { } } - /** - * @summary Discovers an existing app backup that can be restored from a blob - * in Azure storage. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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. - */ - discoverRestoreSlotWithHttpOperationResponse(resourceGroupName, name, request, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._discoverRestoreSlot(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. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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. - */ - discoverRestoreSlot(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._discoverRestoreSlot(resourceGroupName, name, request, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._discoverRestoreSlot(resourceGroupName, name, request, slot, options, optionalCallback); - } - } - /** * @summary Gets a backup of an app by its ID. * @@ -87125,93 +92220,6 @@ class WebApps { * * @param {object} request Information on backup request. * - * @param {string} request.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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.backupRequestName 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. @@ -87242,8 +92250,85 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * @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 {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. * @@ -87340,7 +92425,7 @@ class WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -87361,7 +92446,7 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -87422,7 +92507,7 @@ class WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -87448,7 +92533,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {RestoreResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -87456,8 +92541,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} 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. * @@ -87869,186 +92953,192 @@ class WebApps { * More information on OpenID Connect Discovery: * http://openid.net/specs/openid-connect-discovery-1_0.html * - * @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 + * + * @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 @@ -88288,8 +93378,6 @@ class WebApps { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName 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. @@ -88320,9 +93408,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -88366,8 +93451,6 @@ class WebApps { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName 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. @@ -88398,9 +93481,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -89667,7 +94747,105 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, options, optionalCallback) { + 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') { @@ -89676,29 +94854,30 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, options, (err, result, request, response) => { + self._listSitePushSettingsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, options, optionalCallback); + return self._listSitePushSettingsSlot(resourceGroupName, name, slot, options, optionalCallback); } } /** - * @summary Gets the Push settings associated with web app. + * @summary Gets a Swift Virtual Network connection. * - * Gets the Push settings associated with web app. + * Gets a Swift Virtual Network connection. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -89707,15 +94886,15 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listSitePushSettingsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + getSwiftVirtualNetworkConnectionSlotWithHttpOperationResponse(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) => { + self._getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -89726,17 +94905,18 @@ class WebApps { } /** - * @summary Gets the Push settings associated with web app. + * @summary Gets a Swift Virtual Network connection. * - * Gets the Push settings associated with web app. + * Gets a Swift Virtual Network connection. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -89750,7 +94930,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {PushSettings} - The deserialized result object. + * @resolve {SwiftVirtualNetwork} - The deserialized result object. * * @reject {Error} - The error object. * @@ -89759,13 +94939,13 @@ class WebApps { * {Error} 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. + * 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. */ - listSitePushSettingsSlot(resourceGroupName, name, slot, options, optionalCallback) { + getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -89774,14 +94954,381 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listSitePushSettingsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._getSwiftVirtualNetworkConnectionSlot(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); + 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); } } @@ -89914,6 +95461,9 @@ class WebApps { * * @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. * @@ -90091,6 +95641,12 @@ class WebApps { * @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 @@ -90100,6 +95656,13 @@ class WebApps { * 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 @@ -90157,6 +95720,9 @@ class WebApps { * * @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. * @@ -90334,6 +95900,12 @@ class WebApps { * @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 @@ -90343,6 +95915,13 @@ class WebApps { * 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 @@ -90422,6 +96001,9 @@ class WebApps { * * @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. * @@ -90599,6 +96181,12 @@ class WebApps { * @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 @@ -90608,6 +96196,13 @@ class WebApps { * 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 @@ -90665,6 +96260,9 @@ class WebApps { * * @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. * @@ -90842,6 +96440,12 @@ class WebApps { * @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 @@ -90851,6 +96455,13 @@ class WebApps { * 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 @@ -91332,11 +96943,11 @@ class WebApps { * * @reject {Error} - The error object. */ - getWebSiteContainerLogsZipSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + getContainerLogsZipSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._getContainerLogsZipSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -91385,7 +96996,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, optionalCallback) { + getContainerLogsZipSlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -91394,14 +97005,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._getContainerLogsZipSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, optionalCallback); + return self._getContainerLogsZipSlot(resourceGroupName, name, slot, options, optionalCallback); } } @@ -92093,7 +97704,366 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getDeploymentSlot(resourceGroupName, name, id, slot, options, optionalCallback) { + 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') { @@ -92102,183 +98072,73 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeploymentSlot(resourceGroupName, name, id, slot, options, (err, result, request, response) => { + self._listDeploymentLogSlot(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); + return self._listDeploymentLogSlot(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 {string} [deployment.deploymentId] Identifier for deployment. - * - * @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. + * @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. * - * Create a deployment for an app, or a deployment slot. + * 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 {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 {string} [deployment.deploymentId] Identifier for deployment. - * - * @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. + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. * - * {Promise} A promise is returned + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @resolve {Deployment} - The deserialized result object. + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @reject {Error} - The error object. + * @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. * - * {function} optionalCallback(err, result, request, response) + * @param {string} [request.siteName] Name of an app. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Deployment} for more information. + * @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. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * {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. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * Delete a deployment by its ID for an app, or a deployment slot. + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. * - * @param {string} name Name of the app. + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). * - * @param {string} id Deployment ID. + * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. + * specified, the API will perform discovery for the production slot. * * @param {object} [options] Optional Parameters. * @@ -92287,15 +98147,15 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - deleteDeploymentSlotWithHttpOperationResponse(resourceGroupName, name, id, slot, options) { + discoverBackupSlotWithHttpOperationResponse(resourceGroupName, name, request, 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) => { + 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); } @@ -92306,128 +98166,61 @@ class WebApps { } /** - * @summary Delete a deployment by its ID for an app, or a deployment slot. + * @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. * - * Delete a deployment by its ID for an app, or a deployment slot. + * 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 {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 {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. * - * @param {string} name Name of the app. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @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} [request.blobName] Name of a blob which contains the backup. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. + * @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 {object} [options] Optional Parameters. + * @param {string} [request.siteName] Name of an app. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. * - * @returns {Promise} A promise is returned + * @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. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * @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. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * List deployment log for specific deployment for an app, or a deployment - * slot. + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. * - * @param {string} name Name of the app. + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). * - * @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} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. + * specified, the API will perform discovery for the production slot. * * @param {object} [options] Optional Parameters. * @@ -92441,7 +98234,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Deployment} - The deserialized result object. + * @resolve {RestoreRequest} - The deserialized result object. * * @reject {Error} - The error object. * @@ -92450,13 +98243,13 @@ class WebApps { * {Error} 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. + * 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. */ - listDeploymentLogSlot(resourceGroupName, name, id, slot, options, optionalCallback) { + discoverBackupSlot(resourceGroupName, name, request, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -92465,14 +98258,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listDeploymentLogSlot(resourceGroupName, name, id, slot, options, (err, result, request, response) => { + self._discoverBackupSlot(resourceGroupName, name, request, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listDeploymentLogSlot(resourceGroupName, name, id, slot, options, optionalCallback); + return self._discoverBackupSlot(resourceGroupName, name, request, slot, options, optionalCallback); } } @@ -93696,6 +99489,8 @@ class WebApps { * * @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. @@ -93757,6 +99552,8 @@ class WebApps { * * @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. @@ -98558,12 +104355,6 @@ class WebApps { * * @param {string} [premierAddOn.vendor] Premier add on Vendor. * - * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * * @param {string} [premierAddOn.marketplacePublisher] Premier add on * Marketplace publisher. * @@ -98625,12 +104416,6 @@ class WebApps { * * @param {string} [premierAddOn.vendor] Premier add on Vendor. * - * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * * @param {string} [premierAddOn.marketplacePublisher] Premier add on * Marketplace publisher. * @@ -98794,6 +104579,360 @@ class WebApps { } } + /** + * @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. @@ -100186,46 +106325,420 @@ class WebApps { } /** - * @summary Recovers a web app to a previous snapshot. + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * Recovers a web app to a previous snapshot. + * 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 web app. + * @param {string} name Name of the app. * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API resets configuration settings for the production slot. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {object} [options] Optional Parameters. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @returns {Promise} A promise is returned * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {boolean} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. + * @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. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. + * Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * @param {boolean} [recoveryEntity.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} resourceGroupName Name of the resource group to which the + * resource 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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will * default to production slot. @@ -100241,11 +106754,11 @@ class WebApps { * * @reject {Error} - The error object. */ - recoverSlotWithHttpOperationResponse(resourceGroupName, name, recoveryEntity, slot, options) { + restoreFromDeletedAppSlotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, (err, result, request, response) => { + 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); } @@ -100256,46 +106769,29 @@ class WebApps { } /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores a deleted web app to this web app. * - * Recovers a web app to a previous snapshot. + * 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Deleted web app restore information. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @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} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will * default to production slot. @@ -100326,7 +106822,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, optionalCallback) { + restoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -100335,141 +106831,65 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, (err, result, request, response) => { + self._restoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, optionalCallback); + return self._restoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, options, optionalCallback); } } /** - * @summary Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * @summary Restores a web app from a snapshot. * - * Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * 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 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. + * @param {string} name Name of web app. * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * {Promise} A promise is returned + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @resolve {null} - The deserialized result object. + * @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. * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. + * @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. * - * {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). + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. * - * Restarts an app (or deployment slot, if specified). + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @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} name Name of the app. + * @param {string} [restoreRequest.kind] Kind of resource. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will restart the production slot. + * @param {string} slot Name of web app slot. If not specified then will + * default to 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 * @@ -100479,11 +106899,11 @@ class WebApps { * * @reject {Error} - The error object. */ - restartSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + restoreSnapshotSlotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._restartSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + 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); } @@ -100494,27 +106914,52 @@ class WebApps { } /** - * @summary Restarts an app (or deployment slot, if specified). + * @summary Restores a web app from a snapshot. * - * Restarts an app (or deployment slot, if specified). + * 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 the app. + * @param {string} name Name of web app. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will restart the production slot. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {object} [options] Optional Parameters. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @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 {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 {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 {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 @@ -100540,7 +106985,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - restartSlot(resourceGroupName, name, slot, options, optionalCallback) { + restoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -100549,14 +106994,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._restartSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._restoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._restartSlot(resourceGroupName, name, slot, options, optionalCallback); + return self._restoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, optionalCallback); } } @@ -107014,6 +113459,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -107032,6 +113479,9 @@ class WebApps { * @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. @@ -107230,6 +113680,12 @@ class WebApps { * @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. * @@ -107240,6 +113696,13 @@ class WebApps { * 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. @@ -107315,43 +113778,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -107359,7 +113785,10 @@ class WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -107422,6 +113851,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -107440,6 +113871,9 @@ class WebApps { * @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. @@ -107638,6 +114072,12 @@ class WebApps { * @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. * @@ -107648,6 +114088,13 @@ class WebApps { * 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. @@ -107723,43 +114170,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -107767,7 +114177,10 @@ class WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -107865,7 +114278,7 @@ class WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -107883,7 +114296,7 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -107944,7 +114357,7 @@ class WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -107967,7 +114380,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {RestoreResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -107975,8 +114388,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} 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. * @@ -108256,6 +114668,8 @@ class WebApps { * * @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. @@ -108314,6 +114728,8 @@ class WebApps { * * @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. @@ -108692,15 +115108,159 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginMigrateMySqlWithHttpOperationResponse(resourceGroupName, name, migrationRequestEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Migrates a local (in-app) MySql database to a remote MySql + * database. + * + * Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationRequestEnvelope MySql migration options. + * + * @param {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. + * + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' + * + * @param {string} [migrationRequestEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Operation} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Operation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, optionalCallback); + } + } + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginMigrateMySqlWithHttpOperationResponse(resourceGroupName, name, migrationRequestEnvelope, options) { + beginRestoreFromBackupBlobWithHttpOperationResponse(resourceGroupName, name, request, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, (err, result, request, response) => { + self._beginRestoreFromBackupBlob(resourceGroupName, name, request, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -108711,26 +115271,175 @@ class WebApps { } /** - * @summary Migrates a local (in-app) MySql database to a remote MySql - * database. + * @summary Restores an app from a backup blob in Azure Storage. * - * Migrates a local (in-app) MySql database to a remote MySql database. + * 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} migrationRequestEnvelope MySql migration options. + * @param {object} restoreRequest Deleted web app restore information. * - * @param {string} migrationRequestEnvelope.connectionString Connection string - * to the remote MySQL database. + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} * - * @param {string} migrationRequestEnvelope.migrationType The type of migration - * operation to be done. Possible values include: 'LocalToRemote', - * 'RemoteToLocal' + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. * - * @param {string} [migrationRequestEnvelope.kind] Kind of resource. + * @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. * @@ -108744,7 +115453,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Operation} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -108752,14 +115461,13 @@ class WebApps { * * {Error} 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {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) { + beginRestoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -108768,58 +115476,59 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, (err, result, request, response) => { + self._beginRestoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, optionalCallback); + return self._beginRestoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, optionalCallback); } } /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -108832,11 +115541,11 @@ class WebApps { * * @reject {Error} - The error object. */ - beginRecoverWithHttpOperationResponse(resourceGroupName, name, recoveryEntity, options) { + beginRestoreSnapshotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginRecover(resourceGroupName, name, recoveryEntity, options, (err, result, request, response) => { + self._beginRestoreSnapshot(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -108847,46 +115556,47 @@ class WebApps { } /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -108914,7 +115624,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginRecover(resourceGroupName, name, recoveryEntity, options, optionalCallback) { + beginRestoreSnapshot(resourceGroupName, name, restoreRequest, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -108923,14 +115633,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginRecover(resourceGroupName, name, recoveryEntity, options, (err, result, request, response) => { + self._beginRestoreSnapshot(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginRecover(resourceGroupName, name, recoveryEntity, options, optionalCallback); + return self._beginRestoreSnapshot(resourceGroupName, name, restoreRequest, options, optionalCallback); } } @@ -109060,6 +115770,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -109078,6 +115790,9 @@ class WebApps { * @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. @@ -109276,6 +115991,12 @@ class WebApps { * @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. * @@ -109286,6 +116007,13 @@ class WebApps { * 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. @@ -109361,43 +116089,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -109405,7 +116096,10 @@ class WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -109418,19 +116112,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -109484,6 +116165,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -109502,6 +116185,9 @@ class WebApps { * @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. @@ -109700,6 +116386,12 @@ class WebApps { * @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. * @@ -109710,6 +116402,13 @@ class WebApps { * 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. @@ -109785,43 +116484,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -109829,7 +116491,10 @@ class WebApps { * @param {object} [siteEnvelope.identity] * * @param {string} [siteEnvelope.identity.type] Type of managed service - * identity. Possible values include: 'SystemAssigned' + * identity. Possible values include: 'SystemAssigned', 'UserAssigned' + * + * @param {array} [siteEnvelope.identity.identityIds] Array of UserAssigned + * managed service identities. * * @param {string} [siteEnvelope.kind] Kind of resource. * @@ -109842,19 +116507,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -109943,7 +116595,7 @@ class WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -109964,7 +116616,7 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -110025,7 +116677,7 @@ class WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -110051,7 +116703,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {RestoreResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -110059,8 +116711,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} 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. * @@ -110357,6 +117008,8 @@ class WebApps { * * @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. @@ -110418,6 +117071,8 @@ class WebApps { * * @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. @@ -110643,46 +117298,351 @@ class WebApps { } /** - * @summary Recovers a web app to a previous snapshot. + * @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. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will * default to production slot. @@ -110698,11 +117658,11 @@ class WebApps { * * @reject {Error} - The error object. */ - beginRecoverSlotWithHttpOperationResponse(resourceGroupName, name, recoveryEntity, slot, options) { + beginRestoreSnapshotSlotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, (err, result, request, response) => { + 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); } @@ -110713,46 +117673,47 @@ class WebApps { } /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will * default to production slot. @@ -110783,7 +117744,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, optionalCallback) { + beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -110792,14 +117753,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, (err, result, request, response) => { + self._beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, optionalCallback); + return self._beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, optionalCallback); } } diff --git a/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts b/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts index 0016cb7d6d..981bca0184 100644 --- a/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts +++ b/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts @@ -47,6 +47,8 @@ export default class WebSiteManagementClient extends AzureServiceClient { subscriptionId: string; + apiVersion: string; + acceptLanguage: string; longRunningOperationRetryTimeout: number; @@ -64,8 +66,6 @@ export default class WebSiteManagementClient extends AzureServiceClient { diagnostics: operations.Diagnostics; provider: operations.Provider; recommendations: operations.Recommendations; - resourceHealthMetadataOperations: operations.ResourceHealthMetadataOperations; - billingMeters: operations.BillingMeters; webApps: operations.WebApps; appServiceEnvironments: operations.AppServiceEnvironments; appServicePlans: operations.AppServicePlans; @@ -133,8 +133,6 @@ export default class WebSiteManagementClient extends AzureServiceClient { * * @param {object} userDetails Details of publishing user * - * @param {string} [userDetails.userName] Username - * * @param {string} userDetails.publishingUserName Username used for publishing. * * @param {string} [userDetails.publishingPassword] Password used for @@ -146,6 +144,8 @@ export default class WebSiteManagementClient extends AzureServiceClient { * @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. @@ -168,8 +168,6 @@ export default class WebSiteManagementClient extends AzureServiceClient { * * @param {object} userDetails Details of publishing user * - * @param {string} [userDetails.userName] Username - * * @param {string} userDetails.publishingUserName Username used for publishing. * * @param {string} [userDetails.publishingPassword] Password used for @@ -181,6 +179,8 @@ export default class WebSiteManagementClient extends AzureServiceClient { * @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. @@ -339,9 +339,6 @@ export default class WebSiteManagementClient extends AzureServiceClient { * * @param {object} requestMessage Source control token information * - * @param {string} [requestMessage.sourceControlName] Name or source control - * type. - * * @param {string} [requestMessage.token] OAuth access token. * * @param {string} [requestMessage.tokenSecret] OAuth access token secret. @@ -374,9 +371,6 @@ export default class WebSiteManagementClient extends AzureServiceClient { * * @param {object} requestMessage Source control token information * - * @param {string} [requestMessage.sourceControlName] Name or source control - * type. - * * @param {string} [requestMessage.token] OAuth access token. * * @param {string} [requestMessage.tokenSecret] OAuth access token secret. @@ -419,6 +413,72 @@ export default class WebSiteManagementClient extends AzureServiceClient { 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. * @@ -557,11 +617,14 @@ export default class WebSiteManagementClient extends AzureServiceClient { * * @param {string} [options.sku] Name of SKU used to filter the regions. * Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', - * 'PremiumV2', 'Dynamic', 'Isolated' + * 'Dynamic', 'Isolated', 'PremiumV2' * * @param {boolean} [options.linuxWorkersEnabled] Specify true if * you want to filter to only regions that support Linux workers. * + * @param {boolean} [options.xenonWorkersEnabled] Specify true if + * you want to filter to only regions that support Xenon workers. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -571,7 +634,7 @@ export default class WebSiteManagementClient extends AzureServiceClient { * * @reject {Error|ServiceError} - The error object. */ - listGeoRegionsWithHttpOperationResponse(options?: { sku? : string, linuxWorkersEnabled? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + listGeoRegionsWithHttpOperationResponse(options?: { sku? : string, linuxWorkersEnabled? : boolean, xenonWorkersEnabled? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Get a list of available geographical regions. @@ -582,11 +645,14 @@ export default class WebSiteManagementClient extends AzureServiceClient { * * @param {string} [options.sku] Name of SKU used to filter the regions. * Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', - * 'PremiumV2', 'Dynamic', 'Isolated' + * 'Dynamic', 'Isolated', 'PremiumV2' * * @param {boolean} [options.linuxWorkersEnabled] Specify true if * you want to filter to only regions that support Linux workers. * + * @param {boolean} [options.xenonWorkersEnabled] Specify true if + * you want to filter to only regions that support Xenon workers. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -612,9 +678,9 @@ export default class WebSiteManagementClient extends AzureServiceClient { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listGeoRegions(options?: { sku? : string, linuxWorkersEnabled? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + listGeoRegions(options?: { sku? : string, linuxWorkersEnabled? : boolean, xenonWorkersEnabled? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; listGeoRegions(callback: ServiceCallback): void; - listGeoRegions(options: { sku? : string, linuxWorkersEnabled? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listGeoRegions(options: { sku? : string, linuxWorkersEnabled? : boolean, xenonWorkersEnabled? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -978,6 +1044,9 @@ export default class WebSiteManagementClient extends AzureServiceClient { * @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 @@ -1026,6 +1095,9 @@ export default class WebSiteManagementClient extends AzureServiceClient { * @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 @@ -1194,6 +1266,68 @@ export default class WebSiteManagementClient extends AzureServiceClient { 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. * diff --git a/lib/services/websiteManagement2/lib/webSiteManagementClient.js b/lib/services/websiteManagement2/lib/webSiteManagementClient.js index beb4798477..50a4849d43 100644 --- a/lib/services/websiteManagement2/lib/webSiteManagementClient.js +++ b/lib/services/websiteManagement2/lib/webSiteManagementClient.js @@ -56,9 +56,11 @@ function _getPublishingUser(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // 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.'); } @@ -70,7 +72,7 @@ function _getPublishingUser(options, callback) { let baseUrl = this.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/publishingUsers/web'; let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -112,12 +114,13 @@ function _getPublishingUser(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -159,8 +162,6 @@ function _getPublishingUser(options, callback) { * * @param {object} userDetails Details of publishing user * - * @param {string} [userDetails.userName] Username - * * @param {string} userDetails.publishingUserName Username used for publishing. * * @param {string} [userDetails.publishingPassword] Password used for @@ -172,6 +173,8 @@ function _getPublishingUser(options, callback) { * @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. @@ -202,12 +205,14 @@ function _updatePublishingUser(userDetails, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // 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.'); } @@ -219,7 +224,7 @@ function _updatePublishingUser(userDetails, options, callback) { let baseUrl = this.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/publishingUsers/web'; let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -275,12 +280,13 @@ function _updatePublishingUser(userDetails, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -349,9 +355,11 @@ function _listSourceControls(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // 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.'); } @@ -363,7 +371,7 @@ function _listSourceControls(options, callback) { let baseUrl = this.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/sourcecontrols'; let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -405,12 +413,13 @@ function _listSourceControls(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -480,12 +489,14 @@ function _getSourceControl(sourceControlType, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // 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.'); } @@ -498,7 +509,7 @@ function _getSourceControl(sourceControlType, options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/sourcecontrols/{sourceControlType}'; requestUrl = requestUrl.replace('{sourceControlType}', encodeURIComponent(sourceControlType)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -540,12 +551,13 @@ function _getSourceControl(sourceControlType, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -589,9 +601,6 @@ function _getSourceControl(sourceControlType, options, callback) { * * @param {object} requestMessage Source control token information * - * @param {string} [requestMessage.sourceControlName] Name or source control - * type. - * * @param {string} [requestMessage.token] OAuth access token. * * @param {string} [requestMessage.tokenSecret] OAuth access token secret. @@ -630,7 +639,6 @@ function _updateSourceControl(sourceControlType, requestMessage, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (sourceControlType === null || sourceControlType === undefined || typeof sourceControlType.valueOf() !== 'string') { @@ -639,6 +647,9 @@ function _updateSourceControl(sourceControlType, requestMessage, options, callba 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.'); } @@ -651,7 +662,7 @@ function _updateSourceControl(sourceControlType, requestMessage, options, callba let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/sourcecontrols/{sourceControlType}'; requestUrl = requestUrl.replace('{sourceControlType}', encodeURIComponent(sourceControlType)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -707,12 +718,13 @@ function _updateSourceControl(sourceControlType, requestMessage, options, callba try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -747,6 +759,162 @@ function _updateSourceControl(sourceControlType, requestMessage, options, callba }); } +/** + * @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. * @@ -791,12 +959,14 @@ function _checkNameAvailability(name, type, options, callback) { throw new Error('callback cannot be null.'); } let isFqdn = (options && options.isFqdn !== undefined) ? options.isFqdn : undefined; - let apiVersion = '2016-03-01'; // 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.'); } @@ -825,7 +995,7 @@ function _checkNameAvailability(name, type, options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -881,12 +1051,13 @@ function _checkNameAvailability(name, type, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -954,12 +1125,14 @@ function _getSubscriptionDeploymentLocations(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // 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.'); } @@ -972,7 +1145,7 @@ function _getSubscriptionDeploymentLocations(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1014,12 +1187,13 @@ function _getSubscriptionDeploymentLocations(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1063,11 +1237,14 @@ function _getSubscriptionDeploymentLocations(options, callback) { * * @param {string} [options.sku] Name of SKU used to filter the regions. * Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', - * 'PremiumV2', 'Dynamic', 'Isolated' + * 'Dynamic', 'Isolated', 'PremiumV2' * * @param {boolean} [options.linuxWorkersEnabled] Specify true if * you want to filter to only regions that support Linux workers. * + * @param {boolean} [options.xenonWorkersEnabled] Specify true if + * you want to filter to only regions that support Xenon workers. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -1096,7 +1273,7 @@ function _listGeoRegions(options, callback) { } let sku = (options && options.sku !== undefined) ? options.sku : undefined; let linuxWorkersEnabled = (options && options.linuxWorkersEnabled !== undefined) ? options.linuxWorkersEnabled : undefined; - let apiVersion = '2016-03-01'; + let xenonWorkersEnabled = (options && options.xenonWorkersEnabled !== undefined) ? options.xenonWorkersEnabled : undefined; // Validate try { if (sku !== null && sku !== undefined && typeof sku.valueOf() !== 'string') { @@ -1105,9 +1282,15 @@ function _listGeoRegions(options, callback) { if (linuxWorkersEnabled !== null && linuxWorkersEnabled !== undefined && typeof linuxWorkersEnabled !== 'boolean') { throw new Error('linuxWorkersEnabled must be of type boolean.'); } + if (xenonWorkersEnabled !== null && xenonWorkersEnabled !== undefined && typeof xenonWorkersEnabled !== 'boolean') { + throw new Error('xenonWorkersEnabled must be of type boolean.'); + } if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); } @@ -1126,7 +1309,10 @@ function _listGeoRegions(options, callback) { if (linuxWorkersEnabled !== null && linuxWorkersEnabled !== undefined) { queryParameters.push('linuxWorkersEnabled=' + encodeURIComponent(linuxWorkersEnabled.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (xenonWorkersEnabled !== null && xenonWorkersEnabled !== undefined) { + queryParameters.push('xenonWorkersEnabled=' + encodeURIComponent(xenonWorkersEnabled.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1168,12 +1354,13 @@ function _listGeoRegions(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1244,12 +1431,14 @@ function _listSiteIdentifiersAssignedToHostName(options, callback) { throw new Error('callback cannot be null.'); } let name = (options && options.name !== undefined) ? options.name : undefined; - let apiVersion = '2016-03-01'; // 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.'); } @@ -1270,7 +1459,7 @@ function _listSiteIdentifiersAssignedToHostName(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1326,12 +1515,13 @@ function _listSiteIdentifiersAssignedToHostName(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1400,12 +1590,14 @@ function _listPremierAddOnOffers(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // 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.'); } @@ -1418,7 +1610,7 @@ function _listPremierAddOnOffers(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1460,12 +1652,13 @@ function _listPremierAddOnOffers(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1533,12 +1726,14 @@ function _listSkus(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // 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.'); } @@ -1551,7 +1746,7 @@ function _listSkus(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1593,12 +1788,13 @@ function _listSkus(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1680,7 +1876,6 @@ function _verifyHostingEnvironmentVnet(parameters, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (parameters === null || parameters === undefined) { @@ -1689,6 +1884,9 @@ function _verifyHostingEnvironmentVnet(parameters, options, callback) { 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.'); } @@ -1701,7 +1899,7 @@ function _verifyHostingEnvironmentVnet(parameters, options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1757,12 +1955,13 @@ function _verifyHostingEnvironmentVnet(parameters, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1839,7 +2038,6 @@ function _move(resourceGroupName, moveResourceEnvelope, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1865,6 +2063,9 @@ function _move(resourceGroupName, moveResourceEnvelope, options, callback) { 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.'); } @@ -1878,7 +2079,7 @@ function _move(resourceGroupName, moveResourceEnvelope, options, callback) { requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1992,6 +2193,9 @@ function _move(resourceGroupName, moveResourceEnvelope, options, callback) { * @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 @@ -2020,7 +2224,6 @@ function _validate(resourceGroupName, validateRequest, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2046,6 +2249,9 @@ function _validate(resourceGroupName, validateRequest, options, callback) { 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.'); } @@ -2059,7 +2265,7 @@ function _validate(resourceGroupName, validateRequest, options, callback) { requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2115,12 +2321,13 @@ function _validate(resourceGroupName, validateRequest, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2197,7 +2404,6 @@ function _validateMove(resourceGroupName, moveResourceEnvelope, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2223,6 +2429,9 @@ function _validateMove(resourceGroupName, moveResourceEnvelope, options, callbac 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.'); } @@ -2236,7 +2445,7 @@ function _validateMove(resourceGroupName, moveResourceEnvelope, options, callbac requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2405,12 +2614,13 @@ function _listSourceControlsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2445,6 +2655,137 @@ function _listSourceControlsNext(nextPageLink, options, callback) { }); } +/** + * @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. * @@ -2534,12 +2875,13 @@ function _listGeoRegionsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2663,12 +3005,13 @@ function _listSiteIdentifiersAssignedToHostNameNext(nextPageLink, options, callb try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2793,12 +3136,13 @@ function _listPremierAddOnOffersNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2861,6 +3205,7 @@ class WebSiteManagementClient extends ServiceClient { super(credentials, options); + this.apiVersion = '2018-02-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; @@ -2892,8 +3237,6 @@ class WebSiteManagementClient extends ServiceClient { this.diagnostics = new operations.Diagnostics(this); this.provider = new operations.Provider(this); this.recommendations = new operations.Recommendations(this); - this.resourceHealthMetadataOperations = new operations.ResourceHealthMetadataOperations(this); - this.billingMeters = new operations.BillingMeters(this); this.webApps = new operations.WebApps(this); this.appServiceEnvironments = new operations.AppServiceEnvironments(this); this.appServicePlans = new operations.AppServicePlans(this); @@ -2903,6 +3246,7 @@ class WebSiteManagementClient extends ServiceClient { this._listSourceControls = _listSourceControls; this._getSourceControl = _getSourceControl; this._updateSourceControl = _updateSourceControl; + this._listBillingMeters = _listBillingMeters; this._checkNameAvailability = _checkNameAvailability; this._getSubscriptionDeploymentLocations = _getSubscriptionDeploymentLocations; this._listGeoRegions = _listGeoRegions; @@ -2914,6 +3258,7 @@ class WebSiteManagementClient extends ServiceClient { this._validate = _validate; this._validateMove = _validateMove; this._listSourceControlsNext = _listSourceControlsNext; + this._listBillingMetersNext = _listBillingMetersNext; this._listGeoRegionsNext = _listGeoRegionsNext; this._listSiteIdentifiersAssignedToHostNameNext = _listSiteIdentifiersAssignedToHostNameNext; this._listPremierAddOnOffersNext = _listPremierAddOnOffersNext; @@ -3009,8 +3354,6 @@ class WebSiteManagementClient extends ServiceClient { * * @param {object} userDetails Details of publishing user * - * @param {string} [userDetails.userName] Username - * * @param {string} userDetails.publishingUserName Username used for publishing. * * @param {string} [userDetails.publishingPassword] Password used for @@ -3022,6 +3365,8 @@ class WebSiteManagementClient extends ServiceClient { * @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. @@ -3056,8 +3401,6 @@ class WebSiteManagementClient extends ServiceClient { * * @param {object} userDetails Details of publishing user * - * @param {string} [userDetails.userName] Username - * * @param {string} userDetails.publishingUserName Username used for publishing. * * @param {string} [userDetails.publishingPassword] Password used for @@ -3069,6 +3412,8 @@ class WebSiteManagementClient extends ServiceClient { * @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. @@ -3296,9 +3641,6 @@ class WebSiteManagementClient extends ServiceClient { * * @param {object} requestMessage Source control token information * - * @param {string} [requestMessage.sourceControlName] Name or source control - * type. - * * @param {string} [requestMessage.token] OAuth access token. * * @param {string} [requestMessage.tokenSecret] OAuth access token secret. @@ -3343,9 +3685,6 @@ class WebSiteManagementClient extends ServiceClient { * * @param {object} requestMessage Source control token information * - * @param {string} [requestMessage.sourceControlName] Name or source control - * type. - * * @param {string} [requestMessage.token] OAuth access token. * * @param {string} [requestMessage.tokenSecret] OAuth access token secret. @@ -3403,6 +3742,99 @@ class WebSiteManagementClient extends ServiceClient { } } + /** + * @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. * @@ -3595,11 +4027,14 @@ class WebSiteManagementClient extends ServiceClient { * * @param {string} [options.sku] Name of SKU used to filter the regions. * Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', - * 'PremiumV2', 'Dynamic', 'Isolated' + * 'Dynamic', 'Isolated', 'PremiumV2' * * @param {boolean} [options.linuxWorkersEnabled] Specify true if * you want to filter to only regions that support Linux workers. * + * @param {boolean} [options.xenonWorkersEnabled] Specify true if + * you want to filter to only regions that support Xenon workers. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -3632,11 +4067,14 @@ class WebSiteManagementClient extends ServiceClient { * * @param {string} [options.sku] Name of SKU used to filter the regions. * Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', - * 'PremiumV2', 'Dynamic', 'Isolated' + * 'Dynamic', 'Isolated', 'PremiumV2' * * @param {boolean} [options.linuxWorkersEnabled] Specify true if * you want to filter to only regions that support Linux workers. * + * @param {boolean} [options.xenonWorkersEnabled] Specify true if + * you want to filter to only regions that support Xenon workers. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -4178,6 +4616,9 @@ class WebSiteManagementClient extends ServiceClient { * @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 @@ -4238,6 +4679,9 @@ class WebSiteManagementClient extends ServiceClient { * @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 @@ -4475,6 +4919,95 @@ class WebSiteManagementClient extends ServiceClient { } } + /** + * @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. * From 028271d750218cc02725e3428a75a50a5ba80cda Mon Sep 17 00:00:00 2001 From: Dan Schulte Date: Tue, 24 Jul 2018 14:37:47 -0700 Subject: [PATCH 8/9] Regenerate azure-arm-website --- .../webSiteManagement2/package-lock.json | 578 + .../websiteManagement2/lib/LICENSE.txt | 21 - .../lib/lib/models/abnormalTimePeriod.js | 94 - .../lib/lib/models/address.js | 92 - .../lib/lib/models/addressResponse.js | 95 - .../lib/lib/models/analysisData.js | 123 - .../lib/lib/models/analysisDefinition.js | 88 - .../lib/lib/models/apiDefinitionInfo.js | 52 - .../lib/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/lib/models/appServiceEnvironment.js | 444 - .../models/appServiceEnvironmentCollection.js | 68 - .../appServiceEnvironmentPatchResource.js | 478 - .../models/appServiceEnvironmentResource.js | 499 - .../lib/lib/models/appServicePlan.js | 296 - .../lib/models/appServicePlanCollection.js | 67 - .../lib/models/appServicePlanPatchResource.js | 248 - .../lib/lib/models/applicationLogsConfig.js | 89 - .../lib/lib/models/applicationStack.js | 103 - .../lib/models/applicationStackCollection.js | 68 - .../lib/lib/models/autoHealActions.js | 77 - .../lib/lib/models/autoHealCustomAction.js | 61 - .../lib/lib/models/autoHealRules.js | 86 - .../lib/lib/models/autoHealTriggers.js | 93 - .../azureBlobStorageApplicationLogsConfig.js | 73 - .../models/azureBlobStorageHttpLogsConfig.js | 72 - .../azureTableStorageApplicationLogsConfig.js | 63 - .../lib/lib/models/backupItem.js | 223 - .../lib/lib/models/backupItemCollection.js | 68 - .../lib/lib/models/backupRequest.js | 157 - .../lib/lib/models/backupSchedule.js | 108 - .../lib/lib/models/billingMeter.js | 121 - .../lib/lib/models/billingMeterCollection.js | 68 - .../lib/lib/models/capability.js | 68 - .../lib/lib/models/certificate.js | 297 - .../lib/lib/models/certificateCollection.js | 68 - .../lib/lib/models/certificateDetails.js | 125 - .../lib/lib/models/certificateEmail.js | 95 - .../lib/lib/models/certificateOrderAction.js | 102 - .../lib/models/certificatePatchResource.js | 276 - .../lib/lib/models/cloningInfo.js | 159 - .../lib/lib/models/connStringInfo.js | 71 - .../lib/lib/models/connStringValueTypePair.js | 63 - .../lib/models/connectionStringDictionary.js | 95 - .../lib/lib/models/contact.js | 131 - .../lib/lib/models/continuousWebJob.js | 180 - .../lib/models/continuousWebJobCollection.js | 67 - .../lib/lib/models/corsSettings.js | 61 - .../lib/lib/models/csmMoveResourceEnvelope.js | 73 - .../lib/lib/models/csmOperationCollection.js | 68 - .../lib/lib/models/csmOperationDescription.js | 86 - .../csmOperationDescriptionProperties.js | 56 - .../lib/lib/models/csmOperationDisplay.js | 76 - .../lib/models/csmPublishingProfileOptions.js | 55 - .../lib/lib/models/csmSlotEntity.js | 62 - .../lib/lib/models/csmUsageQuota.js | 89 - .../lib/lib/models/csmUsageQuotaCollection.js | 68 - .../models/customHostnameAnalysisResult.js | 232 - .../lib/lib/models/dataSource.js | 77 - .../lib/lib/models/databaseBackupSetting.js | 81 - .../lib/lib/models/defaultErrorResponse.js | 64 - .../lib/models/defaultErrorResponseError.js | 101 - .../defaultErrorResponseErrorDetailsItem.js | 74 - .../lib/lib/models/deletedSite.js | 98 - .../lib/lib/models/deletedWebAppCollection.js | 68 - .../lib/lib/models/deployment.js | 160 - .../lib/lib/models/deploymentCollection.js | 68 - .../lib/lib/models/deploymentLocations.js | 97 - .../lib/models/detectorAbnormalTimePeriod.js | 137 - .../lib/lib/models/detectorDefinition.js | 116 - .../lib/lib/models/diagnosticAnalysis.js | 144 - .../models/diagnosticAnalysisCollection.js | 68 - .../lib/lib/models/diagnosticCategory.js | 88 - .../models/diagnosticCategoryCollection.js | 68 - .../models/diagnosticDetectorCollection.js | 68 - .../lib/models/diagnosticDetectorResponse.js | 189 - .../lib/lib/models/diagnosticMetricSample.js | 102 - .../lib/lib/models/diagnosticMetricSet.js | 105 - .../lib/lib/models/dimension.js | 78 - .../lib/lib/models/domain.js | 414 - .../models/domainAvailablilityCheckResult.js | 73 - .../lib/lib/models/domainCollection.js | 68 - .../models/domainControlCenterSsoRequest.js | 72 - .../lib/models/domainOwnershipIdentifier.js | 87 - .../domainOwnershipIdentifierCollection.js | 68 - .../lib/lib/models/domainPatchResource.js | 393 - .../lib/lib/models/domainPurchaseConsent.js | 78 - .../domainRecommendationSearchParameters.js | 62 - .../lib/lib/models/enabledConfig.js | 53 - .../lib/lib/models/errorEntity.js | 109 - .../lib/lib/models/errorResponse.js | 61 - .../lib/lib/models/experiments.js | 62 - .../models/fileSystemApplicationLogsConfig.js | 55 - .../lib/models/fileSystemHttpLogsConfig.js | 78 - .../lib/lib/models/functionEnvelope.js | 169 - .../lib/models/functionEnvelopeCollection.js | 68 - .../lib/lib/models/functionSecrets.js | 95 - .../lib/lib/models/geoRegion.js | 106 - .../lib/lib/models/geoRegionCollection.js | 68 - .../lib/lib/models/globalCsmSkuDescription.js | 127 - .../lib/lib/models/handlerMapping.js | 74 - .../lib/lib/models/hostName.js | 110 - .../lib/lib/models/hostNameBinding.js | 161 - .../lib/models/hostNameBindingCollection.js | 68 - .../lib/lib/models/hostNameSslState.js | 98 - .../hostingEnvironmentDeploymentInfo.js | 60 - .../models/hostingEnvironmentDiagnostics.js | 60 - .../lib/models/hostingEnvironmentProfile.js | 70 - .../lib/lib/models/httpLogsConfig.js | 81 - .../lib/lib/models/hybridConnection.js | 148 - .../lib/models/hybridConnectionCollection.js | 68 - .../lib/lib/models/hybridConnectionKey.js | 98 - .../lib/lib/models/hybridConnectionLimits.js | 99 - .../lib/lib/models/identifier.js | 87 - .../lib/lib/models/identifierCollection.js | 68 - .../lib/lib/models/index.d.ts | 7284 - .../lib/lib/models/index.js | 278 - .../lib/lib/models/ipSecurityRestriction.js | 62 - .../lib/lib/models/localizableString.js | 60 - .../lib/lib/models/mSDeploy.js | 152 - .../lib/lib/models/mSDeployLog.js | 96 - .../lib/lib/models/mSDeployLogEntry.js | 73 - .../lib/lib/models/mSDeployStatus.js | 127 - .../lib/lib/models/managedServiceIdentity.js | 71 - .../lib/lib/models/metricAvailabilily.js | 60 - .../lib/lib/models/metricAvailability.js | 60 - .../lib/lib/models/metricDefinition.js | 133 - .../lib/lib/models/metricSpecification.js | 182 - .../lib/lib/models/migrateMySqlRequest.js | 98 - .../lib/lib/models/migrateMySqlStatus.js | 110 - .../lib/lib/models/nameIdentifier.js | 52 - .../lib/models/nameIdentifierCollection.js | 68 - .../lib/lib/models/nameValuePair.js | 60 - .../lib/models/networkAccessControlEntry.js | 79 - .../lib/lib/models/networkFeatures.js | 150 - .../lib/lib/models/operation.js | 121 - .../lib/models/perfMonCounterCollection.js | 68 - .../lib/lib/models/perfMonResponse.js | 77 - .../lib/lib/models/perfMonSample.js | 77 - .../lib/lib/models/perfMonSet.js | 95 - .../lib/lib/models/premierAddOn.js | 172 - .../lib/lib/models/premierAddOnOffer.js | 171 - .../lib/models/premierAddOnOfferCollection.js | 68 - .../lib/lib/models/processInfo.js | 405 - .../lib/lib/models/processInfoCollection.js | 68 - .../lib/lib/models/processModuleInfo.js | 168 - .../lib/models/processModuleInfoCollection.js | 68 - .../lib/lib/models/processThreadInfo.js | 183 - .../lib/models/processThreadInfoCollection.js | 68 - .../lib/lib/models/proxyOnlyResource.js | 84 - .../lib/lib/models/publicCertificate.js | 106 - .../lib/models/publicCertificateCollection.js | 68 - .../lib/lib/models/pushSettings.js | 121 - .../lib/lib/models/rampUpRule.js | 125 - .../lib/lib/models/recommendation.js | 274 - .../lib/models/recommendationCollection.js | 68 - .../lib/lib/models/recommendationRule.js | 203 - .../models/reissueCertificateOrderRequest.js | 113 - .../models/relayServiceConnectionEntity.js | 135 - .../models/renewCertificateOrderRequest.js | 104 - .../lib/lib/models/requestsBasedTrigger.js | 60 - .../lib/lib/models/resource.js | 106 - .../lib/lib/models/resourceCollection.js | 67 - .../lib/lib/models/resourceHealthMetadata.js | 97 - .../resourceHealthMetadataCollection.js | 68 - .../lib/lib/models/resourceMetric.js | 146 - .../lib/models/resourceMetricAvailability.js | 62 - .../lib/models/resourceMetricCollection.js | 68 - .../lib/models/resourceMetricDefinition.js | 162 - .../resourceMetricDefinitionCollection.js | 68 - .../lib/lib/models/resourceMetricName.js | 62 - .../lib/lib/models/resourceMetricProperty.js | 60 - .../lib/lib/models/resourceMetricValue.js | 117 - .../lib/models/resourceNameAvailability.js | 78 - .../models/resourceNameAvailabilityRequest.js | 71 - .../lib/lib/models/responseMetaData.js | 57 - .../lib/lib/models/restoreRequest.js | 193 - .../lib/lib/models/restoreResponse.js | 89 - .../lib/lib/models/serviceSpecification.js | 62 - .../websiteManagement2/lib/lib/models/site.js | 671 - .../lib/lib/models/siteAuthSettings.js | 401 - .../lib/lib/models/siteCloneability.js | 108 - .../lib/models/siteCloneabilityCriterion.js | 60 - .../lib/lib/models/siteConfig.js | 548 - .../lib/lib/models/siteConfigResource.js | 581 - .../models/siteConfigResourceCollection.js | 68 - .../models/siteConfigurationSnapshotInfo.js | 97 - ...siteConfigurationSnapshotInfoCollection.js | 69 - .../lib/lib/models/siteExtensionInfo.js | 249 - .../lib/models/siteExtensionInfoCollection.js | 68 - .../lib/lib/models/siteInstance.js | 88 - .../lib/lib/models/siteLimits.js | 68 - .../lib/lib/models/siteLogsConfig.js | 165 - .../lib/lib/models/siteMachineKey.js | 76 - .../lib/lib/models/sitePatchResource.js | 636 - .../lib/lib/models/sitePhpErrorLogFlag.js | 113 - .../lib/lib/models/siteSeal.js | 52 - .../lib/lib/models/siteSealRequest.js | 61 - .../lib/lib/models/siteSourceControl.js | 123 - .../lib/lib/models/skuCapacity.js | 80 - .../lib/lib/models/skuDescription.js | 137 - .../lib/lib/models/skuInfo.js | 99 - .../lib/lib/models/skuInfoCollection.js | 68 - .../lib/lib/models/skuInfos.js | 70 - .../lib/lib/models/slotConfigNamesResource.js | 109 - .../lib/lib/models/slotDifference.js | 147 - .../lib/models/slotDifferenceCollection.js | 68 - .../lib/lib/models/slotSwapStatus.js | 74 - .../lib/models/slowRequestsBasedTrigger.js | 68 - .../lib/lib/models/snapshot.js | 88 - .../lib/lib/models/snapshotCollection.js | 69 - .../lib/lib/models/snapshotRecoveryRequest.js | 133 - .../lib/lib/models/snapshotRecoveryTarget.js | 65 - .../lib/lib/models/solution.js | 134 - .../lib/lib/models/sourceControl.js | 119 - .../lib/lib/models/sourceControlCollection.js | 68 - .../lib/lib/models/stackMajorVersion.js | 90 - .../lib/lib/models/stackMinorVersion.js | 71 - .../lib/lib/models/stampCapacity.js | 136 - .../lib/lib/models/stampCapacityCollection.js | 68 - .../lib/lib/models/statusCodesBasedTrigger.js | 84 - .../lib/lib/models/storageMigrationOptions.js | 117 - .../lib/models/storageMigrationResponse.js | 90 - .../lib/lib/models/stringDictionary.js | 94 - .../lib/lib/models/tldLegalAgreement.js | 77 - .../lib/models/tldLegalAgreementCollection.js | 68 - .../lib/lib/models/topLevelDomain.js | 97 - .../models/topLevelDomainAgreementOption.js | 64 - .../lib/models/topLevelDomainCollection.js | 68 - .../lib/lib/models/triggeredJobHistory.js | 96 - .../models/triggeredJobHistoryCollection.js | 68 - .../lib/lib/models/triggeredJobRun.js | 170 - .../lib/lib/models/triggeredWebJob.js | 191 - .../lib/models/triggeredWebJobCollection.js | 68 - .../lib/lib/models/usage.js | 162 - .../lib/lib/models/usageCollection.js | 68 - .../websiteManagement2/lib/lib/models/user.js | 121 - .../lib/lib/models/validateRequest.js | 126 - .../lib/lib/models/validateResponse.js | 65 - .../lib/lib/models/validateResponseError.js | 60 - .../lib/lib/models/virtualApplication.js | 88 - .../lib/lib/models/virtualDirectory.js | 60 - .../lib/lib/models/virtualIPMapping.js | 76 - .../lib/lib/models/virtualNetworkProfile.js | 78 - .../lib/lib/models/vnetGateway.js | 97 - .../lib/lib/models/vnetInfo.js | 143 - .../lib/lib/models/vnetParameters.js | 104 - .../lib/lib/models/vnetRoute.js | 123 - .../models/vnetValidationFailureDetails.js | 105 - .../lib/models/vnetValidationTestFailure.js | 96 - .../lib/lib/models/webAppCollection.js | 68 - .../lib/models/webAppInstanceCollection.js | 68 - .../lib/lib/models/webJob.js | 154 - .../lib/lib/models/webJobCollection.js | 68 - .../lib/lib/models/workerPool.js | 96 - .../lib/lib/models/workerPoolCollection.js | 68 - .../lib/lib/models/workerPoolResource.js | 159 - .../operations/appServiceCertificateOrders.js | 6774 - .../lib/operations/appServiceEnvironments.js | 18725 --- .../lib/lib/operations/appServicePlans.js | 10483 -- .../lib/lib/operations/billingMeters.js | 483 - .../certificateRegistrationProvider.js | 475 - .../lib/lib/operations/certificates.js | 2089 - .../lib/lib/operations/deletedWebApps.js | 467 - .../lib/lib/operations/diagnostics.js | 6345 - .../operations/domainRegistrationProvider.js | 475 - .../lib/lib/operations/domains.js | 5682 - .../lib/lib/operations/index.d.ts | 56146 ------- .../lib/lib/operations/index.js | 31 - .../lib/lib/operations/provider.js | 1379 - .../lib/lib/operations/recommendations.js | 2944 - .../resourceHealthMetadataOperations.js | 2470 - .../lib/lib/operations/topLevelDomains.js | 1200 - .../lib/lib/operations/webApps.js | 116459 --------------- .../lib/lib/webSiteManagementClient.d.ts | 1381 - .../lib/lib/webSiteManagementClient.js | 4748 - .../websiteManagement2/lib/package.json | 22 - .../lib/webSiteManagementClient.d.ts | 6 +- .../lib/webSiteManagementClient.js | 6 +- lib/services/websiteManagement2/package.json | 6 +- 285 files changed, 587 insertions(+), 276605 deletions(-) create mode 100644 lib/services/webSiteManagement2/package-lock.json delete mode 100644 lib/services/websiteManagement2/lib/LICENSE.txt delete mode 100644 lib/services/websiteManagement2/lib/lib/models/abnormalTimePeriod.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/address.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/addressResponse.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/analysisData.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/analysisDefinition.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/apiDefinitionInfo.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/appServiceCertificate.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/appServiceCertificateCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/appServiceCertificateOrder.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/appServiceCertificateOrderCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/appServiceCertificateOrderPatchResource.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/appServiceCertificatePatchResource.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/appServiceCertificateResource.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/appServiceEnvironment.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/appServiceEnvironmentCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/appServiceEnvironmentPatchResource.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/appServiceEnvironmentResource.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/appServicePlan.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/appServicePlanCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/appServicePlanPatchResource.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/applicationLogsConfig.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/applicationStack.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/applicationStackCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/autoHealActions.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/autoHealCustomAction.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/autoHealRules.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/autoHealTriggers.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/azureBlobStorageApplicationLogsConfig.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/azureBlobStorageHttpLogsConfig.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/azureTableStorageApplicationLogsConfig.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/backupItem.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/backupItemCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/backupRequest.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/backupSchedule.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/billingMeter.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/billingMeterCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/capability.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/certificate.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/certificateCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/certificateDetails.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/certificateEmail.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/certificateOrderAction.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/certificatePatchResource.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/cloningInfo.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/connStringInfo.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/connStringValueTypePair.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/connectionStringDictionary.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/contact.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/continuousWebJob.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/continuousWebJobCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/corsSettings.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/csmMoveResourceEnvelope.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/csmOperationCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/csmOperationDescription.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/csmOperationDescriptionProperties.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/csmOperationDisplay.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/csmPublishingProfileOptions.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/csmSlotEntity.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/csmUsageQuota.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/csmUsageQuotaCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/customHostnameAnalysisResult.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/dataSource.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/databaseBackupSetting.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/defaultErrorResponse.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/defaultErrorResponseError.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/defaultErrorResponseErrorDetailsItem.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/deletedSite.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/deletedWebAppCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/deployment.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/deploymentCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/deploymentLocations.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/detectorAbnormalTimePeriod.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/detectorDefinition.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/diagnosticAnalysis.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/diagnosticAnalysisCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/diagnosticCategory.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/diagnosticCategoryCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/diagnosticDetectorCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/diagnosticDetectorResponse.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/diagnosticMetricSample.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/diagnosticMetricSet.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/dimension.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/domain.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/domainAvailablilityCheckResult.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/domainCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/domainControlCenterSsoRequest.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/domainOwnershipIdentifier.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/domainOwnershipIdentifierCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/domainPatchResource.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/domainPurchaseConsent.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/domainRecommendationSearchParameters.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/enabledConfig.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/errorEntity.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/errorResponse.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/experiments.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/fileSystemApplicationLogsConfig.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/fileSystemHttpLogsConfig.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/functionEnvelope.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/functionEnvelopeCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/functionSecrets.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/geoRegion.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/geoRegionCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/globalCsmSkuDescription.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/handlerMapping.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/hostName.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/hostNameBinding.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/hostNameBindingCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/hostNameSslState.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/hostingEnvironmentDeploymentInfo.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/hostingEnvironmentDiagnostics.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/hostingEnvironmentProfile.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/httpLogsConfig.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/hybridConnection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/hybridConnectionCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/hybridConnectionKey.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/hybridConnectionLimits.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/identifier.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/identifierCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/index.d.ts delete mode 100644 lib/services/websiteManagement2/lib/lib/models/index.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/ipSecurityRestriction.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/localizableString.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/mSDeploy.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/mSDeployLog.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/mSDeployLogEntry.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/mSDeployStatus.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/managedServiceIdentity.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/metricAvailabilily.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/metricAvailability.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/metricDefinition.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/metricSpecification.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/migrateMySqlRequest.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/migrateMySqlStatus.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/nameIdentifier.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/nameIdentifierCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/nameValuePair.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/networkAccessControlEntry.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/networkFeatures.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/operation.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/perfMonCounterCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/perfMonResponse.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/perfMonSample.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/perfMonSet.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/premierAddOn.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/premierAddOnOffer.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/premierAddOnOfferCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/processInfo.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/processInfoCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/processModuleInfo.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/processModuleInfoCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/processThreadInfo.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/processThreadInfoCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/proxyOnlyResource.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/publicCertificate.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/publicCertificateCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/pushSettings.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/rampUpRule.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/recommendation.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/recommendationCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/recommendationRule.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/reissueCertificateOrderRequest.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/relayServiceConnectionEntity.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/renewCertificateOrderRequest.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/requestsBasedTrigger.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/resource.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceHealthMetadata.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceHealthMetadataCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceMetric.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceMetricAvailability.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceMetricCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceMetricDefinition.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceMetricDefinitionCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceMetricName.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceMetricProperty.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceMetricValue.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceNameAvailability.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/resourceNameAvailabilityRequest.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/responseMetaData.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/restoreRequest.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/restoreResponse.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/serviceSpecification.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/site.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/siteAuthSettings.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/siteCloneability.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/siteCloneabilityCriterion.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/siteConfig.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/siteConfigResource.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/siteConfigResourceCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/siteConfigurationSnapshotInfo.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/siteConfigurationSnapshotInfoCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/siteExtensionInfo.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/siteExtensionInfoCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/siteInstance.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/siteLimits.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/siteLogsConfig.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/siteMachineKey.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/sitePatchResource.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/sitePhpErrorLogFlag.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/siteSeal.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/siteSealRequest.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/siteSourceControl.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/skuCapacity.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/skuDescription.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/skuInfo.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/skuInfoCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/skuInfos.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/slotConfigNamesResource.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/slotDifference.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/slotDifferenceCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/slotSwapStatus.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/slowRequestsBasedTrigger.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/snapshot.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/snapshotCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/snapshotRecoveryRequest.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/snapshotRecoveryTarget.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/solution.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/sourceControl.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/sourceControlCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/stackMajorVersion.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/stackMinorVersion.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/stampCapacity.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/stampCapacityCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/statusCodesBasedTrigger.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/storageMigrationOptions.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/storageMigrationResponse.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/stringDictionary.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/tldLegalAgreement.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/tldLegalAgreementCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/topLevelDomain.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/topLevelDomainAgreementOption.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/topLevelDomainCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/triggeredJobHistory.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/triggeredJobHistoryCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/triggeredJobRun.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/triggeredWebJob.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/triggeredWebJobCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/usage.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/usageCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/user.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/validateRequest.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/validateResponse.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/validateResponseError.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/virtualApplication.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/virtualDirectory.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/virtualIPMapping.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/virtualNetworkProfile.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/vnetGateway.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/vnetInfo.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/vnetParameters.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/vnetRoute.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/vnetValidationFailureDetails.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/vnetValidationTestFailure.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/webAppCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/webAppInstanceCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/webJob.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/webJobCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/workerPool.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/workerPoolCollection.js delete mode 100644 lib/services/websiteManagement2/lib/lib/models/workerPoolResource.js delete mode 100644 lib/services/websiteManagement2/lib/lib/operations/appServiceCertificateOrders.js delete mode 100644 lib/services/websiteManagement2/lib/lib/operations/appServiceEnvironments.js delete mode 100644 lib/services/websiteManagement2/lib/lib/operations/appServicePlans.js delete mode 100644 lib/services/websiteManagement2/lib/lib/operations/billingMeters.js delete mode 100644 lib/services/websiteManagement2/lib/lib/operations/certificateRegistrationProvider.js delete mode 100644 lib/services/websiteManagement2/lib/lib/operations/certificates.js delete mode 100644 lib/services/websiteManagement2/lib/lib/operations/deletedWebApps.js delete mode 100644 lib/services/websiteManagement2/lib/lib/operations/diagnostics.js delete mode 100644 lib/services/websiteManagement2/lib/lib/operations/domainRegistrationProvider.js delete mode 100644 lib/services/websiteManagement2/lib/lib/operations/domains.js delete mode 100644 lib/services/websiteManagement2/lib/lib/operations/index.d.ts delete mode 100644 lib/services/websiteManagement2/lib/lib/operations/index.js delete mode 100644 lib/services/websiteManagement2/lib/lib/operations/provider.js delete mode 100644 lib/services/websiteManagement2/lib/lib/operations/recommendations.js delete mode 100644 lib/services/websiteManagement2/lib/lib/operations/resourceHealthMetadataOperations.js delete mode 100644 lib/services/websiteManagement2/lib/lib/operations/topLevelDomains.js delete mode 100644 lib/services/websiteManagement2/lib/lib/operations/webApps.js delete mode 100644 lib/services/websiteManagement2/lib/lib/webSiteManagementClient.d.ts delete mode 100644 lib/services/websiteManagement2/lib/lib/webSiteManagementClient.js delete mode 100644 lib/services/websiteManagement2/lib/package.json diff --git a/lib/services/webSiteManagement2/package-lock.json b/lib/services/webSiteManagement2/package-lock.json new file mode 100644 index 0000000000..cc9efc54b8 --- /dev/null +++ b/lib/services/webSiteManagement2/package-lock.json @@ -0,0 +1,578 @@ +{ + "name": "azure-arm-website", + "version": "4.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "@types/node": { + "version": "8.10.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.2.tgz", + "integrity": "sha512-A6Uv1anbsCvrRDtaUXS2xZ5tlzD+Kg7yMRlSLFDy3z0r7KlGXDzL14vELXIAgpk2aJbU3XeZZQRcEkLkowT92g==" + }, + "@types/uuid": { + "version": "3.4.3", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-3.4.3.tgz", + "integrity": "sha512-5fRLCYhLtDb3hMWqQyH10qtF+Ud2JnNCXTCZ+9ktNdCcgslcuXkDTkFcJNk++MT29yDntDnlF1+jD+uVGumsbw==", + "requires": { + "@types/node": "*" + } + }, + "adal-node": { + "version": "0.1.28", + "resolved": "https://registry.npmjs.org/adal-node/-/adal-node-0.1.28.tgz", + "integrity": "sha1-RoxLs+u9lrEnBmn0ucuk4AZepIU=", + "requires": { + "@types/node": "^8.0.47", + "async": ">=0.6.0", + "date-utils": "*", + "jws": "3.x.x", + "request": ">= 2.52.0", + "underscore": ">= 1.3.1", + "uuid": "^3.1.0", + "xmldom": ">= 0.1.x", + "xpath.js": "~1.1.0" + } + }, + "ajv": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", + "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "requires": { + "co": "^4.6.0", + "fast-deep-equal": "^1.0.0", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.3.0" + } + }, + "asn1": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz", + "integrity": "sha1-2sh4dxPJlmhJ/IGAd36+nB3fO4Y=" + }, + "assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=" + }, + "async": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/async/-/async-2.6.0.tgz", + "integrity": "sha512-xAfGg1/NTLBBKlHFmnd7PlmUW9KhVQIUuSrYem9xzFUZy13ScvtyGGejaae9iAVRiRq9+Cx7DPFaAAhCpyxyPw==", + "requires": { + "lodash": "^4.14.0" + } + }, + "asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" + }, + "aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" + }, + "aws4": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", + "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=" + }, + "base64url": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/base64url/-/base64url-2.0.0.tgz", + "integrity": "sha1-6sFuA+oUOO/5Qj1puqNiYu0fcLs=" + }, + "bcrypt-pbkdf": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", + "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "optional": true, + "requires": { + "tweetnacl": "^0.14.3" + } + }, + "boom": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", + "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", + "requires": { + "hoek": "4.x.x" + } + }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" + }, + "caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" + }, + "co": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", + "integrity": "sha1-bqa989hTrlTMuOR7+gvz+QMfsYQ=" + }, + "combined-stream": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", + "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", + "requires": { + "delayed-stream": "~1.0.0" + } + }, + "core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" + }, + "cryptiles": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", + "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", + "requires": { + "boom": "5.x.x" + }, + "dependencies": { + "boom": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", + "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", + "requires": { + "hoek": "4.x.x" + } + } + } + }, + "dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "date-utils": { + "version": "1.2.21", + "resolved": "https://registry.npmjs.org/date-utils/-/date-utils-1.2.21.tgz", + "integrity": "sha1-YfsWzcEnSzyayq/+n8ad+HIKK2Q=" + }, + "delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" + }, + "duplexer": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", + "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=" + }, + "ecc-jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz", + "integrity": "sha1-D8c6ntXw1Tw4GTOYUj735UN3dQU=", + "optional": true, + "requires": { + "jsbn": "~0.1.0" + } + }, + "ecdsa-sig-formatter": { + "version": "1.0.9", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.9.tgz", + "integrity": "sha1-S8kmJ07Dtau1AW5+HWCSGsJisqE=", + "requires": { + "base64url": "^2.0.0", + "safe-buffer": "^5.0.1" + } + }, + "extend": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", + "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" + }, + "extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=" + }, + "fast-deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", + "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=" + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=" + }, + "forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=" + }, + "form-data": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", + "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "requires": { + "asynckit": "^0.4.0", + "combined-stream": "1.0.6", + "mime-types": "^2.1.12" + } + }, + "getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "requires": { + "assert-plus": "^1.0.0" + } + }, + "har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=" + }, + "har-validator": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.0.3.tgz", + "integrity": "sha1-ukAsJmGU8VlW7xXg/PJCmT9qff0=", + "requires": { + "ajv": "^5.1.0", + "har-schema": "^2.0.0" + } + }, + "hawk": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", + "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", + "requires": { + "boom": "4.x.x", + "cryptiles": "3.x.x", + "hoek": "4.x.x", + "sntp": "2.x.x" + } + }, + "hoek": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", + "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==" + }, + "http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "requires": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + } + }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=" + }, + "isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" + }, + "jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "optional": true + }, + "json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=" + }, + "json-schema-traverse": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", + "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=" + }, + "json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" + }, + "jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "requires": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "jwa": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.5.tgz", + "integrity": "sha1-oFUs4CIHQs1S4VN3SjKQXDDnVuU=", + "requires": { + "base64url": "2.0.0", + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.9", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "3.1.4", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.1.4.tgz", + "integrity": "sha1-+ei5M46KhHJ31kRLFGT2GIDgUKI=", + "requires": { + "base64url": "^2.0.0", + "jwa": "^1.1.4", + "safe-buffer": "^5.0.1" + } + }, + "lodash": { + "version": "4.17.5", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", + "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==" + }, + "mime-db": { + "version": "1.33.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", + "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==" + }, + "mime-types": { + "version": "2.1.18", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", + "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "requires": { + "mime-db": "~1.33.0" + } + }, + "moment": { + "version": "2.22.0", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.0.tgz", + "integrity": "sha512-1muXCh8jb1N/gHRbn9VDUBr0GYb8A/aVcHlII9QSB68a50spqEVLIGN6KVmCOnSvJrUhC0edGgKU5ofnGXdYdg==" + }, + "ms-rest": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/ms-rest/-/ms-rest-2.3.6.tgz", + "integrity": "sha512-M+Lx9P7Wy4TeAk7jqPLwGS1QS1gvxF6Xo+OHv5j1g3Kcb44T/GTUuSjxTKarF6aKyeacZH1ZD++Nt7pcql7dDA==", + "requires": { + "duplexer": "^0.1.1", + "is-buffer": "^1.1.6", + "is-stream": "^1.1.0", + "moment": "^2.21.0", + "request": "^2.87.0", + "through": "^2.3.8", + "tunnel": "0.0.5", + "uuid": "^3.2.1" + }, + "dependencies": { + "request": { + "version": "2.87.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz", + "integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==", + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.6.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.1", + "forever-agent": "~0.6.1", + "form-data": "~2.3.1", + "har-validator": "~5.0.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.17", + "oauth-sign": "~0.8.2", + "performance-now": "^2.1.0", + "qs": "~6.5.1", + "safe-buffer": "^5.1.1", + "tough-cookie": "~2.3.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.1.0" + } + } + } + }, + "ms-rest-azure": { + "version": "2.5.5", + "resolved": "https://registry.npmjs.org/ms-rest-azure/-/ms-rest-azure-2.5.5.tgz", + "integrity": "sha512-LnP5YlgqvNAOi1x2b4Ru+1ubz/PtYQgNeH74aiolP+Sb5lpOw5ewzbncXae1pR5OWu9NGwxjX59adzSWosqnzw==", + "requires": { + "@types/node": "^9.4.6", + "@types/uuid": "^3.4.3", + "adal-node": "^0.1.27", + "async": "2.6.0", + "moment": "^2.20.1", + "ms-rest": "^2.3.2", + "uuid": "^3.2.1" + }, + "dependencies": { + "@types/node": { + "version": "9.6.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-9.6.2.tgz", + "integrity": "sha512-UWkRY9X7RQHp5OhhRIIka58/gVVycL1zHZu0OTsT5LI86ABaMOSbUjAl+b0FeDhQcxclrkyft3kW5QWdMRs8wQ==" + } + } + }, + "oauth-sign": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.2.tgz", + "integrity": "sha1-Rqarfwrq2N6unsBWV4C31O/rnUM=" + }, + "performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=" + }, + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" + }, + "qs": { + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", + "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" + }, + "request": { + "version": "2.85.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.85.0.tgz", + "integrity": "sha512-8H7Ehijd4js+s6wuVPLjwORxD4zeuyjYugprdOXlPSqaApmL/QOy+EB/beICHVCHkGMKNh5rvihb5ov+IDw4mg==", + "requires": { + "aws-sign2": "~0.7.0", + "aws4": "^1.6.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.5", + "extend": "~3.0.1", + "forever-agent": "~0.6.1", + "form-data": "~2.3.1", + "har-validator": "~5.0.3", + "hawk": "~6.0.2", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.17", + "oauth-sign": "~0.8.2", + "performance-now": "^2.1.0", + "qs": "~6.5.1", + "safe-buffer": "^5.1.1", + "stringstream": "~0.0.5", + "tough-cookie": "~2.3.3", + "tunnel-agent": "^0.6.0", + "uuid": "^3.1.0" + } + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + }, + "sntp": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", + "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", + "requires": { + "hoek": "4.x.x" + } + }, + "sshpk": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.1.tgz", + "integrity": "sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s=", + "requires": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "tweetnacl": "~0.14.0" + } + }, + "stringstream": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", + "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=" + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + }, + "tough-cookie": { + "version": "2.3.4", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.3.4.tgz", + "integrity": "sha512-TZ6TTfI5NtZnuyy/Kecv+CnoROnyXn2DN97LontgQpCwsX2XyLYCC0ENhYkehSOwAp8rTQKc/NUIF7BkQ5rKLA==", + "requires": { + "punycode": "^1.4.1" + } + }, + "tunnel": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.5.tgz", + "integrity": "sha512-gj5sdqherx4VZKMcBA4vewER7zdK25Td+z1npBqpbDys4eJrLx+SlYjJvq1bDXs2irkuJM5pf8ktaEQVipkrbA==" + }, + "tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "optional": true + }, + "underscore": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", + "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" + }, + "uuid": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", + "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==" + }, + "verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "requires": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "xmldom": { + "version": "0.1.27", + "resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.1.27.tgz", + "integrity": "sha1-1QH5ezvbQDr4757MIFcxh6rawOk=" + }, + "xpath.js": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/xpath.js/-/xpath.js-1.1.0.tgz", + "integrity": "sha512-jg+qkfS4K8E7965sqaUl8mRngXiKb3WZGfONgE18pr03FUQiuSV6G+Ej4tS55B+rIQSFEIw3phdVAQ4pPqNWfQ==" + } + } +} diff --git a/lib/services/websiteManagement2/lib/LICENSE.txt b/lib/services/websiteManagement2/lib/LICENSE.txt deleted file mode 100644 index 5431ba98b9..0000000000 --- a/lib/services/websiteManagement2/lib/LICENSE.txt +++ /dev/null @@ -1,21 +0,0 @@ -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/lib/lib/models/abnormalTimePeriod.js b/lib/services/websiteManagement2/lib/lib/models/abnormalTimePeriod.js deleted file mode 100644 index 2a371f061c..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/abnormalTimePeriod.js +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Class representing 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/lib/models/address.js b/lib/services/websiteManagement2/lib/lib/models/address.js deleted file mode 100644 index 31450935e3..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/address.js +++ /dev/null @@ -1,92 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/addressResponse.js b/lib/services/websiteManagement2/lib/lib/models/addressResponse.js deleted file mode 100644 index e8d64bc744..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/addressResponse.js +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/analysisData.js b/lib/services/websiteManagement2/lib/lib/models/analysisData.js deleted file mode 100644 index 244cbfcee4..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/analysisData.js +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Class Representing 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/lib/models/analysisDefinition.js b/lib/services/websiteManagement2/lib/lib/models/analysisDefinition.js deleted file mode 100644 index 66545279fd..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/analysisDefinition.js +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/apiDefinitionInfo.js b/lib/services/websiteManagement2/lib/lib/models/apiDefinitionInfo.js deleted file mode 100644 index c7bc43edc4..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/apiDefinitionInfo.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/appServiceCertificate.js b/lib/services/websiteManagement2/lib/lib/models/appServiceCertificate.js deleted file mode 100644 index 299b1210d7..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/appServiceCertificate.js +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/appServiceCertificateCollection.js b/lib/services/websiteManagement2/lib/lib/models/appServiceCertificateCollection.js deleted file mode 100644 index 5ca5f99e91..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/appServiceCertificateCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/appServiceCertificateOrder.js b/lib/services/websiteManagement2/lib/lib/models/appServiceCertificateOrder.js deleted file mode 100644 index 4adc193a58..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/appServiceCertificateOrder.js +++ /dev/null @@ -1,337 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/appServiceCertificateOrderCollection.js b/lib/services/websiteManagement2/lib/lib/models/appServiceCertificateOrderCollection.js deleted file mode 100644 index 6f45eabab2..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/appServiceCertificateOrderCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/appServiceCertificateOrderPatchResource.js b/lib/services/websiteManagement2/lib/lib/models/appServiceCertificateOrderPatchResource.js deleted file mode 100644 index 2601b56004..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/appServiceCertificateOrderPatchResource.js +++ /dev/null @@ -1,316 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/appServiceCertificatePatchResource.js b/lib/services/websiteManagement2/lib/lib/models/appServiceCertificatePatchResource.js deleted file mode 100644 index 6abc5ec0e5..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/appServiceCertificatePatchResource.js +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/appServiceCertificateResource.js b/lib/services/websiteManagement2/lib/lib/models/appServiceCertificateResource.js deleted file mode 100644 index b55a592086..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/appServiceCertificateResource.js +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/appServiceEnvironment.js b/lib/services/websiteManagement2/lib/lib/models/appServiceEnvironment.js deleted file mode 100644 index af47066e3f..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/appServiceEnvironment.js +++ /dev/null @@ -1,444 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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 - */ - 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' - } - } - } - } - } - } - }; - } -} - -module.exports = AppServiceEnvironment; diff --git a/lib/services/websiteManagement2/lib/lib/models/appServiceEnvironmentCollection.js b/lib/services/websiteManagement2/lib/lib/models/appServiceEnvironmentCollection.js deleted file mode 100644 index 7c44f399b6..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/appServiceEnvironmentCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/appServiceEnvironmentPatchResource.js b/lib/services/websiteManagement2/lib/lib/models/appServiceEnvironmentPatchResource.js deleted file mode 100644 index 990549c0b2..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/appServiceEnvironmentPatchResource.js +++ /dev/null @@ -1,478 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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 - */ - 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' - } - } - } - } - } - } - }; - } -} - -module.exports = AppServiceEnvironmentPatchResource; diff --git a/lib/services/websiteManagement2/lib/lib/models/appServiceEnvironmentResource.js b/lib/services/websiteManagement2/lib/lib/models/appServiceEnvironmentResource.js deleted file mode 100644 index 458a7a0309..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/appServiceEnvironmentResource.js +++ /dev/null @@ -1,499 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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 - */ - 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' - } - } - } - } - } - } - }; - } -} - -module.exports = AppServiceEnvironmentResource; diff --git a/lib/services/websiteManagement2/lib/lib/models/appServicePlan.js b/lib/services/websiteManagement2/lib/lib/models/appServicePlan.js deleted file mode 100644 index b8ecc0f0b9..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/appServicePlan.js +++ /dev/null @@ -1,296 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * App Service plan. - * - * @extends models['Resource'] - */ -class AppServicePlan extends models['Resource'] { - /** - * Create a AppServicePlan. - * @member {string} appServicePlanName Name for the App Service plan. - * @member {string} [workerTierName] Target worker tier assigned to the App - * Service plan. - * @member {string} [status] App Service plan status. Possible values - * include: 'Ready', 'Pending', 'Creating' - * @member {string} [subscription] App Service plan subscription. - * @member {string} [adminSiteName] App Service plan administration site. - * @member {object} [hostingEnvironmentProfile] Specification for the App - * Service Environment to use for the App Service plan. - * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App - * Service Environment. - * @member {string} [hostingEnvironmentProfile.name] Name of the App Service - * Environment. - * @member {string} [hostingEnvironmentProfile.type] Resource type of the App - * Service Environment. - * @member {number} [maximumNumberOfWorkers] Maximum number of instances that - * can be assigned to this App Service plan. - * @member {string} [geoRegion] Geographical location for the App Service - * plan. - * @member {boolean} [perSiteScaling] If true, apps assigned to - * this App Service plan can be scaled independently. - * If false, apps assigned to this App Service plan will scale - * to all instances of the plan. Default value: false . - * @member {number} [numberOfSites] Number of apps assigned to this App - * Service plan. - * @member {boolean} [isSpot] If true, this App Service Plan - * owns spot instances. - * @member {date} [spotExpirationTime] The time when the server farm expires. - * Valid only if it is a spot server farm. - * @member {string} [resourceGroup] Resource group of the App Service plan. - * @member {boolean} [reserved] If Linux 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' - } - } - } - }, - appServicePlanName: { - required: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, - workerTierName: { - required: false, - serializedName: 'properties.workerTierName', - type: { - name: 'String' - } - }, - status: { - required: false, - readOnly: true, - serializedName: 'properties.status', - type: { - name: 'Enum', - allowedValues: [ 'Ready', 'Pending', 'Creating' ] - } - }, - subscription: { - required: false, - readOnly: true, - serializedName: 'properties.subscription', - type: { - name: 'String' - } - }, - adminSiteName: { - required: false, - serializedName: 'properties.adminSiteName', - type: { - name: 'String' - } - }, - hostingEnvironmentProfile: { - required: false, - serializedName: 'properties.hostingEnvironmentProfile', - type: { - name: 'Composite', - className: 'HostingEnvironmentProfile' - } - }, - maximumNumberOfWorkers: { - required: false, - readOnly: true, - serializedName: 'properties.maximumNumberOfWorkers', - type: { - name: 'Number' - } - }, - geoRegion: { - required: false, - readOnly: true, - serializedName: 'properties.geoRegion', - type: { - name: 'String' - } - }, - perSiteScaling: { - required: false, - serializedName: 'properties.perSiteScaling', - defaultValue: false, - type: { - name: 'Boolean' - } - }, - numberOfSites: { - required: false, - readOnly: true, - serializedName: 'properties.numberOfSites', - type: { - name: 'Number' - } - }, - isSpot: { - required: false, - serializedName: 'properties.isSpot', - type: { - name: 'Boolean' - } - }, - spotExpirationTime: { - required: false, - serializedName: 'properties.spotExpirationTime', - type: { - name: 'DateTime' - } - }, - resourceGroup: { - required: false, - readOnly: true, - serializedName: 'properties.resourceGroup', - type: { - name: 'String' - } - }, - reserved: { - required: false, - serializedName: 'properties.reserved', - 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/lib/models/appServicePlanCollection.js b/lib/services/websiteManagement2/lib/lib/models/appServicePlanCollection.js deleted file mode 100644 index 620bda3ea5..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/appServicePlanCollection.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = AppServicePlanCollection; diff --git a/lib/services/websiteManagement2/lib/lib/models/appServicePlanPatchResource.js b/lib/services/websiteManagement2/lib/lib/models/appServicePlanPatchResource.js deleted file mode 100644 index e08905aeec..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/appServicePlanPatchResource.js +++ /dev/null @@ -1,248 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * ARM resource for a app service plan. - * - * @extends models['ProxyOnlyResource'] - */ -class AppServicePlanPatchResource extends models['ProxyOnlyResource'] { - /** - * Create a AppServicePlanPatchResource. - * @member {string} appServicePlanPatchResourceName Name for the App Service - * plan. - * @member {string} [workerTierName] Target worker tier assigned to the App - * Service plan. - * @member {string} [status] App Service plan status. Possible values - * include: 'Ready', 'Pending', 'Creating' - * @member {string} [subscription] App Service plan subscription. - * @member {string} [adminSiteName] App Service plan administration site. - * @member {object} [hostingEnvironmentProfile] Specification for the App - * Service Environment to use for the App Service plan. - * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App - * Service Environment. - * @member {string} [hostingEnvironmentProfile.name] Name of the App Service - * Environment. - * @member {string} [hostingEnvironmentProfile.type] Resource type of the App - * Service Environment. - * @member {number} [maximumNumberOfWorkers] Maximum number of instances that - * can be assigned to this App Service plan. - * @member {string} [geoRegion] Geographical location for the App Service - * plan. - * @member {boolean} [perSiteScaling] If true, apps assigned to - * this App Service plan can be scaled independently. - * If false, apps assigned to this App Service plan will scale - * to all instances of the plan. Default value: false . - * @member {number} [numberOfSites] Number of apps assigned to this App - * Service plan. - * @member {boolean} [isSpot] If true, this App Service Plan - * owns spot instances. - * @member {date} [spotExpirationTime] The time when the server farm expires. - * Valid only if it is a spot server farm. - * @member {string} [resourceGroup] Resource group of the App Service plan. - * @member {boolean} [reserved] If Linux 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' - } - }, - appServicePlanPatchResourceName: { - required: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, - workerTierName: { - required: false, - serializedName: 'properties.workerTierName', - type: { - name: 'String' - } - }, - status: { - required: false, - readOnly: true, - serializedName: 'properties.status', - type: { - name: 'Enum', - allowedValues: [ 'Ready', 'Pending', 'Creating' ] - } - }, - subscription: { - required: false, - readOnly: true, - serializedName: 'properties.subscription', - type: { - name: 'String' - } - }, - adminSiteName: { - required: false, - serializedName: 'properties.adminSiteName', - type: { - name: 'String' - } - }, - hostingEnvironmentProfile: { - required: false, - serializedName: 'properties.hostingEnvironmentProfile', - type: { - name: 'Composite', - className: 'HostingEnvironmentProfile' - } - }, - maximumNumberOfWorkers: { - required: false, - readOnly: true, - serializedName: 'properties.maximumNumberOfWorkers', - type: { - name: 'Number' - } - }, - geoRegion: { - required: false, - readOnly: true, - serializedName: 'properties.geoRegion', - type: { - name: 'String' - } - }, - perSiteScaling: { - required: false, - serializedName: 'properties.perSiteScaling', - defaultValue: false, - type: { - name: 'Boolean' - } - }, - numberOfSites: { - required: false, - readOnly: true, - serializedName: 'properties.numberOfSites', - type: { - name: 'Number' - } - }, - isSpot: { - required: false, - serializedName: 'properties.isSpot', - type: { - name: 'Boolean' - } - }, - spotExpirationTime: { - required: false, - serializedName: 'properties.spotExpirationTime', - type: { - name: 'DateTime' - } - }, - resourceGroup: { - required: false, - readOnly: true, - serializedName: 'properties.resourceGroup', - type: { - name: 'String' - } - }, - reserved: { - required: false, - serializedName: 'properties.reserved', - 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/lib/models/applicationLogsConfig.js b/lib/services/websiteManagement2/lib/lib/models/applicationLogsConfig.js deleted file mode 100644 index f807ba5142..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/applicationLogsConfig.js +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/applicationStack.js b/lib/services/websiteManagement2/lib/lib/models/applicationStack.js deleted file mode 100644 index 0a52694422..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/applicationStack.js +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/applicationStackCollection.js b/lib/services/websiteManagement2/lib/lib/models/applicationStackCollection.js deleted file mode 100644 index 03e5ff0ee5..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/applicationStackCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/autoHealActions.js b/lib/services/websiteManagement2/lib/lib/models/autoHealActions.js deleted file mode 100644 index c88cabffef..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/autoHealActions.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/autoHealCustomAction.js b/lib/services/websiteManagement2/lib/lib/models/autoHealCustomAction.js deleted file mode 100644 index d60d7dc348..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/autoHealCustomAction.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/autoHealRules.js b/lib/services/websiteManagement2/lib/lib/models/autoHealRules.js deleted file mode 100644 index 345b953e39..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/autoHealRules.js +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/autoHealTriggers.js b/lib/services/websiteManagement2/lib/lib/models/autoHealTriggers.js deleted file mode 100644 index 7d60dca06e..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/autoHealTriggers.js +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/azureBlobStorageApplicationLogsConfig.js b/lib/services/websiteManagement2/lib/lib/models/azureBlobStorageApplicationLogsConfig.js deleted file mode 100644 index 34571a8b2d..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/azureBlobStorageApplicationLogsConfig.js +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/azureBlobStorageHttpLogsConfig.js b/lib/services/websiteManagement2/lib/lib/models/azureBlobStorageHttpLogsConfig.js deleted file mode 100644 index e7d85bf50e..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/azureBlobStorageHttpLogsConfig.js +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/azureTableStorageApplicationLogsConfig.js b/lib/services/websiteManagement2/lib/lib/models/azureTableStorageApplicationLogsConfig.js deleted file mode 100644 index ae109442ed..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/azureTableStorageApplicationLogsConfig.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/backupItem.js b/lib/services/websiteManagement2/lib/lib/models/backupItem.js deleted file mode 100644 index abff5af787..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/backupItem.js +++ /dev/null @@ -1,223 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/backupItemCollection.js b/lib/services/websiteManagement2/lib/lib/models/backupItemCollection.js deleted file mode 100644 index 769f26fe98..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/backupItemCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/backupRequest.js b/lib/services/websiteManagement2/lib/lib/models/backupRequest.js deleted file mode 100644 index dba65bf110..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/backupRequest.js +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Description of a backup which will be performed. - * - * @extends models['ProxyOnlyResource'] - */ -class BackupRequest extends models['ProxyOnlyResource'] { - /** - * Create a BackupRequest. - * @member {string} backupRequestName 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. - * @member {string} [backupRequestType] Type of the backup. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' - */ - 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' - } - }, - backupRequestName: { - required: true, - serializedName: 'properties.name', - 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' - } - } - } - }, - backupRequestType: { - required: false, - serializedName: 'properties.type', - type: { - name: 'Enum', - allowedValues: [ 'Default', 'Clone', 'Relocation', 'Snapshot' ] - } - } - } - } - }; - } -} - -module.exports = BackupRequest; diff --git a/lib/services/websiteManagement2/lib/lib/models/backupSchedule.js b/lib/services/websiteManagement2/lib/lib/models/backupSchedule.js deleted file mode 100644 index b8d86ca61a..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/backupSchedule.js +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/billingMeter.js b/lib/services/websiteManagement2/lib/lib/models/billingMeter.js deleted file mode 100644 index 14229378b7..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/billingMeter.js +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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 resource 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' - } - } - } - } - }; - } -} - -module.exports = BillingMeter; diff --git a/lib/services/websiteManagement2/lib/lib/models/billingMeterCollection.js b/lib/services/websiteManagement2/lib/lib/models/billingMeterCollection.js deleted file mode 100644 index 731a97562d..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/billingMeterCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/capability.js b/lib/services/websiteManagement2/lib/lib/models/capability.js deleted file mode 100644 index 1d81f3149e..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/capability.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/certificate.js b/lib/services/websiteManagement2/lib/lib/models/certificate.js deleted file mode 100644 index 200bd1eaf4..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/certificate.js +++ /dev/null @@ -1,297 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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} [geoRegion] Region of the certificate. - * @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' ] - } - }, - geoRegion: { - required: false, - readOnly: true, - serializedName: 'properties.geoRegion', - type: { - name: 'String' - } - }, - serverFarmId: { - required: false, - serializedName: 'properties.serverFarmId', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = Certificate; diff --git a/lib/services/websiteManagement2/lib/lib/models/certificateCollection.js b/lib/services/websiteManagement2/lib/lib/models/certificateCollection.js deleted file mode 100644 index 43f9fd446c..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/certificateCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/certificateDetails.js b/lib/services/websiteManagement2/lib/lib/models/certificateDetails.js deleted file mode 100644 index affae5c9fc..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/certificateDetails.js +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/certificateEmail.js b/lib/services/websiteManagement2/lib/lib/models/certificateEmail.js deleted file mode 100644 index 5ffdc8fae5..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/certificateEmail.js +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/certificateOrderAction.js b/lib/services/websiteManagement2/lib/lib/models/certificateOrderAction.js deleted file mode 100644 index fc3635e0c7..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/certificateOrderAction.js +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Certificate order action. - * - * @extends models['ProxyOnlyResource'] - */ -class CertificateOrderAction extends models['ProxyOnlyResource'] { - /** - * Create a CertificateOrderAction. - * @member {string} [certificateOrderActionType] 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' - } - }, - certificateOrderActionType: { - required: false, - serializedName: 'properties.type', - type: { - name: 'Enum', - allowedValues: [ 'CertificateIssued', 'CertificateOrderCanceled', 'CertificateOrderCreated', 'CertificateRevoked', 'DomainValidationComplete', 'FraudDetected', 'OrgNameChange', 'OrgValidationComplete', 'SanDrop', 'FraudCleared', 'CertificateExpired', 'CertificateExpirationWarning', 'FraudDocumentationRequired', 'Unknown' ] - } - }, - createdAt: { - required: false, - serializedName: 'properties.createdAt', - type: { - name: 'DateTime' - } - } - } - } - }; - } -} - -module.exports = CertificateOrderAction; diff --git a/lib/services/websiteManagement2/lib/lib/models/certificatePatchResource.js b/lib/services/websiteManagement2/lib/lib/models/certificatePatchResource.js deleted file mode 100644 index e68d49ee1a..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/certificatePatchResource.js +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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} [geoRegion] Region of the certificate. - * @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' ] - } - }, - geoRegion: { - required: false, - readOnly: true, - serializedName: 'properties.geoRegion', - type: { - name: 'String' - } - }, - serverFarmId: { - required: false, - serializedName: 'properties.serverFarmId', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = CertificatePatchResource; diff --git a/lib/services/websiteManagement2/lib/lib/models/cloningInfo.js b/lib/services/websiteManagement2/lib/lib/models/cloningInfo.js deleted file mode 100644 index 868a356c16..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/cloningInfo.js +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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. - * @member {boolean} [ignoreQuotas] true if quotas should be - * ignored; otherwise, false. - */ - 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' - } - }, - ignoreQuotas: { - required: false, - serializedName: 'ignoreQuotas', - type: { - name: 'Boolean' - } - } - } - } - }; - } -} - -module.exports = CloningInfo; diff --git a/lib/services/websiteManagement2/lib/lib/models/connStringInfo.js b/lib/services/websiteManagement2/lib/lib/models/connStringInfo.js deleted file mode 100644 index e45a358633..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/connStringInfo.js +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/connStringValueTypePair.js b/lib/services/websiteManagement2/lib/lib/models/connStringValueTypePair.js deleted file mode 100644 index b2d1bf7ca1..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/connStringValueTypePair.js +++ /dev/null @@ -1,63 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/connectionStringDictionary.js b/lib/services/websiteManagement2/lib/lib/models/connectionStringDictionary.js deleted file mode 100644 index 4166de86d0..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/connectionStringDictionary.js +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/contact.js b/lib/services/websiteManagement2/lib/lib/models/contact.js deleted file mode 100644 index c2d29b5130..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/contact.js +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/continuousWebJob.js b/lib/services/websiteManagement2/lib/lib/models/continuousWebJob.js deleted file mode 100644 index ffba08bca7..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/continuousWebJob.js +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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} [continuousWebJobName] Job name. Used as job identifier - * in ARM resource URI. - * @member {string} [runCommand] Run command. - * @member {string} [url] Job URL. - * @member {string} [extraInfoUrl] Extra Info URL. - * @member {string} [jobType] 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.detailedStatus', - type: { - name: 'String' - } - }, - logUrl: { - required: false, - serializedName: 'properties.logUrl', - type: { - name: 'String' - } - }, - continuousWebJobName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, - runCommand: { - required: false, - serializedName: 'properties.runCommand', - type: { - name: 'String' - } - }, - url: { - required: false, - serializedName: 'properties.url', - type: { - name: 'String' - } - }, - extraInfoUrl: { - required: false, - serializedName: 'properties.extraInfoUrl', - type: { - name: 'String' - } - }, - jobType: { - required: false, - serializedName: 'properties.jobType', - type: { - name: 'Enum', - allowedValues: [ 'Continuous', 'Triggered' ] - } - }, - error: { - required: false, - serializedName: 'properties.error', - type: { - name: 'String' - } - }, - usingSdk: { - required: false, - serializedName: 'properties.usingSdk', - 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/lib/models/continuousWebJobCollection.js b/lib/services/websiteManagement2/lib/lib/models/continuousWebJobCollection.js deleted file mode 100644 index 99a440181a..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/continuousWebJobCollection.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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, - serializedName: 'nextLink', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ContinuousWebJobCollection; diff --git a/lib/services/websiteManagement2/lib/lib/models/corsSettings.js b/lib/services/websiteManagement2/lib/lib/models/corsSettings.js deleted file mode 100644 index 888cff3aac..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/corsSettings.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/csmMoveResourceEnvelope.js b/lib/services/websiteManagement2/lib/lib/models/csmMoveResourceEnvelope.js deleted file mode 100644 index fef33a9910..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/csmMoveResourceEnvelope.js +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/csmOperationCollection.js b/lib/services/websiteManagement2/lib/lib/models/csmOperationCollection.js deleted file mode 100644 index 24c2e9b665..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/csmOperationCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/csmOperationDescription.js b/lib/services/websiteManagement2/lib/lib/models/csmOperationDescription.js deleted file mode 100644 index 9375a0b953..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/csmOperationDescription.js +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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] - */ - 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/lib/models/csmOperationDescriptionProperties.js b/lib/services/websiteManagement2/lib/lib/models/csmOperationDescriptionProperties.js deleted file mode 100644 index 77631076bc..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/csmOperationDescriptionProperties.js +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Properties available for a Microsoft.Web resource provider operation. - * - */ -class CsmOperationDescriptionProperties { - /** - * Create a CsmOperationDescriptionProperties. - * @member {object} [serviceSpecification] - * @member {array} [serviceSpecification.metricSpecifications] - */ - 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/lib/models/csmOperationDisplay.js b/lib/services/websiteManagement2/lib/lib/models/csmOperationDisplay.js deleted file mode 100644 index fa90f6c44d..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/csmOperationDisplay.js +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/csmPublishingProfileOptions.js b/lib/services/websiteManagement2/lib/lib/models/csmPublishingProfileOptions.js deleted file mode 100644 index 1311235ff5..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/csmPublishingProfileOptions.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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' - */ - 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' - } - } - } - } - }; - } -} - -module.exports = CsmPublishingProfileOptions; diff --git a/lib/services/websiteManagement2/lib/lib/models/csmSlotEntity.js b/lib/services/websiteManagement2/lib/lib/models/csmSlotEntity.js deleted file mode 100644 index 286ea2fdd5..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/csmSlotEntity.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/csmUsageQuota.js b/lib/services/websiteManagement2/lib/lib/models/csmUsageQuota.js deleted file mode 100644 index 9d8687b3bc..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/csmUsageQuota.js +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/csmUsageQuotaCollection.js b/lib/services/websiteManagement2/lib/lib/models/csmUsageQuotaCollection.js deleted file mode 100644 index 80459abab5..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/csmUsageQuotaCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/customHostnameAnalysisResult.js b/lib/services/websiteManagement2/lib/lib/models/customHostnameAnalysisResult.js deleted file mode 100644 index e141ca367e..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/customHostnameAnalysisResult.js +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/dataSource.js b/lib/services/websiteManagement2/lib/lib/models/dataSource.js deleted file mode 100644 index 1e4d2a6438..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/dataSource.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Class representing 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/lib/models/databaseBackupSetting.js b/lib/services/websiteManagement2/lib/lib/models/databaseBackupSetting.js deleted file mode 100644 index 09b9255796..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/databaseBackupSetting.js +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/defaultErrorResponse.js b/lib/services/websiteManagement2/lib/lib/models/defaultErrorResponse.js deleted file mode 100644 index 7626a48a16..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/defaultErrorResponse.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/defaultErrorResponseError.js b/lib/services/websiteManagement2/lib/lib/models/defaultErrorResponseError.js deleted file mode 100644 index 678b354c64..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/defaultErrorResponseError.js +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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: true, - readOnly: true, - serializedName: 'code', - type: { - name: 'String' - } - }, - message: { - required: true, - 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/lib/models/defaultErrorResponseErrorDetailsItem.js b/lib/services/websiteManagement2/lib/lib/models/defaultErrorResponseErrorDetailsItem.js deleted file mode 100644 index f5f3609ef2..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/defaultErrorResponseErrorDetailsItem.js +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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: true, - readOnly: true, - serializedName: 'code', - type: { - name: 'String' - } - }, - message: { - required: true, - 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/lib/models/deletedSite.js b/lib/services/websiteManagement2/lib/lib/models/deletedSite.js deleted file mode 100644 index 265245476b..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/deletedSite.js +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * A deleted app. - * - */ -class DeletedSite { - /** - * Create a DeletedSite. - * @member {number} [id] 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} [name] Name of the deleted site - * @member {string} [slot] Slot of the deleted site - */ - constructor() { - } - - /** - * 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, - serializedName: 'id', - type: { - name: 'Number' - } - }, - deletedTimestamp: { - required: false, - readOnly: true, - serializedName: 'deletedTimestamp', - type: { - name: 'String' - } - }, - subscription: { - required: false, - readOnly: true, - serializedName: 'subscription', - type: { - name: 'String' - } - }, - resourceGroup: { - required: false, - readOnly: true, - serializedName: 'resourceGroup', - type: { - name: 'String' - } - }, - name: { - required: false, - readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - slot: { - required: false, - readOnly: true, - serializedName: 'slot', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = DeletedSite; diff --git a/lib/services/websiteManagement2/lib/lib/models/deletedWebAppCollection.js b/lib/services/websiteManagement2/lib/lib/models/deletedWebAppCollection.js deleted file mode 100644 index e4e74927f6..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/deletedWebAppCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/deployment.js b/lib/services/websiteManagement2/lib/lib/models/deployment.js deleted file mode 100644 index 052aab349d..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/deployment.js +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * User crendentials used for publishing activity. - * - * @extends models['ProxyOnlyResource'] - */ -class Deployment extends models['ProxyOnlyResource'] { - /** - * Create a Deployment. - * @member {string} [deploymentId] Identifier for 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' - } - }, - deploymentId: { - required: false, - serializedName: 'properties.id', - 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.authorEmail', - type: { - name: 'String' - } - }, - startTime: { - required: false, - serializedName: 'properties.startTime', - type: { - name: 'DateTime' - } - }, - endTime: { - required: false, - serializedName: 'properties.endTime', - 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/lib/models/deploymentCollection.js b/lib/services/websiteManagement2/lib/lib/models/deploymentCollection.js deleted file mode 100644 index a8428276d9..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/deploymentCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/deploymentLocations.js b/lib/services/websiteManagement2/lib/lib/models/deploymentLocations.js deleted file mode 100644 index ad15f8aec8..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/deploymentLocations.js +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/detectorAbnormalTimePeriod.js b/lib/services/websiteManagement2/lib/lib/models/detectorAbnormalTimePeriod.js deleted file mode 100644 index 4d97fd6c60..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/detectorAbnormalTimePeriod.js +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Class representing 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/lib/models/detectorDefinition.js b/lib/services/websiteManagement2/lib/lib/models/detectorDefinition.js deleted file mode 100644 index 0c4aa92814..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/detectorDefinition.js +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Class representing 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/lib/models/diagnosticAnalysis.js b/lib/services/websiteManagement2/lib/lib/models/diagnosticAnalysis.js deleted file mode 100644 index 350a897abb..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/diagnosticAnalysis.js +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Class representing 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/lib/models/diagnosticAnalysisCollection.js b/lib/services/websiteManagement2/lib/lib/models/diagnosticAnalysisCollection.js deleted file mode 100644 index 526e3d5542..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/diagnosticAnalysisCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/diagnosticCategory.js b/lib/services/websiteManagement2/lib/lib/models/diagnosticCategory.js deleted file mode 100644 index f36e3076cc..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/diagnosticCategory.js +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Class representing 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/lib/models/diagnosticCategoryCollection.js b/lib/services/websiteManagement2/lib/lib/models/diagnosticCategoryCollection.js deleted file mode 100644 index fc20ff19c1..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/diagnosticCategoryCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/diagnosticDetectorCollection.js b/lib/services/websiteManagement2/lib/lib/models/diagnosticDetectorCollection.js deleted file mode 100644 index 9b17e34ecb..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/diagnosticDetectorCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/diagnosticDetectorResponse.js b/lib/services/websiteManagement2/lib/lib/models/diagnosticDetectorResponse.js deleted file mode 100644 index 880a1116cf..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/diagnosticDetectorResponse.js +++ /dev/null @@ -1,189 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Class representing 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/lib/models/diagnosticMetricSample.js b/lib/services/websiteManagement2/lib/lib/models/diagnosticMetricSample.js deleted file mode 100644 index 334dc95c9f..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/diagnosticMetricSample.js +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Class representing 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/lib/models/diagnosticMetricSet.js b/lib/services/websiteManagement2/lib/lib/models/diagnosticMetricSet.js deleted file mode 100644 index dec74d0fc2..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/diagnosticMetricSet.js +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Class representing 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/lib/models/dimension.js b/lib/services/websiteManagement2/lib/lib/models/dimension.js deleted file mode 100644 index 53cbe470f0..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/dimension.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/domain.js b/lib/services/websiteManagement2/lib/lib/models/domain.js deleted file mode 100644 index 8eed458789..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/domain.js +++ /dev/null @@ -1,414 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/domainAvailablilityCheckResult.js b/lib/services/websiteManagement2/lib/lib/models/domainAvailablilityCheckResult.js deleted file mode 100644 index 545642c394..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/domainAvailablilityCheckResult.js +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/domainCollection.js b/lib/services/websiteManagement2/lib/lib/models/domainCollection.js deleted file mode 100644 index bd23f8a9b7..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/domainCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/domainControlCenterSsoRequest.js b/lib/services/websiteManagement2/lib/lib/models/domainControlCenterSsoRequest.js deleted file mode 100644 index c383cb4e4a..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/domainControlCenterSsoRequest.js +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/domainOwnershipIdentifier.js b/lib/services/websiteManagement2/lib/lib/models/domainOwnershipIdentifier.js deleted file mode 100644 index 357f342bab..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/domainOwnershipIdentifier.js +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/domainOwnershipIdentifierCollection.js b/lib/services/websiteManagement2/lib/lib/models/domainOwnershipIdentifierCollection.js deleted file mode 100644 index a15ca8300a..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/domainOwnershipIdentifierCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/domainPatchResource.js b/lib/services/websiteManagement2/lib/lib/models/domainPatchResource.js deleted file mode 100644 index 65093da110..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/domainPatchResource.js +++ /dev/null @@ -1,393 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/domainPurchaseConsent.js b/lib/services/websiteManagement2/lib/lib/models/domainPurchaseConsent.js deleted file mode 100644 index 9cd02ca121..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/domainPurchaseConsent.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/domainRecommendationSearchParameters.js b/lib/services/websiteManagement2/lib/lib/models/domainRecommendationSearchParameters.js deleted file mode 100644 index dd3a3b6af9..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/domainRecommendationSearchParameters.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/enabledConfig.js b/lib/services/websiteManagement2/lib/lib/models/enabledConfig.js deleted file mode 100644 index b45f899d15..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/enabledConfig.js +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/errorEntity.js b/lib/services/websiteManagement2/lib/lib/models/errorEntity.js deleted file mode 100644 index 7fe76aef2e..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/errorEntity.js +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/errorResponse.js b/lib/services/websiteManagement2/lib/lib/models/errorResponse.js deleted file mode 100644 index 32e994231a..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/errorResponse.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Error Response. - * - */ -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, - serializedName: 'code', - type: { - name: 'String' - } - }, - message: { - required: false, - serializedName: 'message', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ErrorResponse; diff --git a/lib/services/websiteManagement2/lib/lib/models/experiments.js b/lib/services/websiteManagement2/lib/lib/models/experiments.js deleted file mode 100644 index cf40478e30..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/experiments.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/fileSystemApplicationLogsConfig.js b/lib/services/websiteManagement2/lib/lib/models/fileSystemApplicationLogsConfig.js deleted file mode 100644 index b64d80772f..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/fileSystemApplicationLogsConfig.js +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/fileSystemHttpLogsConfig.js b/lib/services/websiteManagement2/lib/lib/models/fileSystemHttpLogsConfig.js deleted file mode 100644 index e85d48eb3b..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/fileSystemHttpLogsConfig.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/functionEnvelope.js b/lib/services/websiteManagement2/lib/lib/models/functionEnvelope.js deleted file mode 100644 index d7389e080d..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/functionEnvelope.js +++ /dev/null @@ -1,169 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Web Job Information. - * - * @extends models['ProxyOnlyResource'] - */ -class FunctionEnvelope extends models['ProxyOnlyResource'] { - /** - * Create a FunctionEnvelope. - * @member {string} [functionEnvelopeName] Function name. - * @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' - } - }, - functionEnvelopeName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, - functionAppId: { - required: false, - readOnly: true, - serializedName: 'properties.functionAppId', - type: { - name: 'String' - } - }, - scriptRootPathHref: { - required: false, - serializedName: 'properties.scriptRootPathHref', - type: { - name: 'String' - } - }, - scriptHref: { - required: false, - serializedName: 'properties.scriptHref', - type: { - name: 'String' - } - }, - configHref: { - required: false, - serializedName: 'properties.configHref', - type: { - name: 'String' - } - }, - secretsFileHref: { - required: false, - serializedName: 'properties.secretsFileHref', - 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.testData', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = FunctionEnvelope; diff --git a/lib/services/websiteManagement2/lib/lib/models/functionEnvelopeCollection.js b/lib/services/websiteManagement2/lib/lib/models/functionEnvelopeCollection.js deleted file mode 100644 index 11a87f9e7b..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/functionEnvelopeCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/functionSecrets.js b/lib/services/websiteManagement2/lib/lib/models/functionSecrets.js deleted file mode 100644 index 6c33bce188..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/functionSecrets.js +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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.triggerUrl', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = FunctionSecrets; diff --git a/lib/services/websiteManagement2/lib/lib/models/geoRegion.js b/lib/services/websiteManagement2/lib/lib/models/geoRegion.js deleted file mode 100644 index bf004ffc2e..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/geoRegion.js +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Geographical region. - * - * @extends models['ProxyOnlyResource'] - */ -class GeoRegion extends models['ProxyOnlyResource'] { - /** - * Create a GeoRegion. - * @member {string} [geoRegionName] Region name. - * @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' - } - }, - geoRegionName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - 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/lib/models/geoRegionCollection.js b/lib/services/websiteManagement2/lib/lib/models/geoRegionCollection.js deleted file mode 100644 index b4383a4013..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/geoRegionCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/globalCsmSkuDescription.js b/lib/services/websiteManagement2/lib/lib/models/globalCsmSkuDescription.js deleted file mode 100644 index 4e36a7f290..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/globalCsmSkuDescription.js +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/handlerMapping.js b/lib/services/websiteManagement2/lib/lib/models/handlerMapping.js deleted file mode 100644 index ee5dc87e3b..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/handlerMapping.js +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * The 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/lib/models/hostName.js b/lib/services/websiteManagement2/lib/lib/models/hostName.js deleted file mode 100644 index 04e7ae98f7..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/hostName.js +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/hostNameBinding.js b/lib/services/websiteManagement2/lib/lib/models/hostNameBinding.js deleted file mode 100644 index f18fcbe373..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/hostNameBinding.js +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/hostNameBindingCollection.js b/lib/services/websiteManagement2/lib/lib/models/hostNameBindingCollection.js deleted file mode 100644 index 701310c452..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/hostNameBindingCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/hostNameSslState.js b/lib/services/websiteManagement2/lib/lib/models/hostNameSslState.js deleted file mode 100644 index 2158c960f7..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/hostNameSslState.js +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/hostingEnvironmentDeploymentInfo.js b/lib/services/websiteManagement2/lib/lib/models/hostingEnvironmentDeploymentInfo.js deleted file mode 100644 index 08dd21c8d2..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/hostingEnvironmentDeploymentInfo.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/hostingEnvironmentDiagnostics.js b/lib/services/websiteManagement2/lib/lib/models/hostingEnvironmentDiagnostics.js deleted file mode 100644 index 2ea639d385..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/hostingEnvironmentDiagnostics.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/hostingEnvironmentProfile.js b/lib/services/websiteManagement2/lib/lib/models/hostingEnvironmentProfile.js deleted file mode 100644 index e339a1cc17..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/hostingEnvironmentProfile.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/httpLogsConfig.js b/lib/services/websiteManagement2/lib/lib/models/httpLogsConfig.js deleted file mode 100644 index 2636ecd1ff..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/httpLogsConfig.js +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/hybridConnection.js b/lib/services/websiteManagement2/lib/lib/models/hybridConnection.js deleted file mode 100644 index 8c40a4b549..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/hybridConnection.js +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/hybridConnectionCollection.js b/lib/services/websiteManagement2/lib/lib/models/hybridConnectionCollection.js deleted file mode 100644 index ae824224f0..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/hybridConnectionCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/hybridConnectionKey.js b/lib/services/websiteManagement2/lib/lib/models/hybridConnectionKey.js deleted file mode 100644 index 1f4ee6efc7..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/hybridConnectionKey.js +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -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/lib/models/hybridConnectionLimits.js b/lib/services/websiteManagement2/lib/lib/models/hybridConnectionLimits.js deleted file mode 100644 index dcae3a5dc1..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/hybridConnectionLimits.js +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/identifier.js b/lib/services/websiteManagement2/lib/lib/models/identifier.js deleted file mode 100644 index 6f2bbdd90e..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/identifier.js +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/identifierCollection.js b/lib/services/websiteManagement2/lib/lib/models/identifierCollection.js deleted file mode 100644 index 849810dc14..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/identifierCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/index.d.ts b/lib/services/websiteManagement2/lib/lib/models/index.d.ts deleted file mode 100644 index 07caf5ba94..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/index.d.ts +++ /dev/null @@ -1,7284 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -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} [certificateOrderActionType] 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 { - certificateOrderActionType?: string; - 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} [vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * @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 { - vnetRouteName?: string; - 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} [userName] Username - * @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. - */ -export interface User extends ProxyOnlyResource { - userName?: string; - publishingUserName: string; - publishingPassword?: string; - publishingPasswordHash?: string; - publishingPasswordHashSalt?: string; -} - -/** - * @class - * Initializes a new instance of the SnapshotRecoveryTarget class. - * @constructor - * Specifies the web app that snapshot contents will be written to. - * - * @member {string} [location] Geographical location of the target web app, - * e.g. SouthEastAsia, SouthCentralUS - * @member {string} [id] ARM resource ID of the target 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 SnapshotRecoveryTarget { - location?: string; - id?: string; -} - -/** - * @class - * Initializes a new instance of the SnapshotRecoveryRequest class. - * @constructor - * Details about app recovery operation. - * - * @member {string} [snapshotTime] Point in time in which the app recovery - * should be attempted, formatted as a DateTime string. - * @member {object} [recoveryTarget] Specifies the web app that snapshot - * contents will be written to. - * @member {string} [recoveryTarget.location] Geographical location of the - * target web app, e.g. SouthEastAsia, SouthCentralUS - * @member {string} [recoveryTarget.id] ARM resource ID of the target 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 recovery 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 SnapshotRecoveryRequest extends ProxyOnlyResource { - snapshotTime?: string; - recoveryTarget?: SnapshotRecoveryTarget; - overwrite: boolean; - recoverConfiguration?: boolean; - ignoreConflictingHostNames?: boolean; -} - -/** - * @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 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 ResourceMetricDefinition class. - * @constructor - * Metadata for the metrics. - * - * @member {object} [resourceMetricDefinitionName] Name of the metric. - * @member {string} [resourceMetricDefinitionName.value] metric name value. - * @member {string} [resourceMetricDefinitionName.localizedValue] Localized - * metric name value. - * @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 {string} [resourceMetricDefinitionId] Resource ID. - * @member {object} [properties] Resource metric definition properties. - */ -export interface ResourceMetricDefinition extends ProxyOnlyResource { - readonly resourceMetricDefinitionName?: ResourceMetricName; - readonly unit?: string; - readonly primaryAggregationType?: string; - readonly metricAvailabilities?: ResourceMetricAvailability[]; - readonly resourceUri?: string; - readonly resourceMetricDefinitionId?: 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 ManagedServiceIdentity class. - * @constructor - * Managed service identity. - * - * @member {string} [type] Type of managed service identity. Possible values - * include: 'SystemAssigned' - * @member {string} [tenantId] Tenant of managed service identity. - * @member {string} [principalId] Principal Id of managed service identity. - */ -export interface ManagedServiceIdentity { - type?: string; - readonly tenantId?: string; - readonly principalId?: 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. - * @member {boolean} [ignoreQuotas] true if quotas should be - * ignored; otherwise, false. - */ -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; - ignoreQuotas?: boolean; -} - -/** - * @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. - * @member {string} [subnetMask] Subnet mask for the range of IP addresses the - * restriction is valid for. - */ -export interface IpSecurityRestriction { - ipAddress: string; - subnetMask?: 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 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 {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 {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 {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' - */ -export interface SiteConfig { - numberOfWorkers?: number; - defaultDocuments?: string[]; - netFrameworkVersion?: string; - phpVersion?: string; - pythonVersion?: string; - nodeVersion?: string; - linuxFxVersion?: string; - requestTracingEnabled?: boolean; - requestTracingExpirationTime?: Date; - remoteDebuggingEnabled?: boolean; - remoteDebuggingVersion?: string; - httpLoggingEnabled?: boolean; - logsDirectorySizeLimit?: number; - detailedErrorLoggingEnabled?: boolean; - publishingUsername?: string; - appSettings?: NameValuePair[]; - 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; - ipSecurityRestrictions?: IpSecurityRestriction[]; - http20Enabled?: boolean; - minTlsVersion?: string; -} - -/** - * @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 {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 {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 {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 {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 {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 {boolean} [cloningInfo.ignoreQuotas] true if quotas - * should be ignored; otherwise, false. - * @member {object} [snapshotInfo] If specified during app creation, the app is - * created from a previous snapshot. - * @member {string} [snapshotInfo.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * @member {object} [snapshotInfo.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * @member {string} [snapshotInfo.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * @member {string} [snapshotInfo.recoveryTarget.id] ARM resource ID of the - * target 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} [snapshotInfo.overwrite] If true the recovery - * operation can overwrite source app; otherwise, false. - * @member {boolean} [snapshotInfo.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * @member {boolean} [snapshotInfo.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. - * @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' - * @member {string} [identity.tenantId] Tenant of managed service identity. - * @member {string} [identity.principalId] Principal Id of managed service - * identity. - */ -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; - 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; - snapshotInfo?: SnapshotRecoveryRequest; - 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} appServicePlanName Name for the App Service plan. - * @member {string} [workerTierName] Target worker tier assigned to the App - * Service plan. - * @member {string} [status] App Service plan status. Possible values include: - * 'Ready', 'Pending', 'Creating' - * @member {string} [subscription] App Service plan subscription. - * @member {string} [adminSiteName] App Service plan administration site. - * @member {object} [hostingEnvironmentProfile] Specification for the App - * Service Environment to use for the App Service plan. - * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App - * Service Environment. - * @member {string} [hostingEnvironmentProfile.name] Name of the App Service - * Environment. - * @member {string} [hostingEnvironmentProfile.type] Resource type of the App - * Service Environment. - * @member {number} [maximumNumberOfWorkers] Maximum number of instances that - * can be assigned to this App Service plan. - * @member {string} [geoRegion] Geographical location for the App Service plan. - * @member {boolean} [perSiteScaling] If true, apps assigned to - * this App Service plan can be scaled independently. - * If false, apps assigned to this App Service plan will scale to - * all instances of the plan. Default value: false . - * @member {number} [numberOfSites] Number of apps assigned to this App Service - * plan. - * @member {boolean} [isSpot] If true, this App Service Plan owns - * spot instances. - * @member {date} [spotExpirationTime] The time when the server farm expires. - * Valid only if it is a spot server farm. - * @member {string} [resourceGroup] Resource group of the App Service plan. - * @member {boolean} [reserved] If Linux 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 { - appServicePlanName: string; - workerTierName?: string; - readonly status?: string; - readonly subscription?: string; - adminSiteName?: string; - hostingEnvironmentProfile?: HostingEnvironmentProfile; - readonly maximumNumberOfWorkers?: number; - readonly geoRegion?: string; - perSiteScaling?: boolean; - readonly numberOfSites?: number; - isSpot?: boolean; - spotExpirationTime?: Date; - readonly resourceGroup?: string; - reserved?: boolean; - targetWorkerCount?: number; - targetWorkerSizeId?: number; - readonly provisioningState?: string; - sku?: SkuDescription; -} - -/** - * @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 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] - */ -export interface ServiceSpecification { - metricSpecifications?: MetricSpecification[]; -} - -/** - * @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] - */ -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] - */ -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 ErrorResponse class. - * @constructor - * Error Response. - * - * @member {string} [code] Error code. - * @member {string} [message] Error message indicating why the operation - * failed. - */ -export interface ErrorResponse { - code?: string; - message?: string; -} - -/** - * @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 {string} [domainName] Name of the top level domain. - * @member {boolean} [privacy] If true, then the top level domain - * supports domain privacy; otherwise, false. - */ -export interface TopLevelDomain extends ProxyOnlyResource { - readonly domainName?: string; - 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} [geoRegion] Region of the certificate. - * @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; - readonly geoRegion?: 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} [geoRegion] Region of the certificate. - * @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; - readonly geoRegion?: 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: - * 'Default', 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3' - * @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. - */ -export interface StampCapacity { - name?: string; - availableCapacity?: number; - totalCapacity?: number; - unit?: string; - computeMode?: string; - workerSize?: string; - workerSizeId?: number; - excludeFromCapacityAllocation?: boolean; - isApplicableForAllComputeModes?: boolean; - siteMode?: string; -} - -/** - * @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 - */ -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[]; -} - -/** - * @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 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 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 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 DeletedSite class. - * @constructor - * A deleted app. - * - * @member {number} [id] 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} [name] Name of the deleted site - * @member {string} [slot] Slot of the deleted site - */ -export interface DeletedSite { - id?: number; - readonly deletedTimestamp?: string; - readonly subscription?: string; - readonly resourceGroup?: string; - readonly name?: string; - readonly slot?: string; -} - -/** - * @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 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} [tags] The list of category tags that this recommendation - * belongs to. - * @member {string} [actionName] Name of action recommended by this object. - * @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; - tags?: string[]; - actionName?: 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} [recommendationRuleName] 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} [tags] An array of category tags that the rule contains. - * @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 { - recommendationRuleName?: string; - displayName?: string; - message?: string; - recommendationId?: string; - description?: string; - actionName?: string; - level?: string; - channels?: string; - tags?: string[]; - isDynamic?: boolean; - extensionName?: string; - bladeName?: string; - forwardLink?: string; -} - -/** - * @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 BillingMeter class. - * @constructor - * App Service billing entity that contains information about meter which the - * Azure billing system utilizes to charge users for services. - * - * @member {string} [meterId] Meter GUID onboarded in Commerce - * @member {string} [billingLocation] Azure Location of billable resource - * @member {string} [shortName] Short Name from App Service Azure pricing Page - * @member {string} [friendlyName] Friendly name of the meter - * @member {string} [resourceType] App Service resource type meter used for - */ -export interface BillingMeter extends ProxyOnlyResource { - meterId?: string; - billingLocation?: string; - shortName?: string; - friendlyName?: string; - resourceType?: string; -} - -/** - * @class - * Initializes a new instance of the CsmMoveResourceEnvelope class. - * @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} [geoRegionName] Region name. - * @member {string} [description] Region description. - * @member {string} [displayName] Display name for region. - */ -export interface GeoRegion extends ProxyOnlyResource { - readonly geoRegionName?: string; - 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 {string} [premierAddOnOfferName] Premier add on offer Name. - * @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; - premierAddOnOfferName?: 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} [sourceControlName] Name or source control type. - * @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 { - sourceControlName?: string; - 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. - */ -export interface ValidateRequest { - name: string; - type: string; - location: string; - serverFarmId?: string; - skuName?: string; - needLinuxWorkers?: boolean; - isSpot?: boolean; - capacity?: number; - hostingEnvironment?: string; -} - -/** - * @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 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} backupRequestName 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. - * @member {string} [backupRequestType] Type of the backup. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' - */ -export interface BackupRequest extends ProxyOnlyResource { - backupRequestName: string; - enabled?: boolean; - storageAccountUrl: string; - backupSchedule?: BackupSchedule; - databases?: DatabaseBackupSetting[]; - backupRequestType?: string; -} - -/** - * @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} [continuousWebJobName] Job name. Used as job identifier in - * ARM resource URI. - * @member {string} [runCommand] Run command. - * @member {string} [url] Job URL. - * @member {string} [extraInfoUrl] Extra Info URL. - * @member {string} [jobType] 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; - readonly continuousWebJobName?: string; - runCommand?: string; - url?: string; - extraInfoUrl?: string; - jobType?: 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' - */ -export interface CsmPublishingProfileOptions { - format?: string; -} - -/** - * @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 Deployment class. - * @constructor - * User crendentials used for publishing activity. - * - * @member {string} [deploymentId] Identifier for 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. - */ -export interface Deployment extends ProxyOnlyResource { - deploymentId?: string; - 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} [functionEnvelopeName] Function name. - * @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 { - readonly functionEnvelopeName?: string; - readonly functionAppId?: string; - scriptRootPathHref?: string; - scriptHref?: string; - configHref?: string; - secretsFileHref?: string; - href?: string; - config?: any; - files?: { [propertyName: string]: string }; - testData?: string; -} - -/** - * @class - * Initializes a new instance of the FunctionSecrets class. - * @constructor - * Function secrets. - * - * @member {string} [key] Secret key. - * @member {string} [triggerUrl] Trigger URL. - */ -export interface FunctionSecrets extends ProxyOnlyResource { - key?: string; - triggerUrl?: string; -} - -/** - * @class - * Initializes a new instance of the HostNameBinding class. - * @constructor - * A hostname binding object. - * - * @member {string} [siteName] App Service app name. - * @member {string} [domainId] Fully qualified ARM domain resource URI. - * @member {string} [azureResourceName] Azure resource name. - * @member {string} [azureResourceType] Azure resource type. Possible values - * include: 'Website', 'TrafficManager' - * @member {string} [customHostNameDnsRecordType] Custom DNS record type. - * Possible values include: 'CName', 'A' - * @member {string} [hostNameType] Hostname type. Possible values include: - * 'Verified', 'Managed' - * @member {string} [sslState] SSL type. Possible values include: 'Disabled', - * 'SniEnabled', 'IpBasedEnabled' - * @member {string} [thumbprint] SSL certificate thumbprint - * @member {string} [virtualIP] Virtual IP address assigned to the hostname if - * IP based SSL is enabled. - */ -export interface HostNameBinding extends ProxyOnlyResource { - siteName?: string; - domainId?: string; - azureResourceName?: string; - azureResourceType?: string; - customHostNameDnsRecordType?: string; - hostNameType?: string; - sslState?: string; - thumbprint?: string; - readonly virtualIP?: string; -} - -/** - * @class - * Initializes a new instance of the HttpLogsConfig class. - * @constructor - * Http logs configuration. - * - * @member {object} [fileSystem] Http logs to file system configuration. - * @member {number} [fileSystem.retentionInMb] Maximum size in megabytes that - * http log files can use. - * When reached old log files will be removed to make space for new ones. - * Value can range between 25 and 100. - * @member {number} [fileSystem.retentionInDays] Retention in days. - * Remove files older than X days. - * 0 or lower means no retention. - * @member {boolean} [fileSystem.enabled] True if configuration is enabled, - * false if it is disabled and null if configuration is not set. - * @member {object} [azureBlobStorage] Http logs to azure blob storage - * configuration. - * @member {string} [azureBlobStorage.sasUrl] SAS url to a azure blob container - * with read/write/list/delete permissions. - * @member {number} [azureBlobStorage.retentionInDays] Retention in days. - * Remove blobs older than X days. - * 0 or lower means no retention. - * @member {boolean} [azureBlobStorage.enabled] True if configuration is - * enabled, false if it is disabled and null if configuration is not set. - */ -export interface HttpLogsConfig { - fileSystem?: FileSystemHttpLogsConfig; - azureBlobStorage?: AzureBlobStorageHttpLogsConfig; -} - -/** - * @class - * Initializes a new instance of the MSDeploy class. - * @constructor - * MSDeploy ARM PUT information - * - * @member {string} [packageUri] Package URI - * @member {string} [connectionString] SQL Connection String - * @member {string} [dbType] Database Type - * @member {string} [setParametersXmlFileUri] URI of MSDeploy Parameters file. - * Must not be set if SetParameters is used. - * @member {object} [setParameters] MSDeploy Parameters. Must not be set if - * SetParametersXmlFileUri is used. - * @member {boolean} [skipAppData] Controls whether the MSDeploy operation - * skips the App_Data directory. - * If set to true, the existing App_Data directory on the - * destination - * will not be deleted, and any App_Data directory in the source will be - * ignored. - * Setting is false by default. - * @member {boolean} [appOffline] Sets the AppOffline rule while the MSDeploy - * operation executes. - * Setting is false by default. - */ -export interface MSDeploy extends ProxyOnlyResource { - packageUri?: string; - connectionString?: string; - dbType?: string; - setParametersXmlFileUri?: string; - setParameters?: { [propertyName: string]: string }; - skipAppData?: boolean; - appOffline?: boolean; -} - -/** - * @class - * Initializes a new instance of the MSDeployLogEntry class. - * @constructor - * MSDeploy log entry - * - * @member {date} [time] Timestamp of log entry - * @member {string} [type] Log entry type. Possible values include: 'Message', - * 'Warning', 'Error' - * @member {string} [message] Log entry message - */ -export interface MSDeployLogEntry { - readonly time?: Date; - readonly type?: string; - readonly message?: string; -} - -/** - * @class - * Initializes a new instance of the MSDeployLog class. - * @constructor - * MSDeploy log - * - * @member {array} [entries] List of log entry messages - */ -export interface MSDeployLog extends ProxyOnlyResource { - readonly entries?: MSDeployLogEntry[]; -} - -/** - * @class - * Initializes a new instance of the MSDeployStatus class. - * @constructor - * MSDeploy ARM response - * - * @member {string} [deployer] Username of deployer - * @member {string} [provisioningState] Provisioning state. Possible values - * include: 'accepted', 'running', 'succeeded', 'failed', 'canceled' - * @member {date} [startTime] Start time of deploy operation - * @member {date} [endTime] End time of deploy operation - * @member {boolean} [complete] Whether the deployment operation has completed - */ -export interface MSDeployStatus extends ProxyOnlyResource { - readonly deployer?: string; - readonly provisioningState?: string; - readonly startTime?: Date; - readonly endTime?: Date; - readonly complete?: boolean; -} - -/** - * @class - * Initializes a new instance of the MigrateMySqlRequest class. - * @constructor - * MySQL migration request. - * - * @member {string} connectionString Connection string to the remote MySQL - * database. - * @member {string} migrationType The type of migration operation to be done. - * Possible values include: 'LocalToRemote', 'RemoteToLocal' - */ -export interface MigrateMySqlRequest extends ProxyOnlyResource { - connectionString: string; - migrationType: string; -} - -/** - * @class - * Initializes a new instance of the MigrateMySqlStatus class. - * @constructor - * MySQL migration status. - * - * @member {string} [migrationOperationStatus] Status of the migration task. - * Possible values include: 'InProgress', 'Failed', 'Succeeded', 'TimedOut', - * 'Created' - * @member {string} [operationId] Operation ID for the migration task. - * @member {boolean} [localMySqlEnabled] True if the web app has in app MySql - * enabled - */ -export interface MigrateMySqlStatus extends ProxyOnlyResource { - readonly migrationOperationStatus?: string; - readonly operationId?: string; - readonly localMySqlEnabled?: boolean; -} - -/** - * @class - * Initializes a new instance of the RelayServiceConnectionEntity class. - * @constructor - * Hybrid Connection for an App Service app. - * - * @member {string} [entityName] - * @member {string} [entityConnectionString] - * @member {string} [resourceType] - * @member {string} [resourceConnectionString] - * @member {string} [hostname] - * @member {number} [port] - * @member {string} [biztalkUri] - */ -export interface RelayServiceConnectionEntity extends ProxyOnlyResource { - entityName?: string; - entityConnectionString?: string; - resourceType?: string; - resourceConnectionString?: string; - hostname?: string; - port?: number; - biztalkUri?: string; -} - -/** - * @class - * Initializes a new instance of the NetworkFeatures class. - * @constructor - * Full view of network features for an app (presently VNET integration and - * Hybrid Connections). - * - * @member {string} [virtualNetworkName] The Virtual Network name. - * @member {object} [virtualNetworkConnection] The Virtual Network summary - * view. - * @member {string} [virtualNetworkConnection.vnetResourceId] The Virtual - * Network's resource ID. - * @member {string} [virtualNetworkConnection.certThumbprint] The client - * certificate thumbprint. - * @member {buffer} [virtualNetworkConnection.certBlob] A certificate file - * (.cer) blob containing the public key of the private key used to - * authenticate a - * Point-To-Site VPN connection. - * @member {array} [virtualNetworkConnection.routes] The routes that this - * Virtual Network connection uses. - * @member {boolean} [virtualNetworkConnection.resyncRequired] - * true if a resync is required; otherwise, false. - * @member {string} [virtualNetworkConnection.dnsServers] DNS servers to be - * used by this Virtual Network. This should be a comma-separated list of IP - * addresses. - * @member {array} [hybridConnections] The Hybrid Connections summary view. - * @member {array} [hybridConnectionsV2] The Hybrid Connection V2 (Service Bus) - * view. - */ -export interface NetworkFeatures extends ProxyOnlyResource { - readonly virtualNetworkName?: string; - readonly virtualNetworkConnection?: VnetInfo; - readonly hybridConnections?: RelayServiceConnectionEntity[]; - readonly hybridConnectionsV2?: HybridConnection[]; -} - -/** - * @class - * Initializes a new instance of the PerfMonSample class. - * @constructor - * Performance monitor sample in a set. - * - * @member {date} [time] Point in time for which counter was measured. - * @member {string} [instanceName] Name of the server on which the measurement - * is made. - * @member {number} [value] Value of counter at a certain time. - * @member {number} [coreCount] Core Count of worker. Not a data member - */ -export interface PerfMonSample { - time?: Date; - instanceName?: string; - value?: number; - coreCount?: 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} [premierAddOnName] Premier add on Name. - * @member {string} [premierAddOnLocation] Premier add on Location. - * @member {object} [premierAddOnTags] Premier add on Tags. - * @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; - premierAddOnName?: string; - premierAddOnLocation?: string; - premierAddOnTags?: { [propertyName: string]: string }; - marketplacePublisher?: string; - marketplaceOffer?: string; -} - -/** - * @class - * Initializes a new instance of the ProcessThreadInfo class. - * @constructor - * Process Thread Information. - * - * @member {number} [processThreadInfoId] ARM Identifier for deployment. - * @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 { - processThreadInfoId?: 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} [processInfoId] ARM Identifier for deployment. - * @member {string} [processInfoName] 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} [totalProcessorTime] Total CPU time. - * @member {string} [userProcessorTime] User CPU time. - * @member {string} [privilegedProcessorTime] Privileged CPU time. - * @member {number} [workingSet64] Working set. - * @member {number} [peakWorkingSet64] Peak working set. - * @member {number} [privateMemorySize64] Private memory size. - * @member {number} [virtualMemorySize64] Virtual memory size. - * @member {number} [peakVirtualMemorySize64] Peak virtual memory usage. - * @member {number} [pagedSystemMemorySize64] Paged system memory. - * @member {number} [nonpagedSystemMemorySize64] Non-paged system memory. - * @member {number} [pagedMemorySize64] Paged memory. - * @member {number} [peakPagedMemorySize64] 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 { - processInfoId?: number; - processInfoName?: 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; - totalProcessorTime?: string; - userProcessorTime?: string; - privilegedProcessorTime?: string; - workingSet64?: number; - peakWorkingSet64?: number; - privateMemorySize64?: number; - virtualMemorySize64?: number; - peakVirtualMemorySize64?: number; - pagedSystemMemorySize64?: number; - nonpagedSystemMemorySize64?: number; - pagedMemorySize64?: number; - peakPagedMemorySize64?: 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'. 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 RestoreResponse class. - * @constructor - * Response for an app restore request. - * - * @member {string} [operationId] When server starts the restore process, it - * will return an operation ID identifying that particular restore operation. - */ -export interface RestoreResponse extends ProxyOnlyResource { - readonly operationId?: 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 {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; - 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 {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 {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 {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' - */ -export interface SiteConfigResource extends ProxyOnlyResource { - numberOfWorkers?: number; - defaultDocuments?: string[]; - netFrameworkVersion?: string; - phpVersion?: string; - pythonVersion?: string; - nodeVersion?: string; - linuxFxVersion?: string; - requestTracingEnabled?: boolean; - requestTracingExpirationTime?: Date; - remoteDebuggingEnabled?: boolean; - remoteDebuggingVersion?: string; - httpLoggingEnabled?: boolean; - logsDirectorySizeLimit?: number; - detailedErrorLoggingEnabled?: boolean; - publishingUsername?: string; - appSettings?: NameValuePair[]; - 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; - ipSecurityRestrictions?: IpSecurityRestriction[]; - http20Enabled?: boolean; - minTlsVersion?: string; -} - -/** - * @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} [siteConfigurationSnapshotInfoId] The id of the snapshot - */ -export interface SiteConfigurationSnapshotInfo extends ProxyOnlyResource { - readonly time?: Date; - readonly siteConfigurationSnapshotInfoId?: number; -} - -/** - * @class - * Initializes a new instance of the SiteExtensionInfo class. - * @constructor - * Site Extension Information. - * - * @member {string} [siteExtensionInfoId] Site extension ID. - * @member {string} [title] Site extension title. - * @member {string} [siteExtensionInfoType] 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} [installationArgs] 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 { - siteExtensionInfoId?: string; - title?: string; - siteExtensionInfoType?: string; - summary?: string; - description?: string; - version?: string; - extensionUrl?: string; - projectUrl?: string; - iconUrl?: string; - licenseUrl?: string; - feedUrl?: string; - authors?: string[]; - installationArgs?: 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 {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 {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 {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 {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 {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 {boolean} [cloningInfo.ignoreQuotas] true if quotas - * should be ignored; otherwise, false. - * @member {object} [snapshotInfo] If specified during app creation, the app is - * created from a previous snapshot. - * @member {string} [snapshotInfo.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * @member {object} [snapshotInfo.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * @member {string} [snapshotInfo.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * @member {string} [snapshotInfo.recoveryTarget.id] ARM resource ID of the - * target 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} [snapshotInfo.overwrite] If true the recovery - * operation can overwrite source app; otherwise, false. - * @member {boolean} [snapshotInfo.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * @member {boolean} [snapshotInfo.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. - * @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; - 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; - snapshotInfo?: SnapshotRecoveryRequest; - 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. - */ -export interface SlotConfigNamesResource extends ProxyOnlyResource { - connectionStringNames?: string[]; - appSettingNames?: string[]; -} - -/** - * @class - * Initializes a new instance of the SlotDifference class. - * @constructor - * A setting difference between two deployment slots of an app. - * - * @member {string} [slotDifferenceType] Type 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 slotDifferenceType?: 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 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 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 TriggeredJobRun class. - * @constructor - * Triggered Web Job Run Information. - * - * @member {string} [triggeredJobRunId] Job ID. - * @member {string} [triggeredJobRunName] 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 { - triggeredJobRunId?: string; - readonly triggeredJobRunName?: 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} [triggeredJobRuns] List of triggered web job runs. - */ -export interface TriggeredJobHistory extends ProxyOnlyResource { - triggeredJobRuns?: 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.triggeredJobRunId] Job ID. - * @member {string} [latestRun.triggeredJobRunName] 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} [triggeredWebJobName] Job name. Used as job identifier in - * ARM resource URI. - * @member {string} [runCommand] Run command. - * @member {string} [url] Job URL. - * @member {string} [extraInfoUrl] Extra Info URL. - * @member {string} [jobType] 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; - readonly triggeredWebJobName?: string; - runCommand?: string; - url?: string; - extraInfoUrl?: string; - jobType?: string; - error?: string; - usingSdk?: boolean; - settings?: { [propertyName: string]: any }; -} - -/** - * @class - * Initializes a new instance of the WebJob class. - * @constructor - * Web Job Information. - * - * @member {string} [webJobName] Job name. Used as job identifier in ARM - * resource URI. - * @member {string} [runCommand] Run command. - * @member {string} [url] Job URL. - * @member {string} [extraInfoUrl] Extra Info URL. - * @member {string} [jobType] 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 { - readonly webJobName?: string; - runCommand?: string; - url?: string; - extraInfoUrl?: string; - jobType?: 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 - */ -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[]; -} - -/** - * @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 - */ -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[]; -} - -/** - * @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} [metricDefinitionName] Name of the 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 metricDefinitionName?: string; - 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} [usageName] Name of the quota. - * @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 usageName?: 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} appServicePlanPatchResourceName Name for the App Service - * plan. - * @member {string} [workerTierName] Target worker tier assigned to the App - * Service plan. - * @member {string} [status] App Service plan status. Possible values include: - * 'Ready', 'Pending', 'Creating' - * @member {string} [subscription] App Service plan subscription. - * @member {string} [adminSiteName] App Service plan administration site. - * @member {object} [hostingEnvironmentProfile] Specification for the App - * Service Environment to use for the App Service plan. - * @member {string} [hostingEnvironmentProfile.id] Resource ID of the App - * Service Environment. - * @member {string} [hostingEnvironmentProfile.name] Name of the App Service - * Environment. - * @member {string} [hostingEnvironmentProfile.type] Resource type of the App - * Service Environment. - * @member {number} [maximumNumberOfWorkers] Maximum number of instances that - * can be assigned to this App Service plan. - * @member {string} [geoRegion] Geographical location for the App Service plan. - * @member {boolean} [perSiteScaling] If true, apps assigned to - * this App Service plan can be scaled independently. - * If false, apps assigned to this App Service plan will scale to - * all instances of the plan. Default value: false . - * @member {number} [numberOfSites] Number of apps assigned to this App Service - * plan. - * @member {boolean} [isSpot] If true, this App Service Plan owns - * spot instances. - * @member {date} [spotExpirationTime] The time when the server farm expires. - * Valid only if it is a spot server farm. - * @member {string} [resourceGroup] Resource group of the App Service plan. - * @member {boolean} [reserved] If Linux 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 { - appServicePlanPatchResourceName: string; - workerTierName?: string; - readonly status?: string; - readonly subscription?: string; - adminSiteName?: string; - hostingEnvironmentProfile?: HostingEnvironmentProfile; - readonly maximumNumberOfWorkers?: number; - readonly geoRegion?: string; - perSiteScaling?: boolean; - readonly numberOfSites?: number; - isSpot?: boolean; - spotExpirationTime?: Date; - readonly resourceGroup?: string; - reserved?: 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 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 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 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; -} - -/** - * @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 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 BillingMeterCollection class. - * @constructor - * Collection of Billing Meters - * - * @member {string} [nextLink] Link to next page of resources. - */ -export interface BillingMeterCollection extends Array { - readonly nextLink?: string; -} - -/** - * @class - * Initializes a new instance of the WebAppCollection class. - * @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 { - 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 { - 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; -} diff --git a/lib/services/websiteManagement2/lib/lib/models/index.js b/lib/services/websiteManagement2/lib/lib/models/index.js deleted file mode 100644 index af2e518523..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/index.js +++ /dev/null @@ -1,278 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -/* 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.SnapshotRecoveryTarget = require('./snapshotRecoveryTarget'); -exports.SnapshotRecoveryRequest = require('./snapshotRecoveryRequest'); -exports.ResourceMetricAvailability = require('./resourceMetricAvailability'); -exports.ResourceMetricName = require('./resourceMetricName'); -exports.ResourceMetricDefinition = require('./resourceMetricDefinition'); -exports.PushSettings = require('./pushSettings'); -exports.Identifier = require('./identifier'); -exports.HybridConnectionKey = require('./hybridConnectionKey'); -exports.HybridConnection = require('./hybridConnection'); -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.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.NameIdentifier = require('./nameIdentifier'); -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.ErrorResponse = require('./errorResponse'); -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.DefaultErrorResponseErrorDetailsItem = require('./defaultErrorResponseErrorDetailsItem'); -exports.DefaultErrorResponseError = require('./defaultErrorResponseError'); -exports.DefaultErrorResponse = require('./defaultErrorResponse'); -exports.Operation = require('./operation'); -exports.ResourceMetricProperty = require('./resourceMetricProperty'); -exports.ResourceMetricValue = require('./resourceMetricValue'); -exports.ResourceMetric = require('./resourceMetric'); -exports.DeletedSite = require('./deletedSite'); -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.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.ResourceHealthMetadata = require('./resourceHealthMetadata'); -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.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.Deployment = require('./deployment'); -exports.EnabledConfig = require('./enabledConfig'); -exports.FileSystemHttpLogsConfig = require('./fileSystemHttpLogsConfig'); -exports.FunctionEnvelope = require('./functionEnvelope'); -exports.FunctionSecrets = require('./functionSecrets'); -exports.HostNameBinding = require('./hostNameBinding'); -exports.HttpLogsConfig = require('./httpLogsConfig'); -exports.MSDeploy = require('./mSDeploy'); -exports.MSDeployLogEntry = require('./mSDeployLogEntry'); -exports.MSDeployLog = require('./mSDeployLog'); -exports.MSDeployStatus = require('./mSDeployStatus'); -exports.MigrateMySqlRequest = require('./migrateMySqlRequest'); -exports.MigrateMySqlStatus = require('./migrateMySqlStatus'); -exports.RelayServiceConnectionEntity = require('./relayServiceConnectionEntity'); -exports.NetworkFeatures = require('./networkFeatures'); -exports.PerfMonSample = require('./perfMonSample'); -exports.PerfMonSet = require('./perfMonSet'); -exports.PerfMonResponse = require('./perfMonResponse'); -exports.PremierAddOn = require('./premierAddOn'); -exports.ProcessThreadInfo = require('./processThreadInfo'); -exports.ProcessModuleInfo = require('./processModuleInfo'); -exports.ProcessInfo = require('./processInfo'); -exports.PublicCertificate = require('./publicCertificate'); -exports.RestoreRequest = require('./restoreRequest'); -exports.RestoreResponse = require('./restoreResponse'); -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.Snapshot = require('./snapshot'); -exports.StorageMigrationOptions = require('./storageMigrationOptions'); -exports.StorageMigrationResponse = require('./storageMigrationResponse'); -exports.StringDictionary = require('./stringDictionary'); -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.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.DiagnosticCategoryCollection = require('./diagnosticCategoryCollection'); -exports.DiagnosticAnalysisCollection = require('./diagnosticAnalysisCollection'); -exports.DiagnosticDetectorCollection = require('./diagnosticDetectorCollection'); -exports.ApplicationStackCollection = require('./applicationStackCollection'); -exports.RecommendationCollection = require('./recommendationCollection'); -exports.ResourceHealthMetadataCollection = require('./resourceHealthMetadataCollection'); -exports.SourceControlCollection = require('./sourceControlCollection'); -exports.GeoRegionCollection = require('./geoRegionCollection'); -exports.IdentifierCollection = require('./identifierCollection'); -exports.PremierAddOnOfferCollection = require('./premierAddOnOfferCollection'); -exports.BillingMeterCollection = require('./billingMeterCollection'); -exports.WebAppCollection = require('./webAppCollection'); -exports.BackupItemCollection = require('./backupItemCollection'); -exports.SiteConfigResourceCollection = require('./siteConfigResourceCollection'); -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'); diff --git a/lib/services/websiteManagement2/lib/lib/models/ipSecurityRestriction.js b/lib/services/websiteManagement2/lib/lib/models/ipSecurityRestriction.js deleted file mode 100644 index c9589edfc8..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/ipSecurityRestriction.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * IP security restriction on an app. - * - */ -class IpSecurityRestriction { - /** - * Create a IpSecurityRestriction. - * @member {string} ipAddress IP address the security restriction is valid - * for. - * @member {string} [subnetMask] Subnet mask for the range of IP addresses - * the restriction is valid for. - */ - 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' - } - } - } - } - }; - } -} - -module.exports = IpSecurityRestriction; diff --git a/lib/services/websiteManagement2/lib/lib/models/localizableString.js b/lib/services/websiteManagement2/lib/lib/models/localizableString.js deleted file mode 100644 index 0f464c7fe5..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/localizableString.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/mSDeploy.js b/lib/services/websiteManagement2/lib/lib/models/mSDeploy.js deleted file mode 100644 index 89bfbd351f..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/mSDeploy.js +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/mSDeployLog.js b/lib/services/websiteManagement2/lib/lib/models/mSDeployLog.js deleted file mode 100644 index c4128e119d..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/mSDeployLog.js +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/mSDeployLogEntry.js b/lib/services/websiteManagement2/lib/lib/models/mSDeployLogEntry.js deleted file mode 100644 index dca0c93378..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/mSDeployLogEntry.js +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/mSDeployStatus.js b/lib/services/websiteManagement2/lib/lib/models/mSDeployStatus.js deleted file mode 100644 index 3fedbf49cf..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/mSDeployStatus.js +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/managedServiceIdentity.js b/lib/services/websiteManagement2/lib/lib/models/managedServiceIdentity.js deleted file mode 100644 index 1b38e8c693..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/managedServiceIdentity.js +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Managed service identity. - * - */ -class ManagedServiceIdentity { - /** - * Create a ManagedServiceIdentity. - * @member {string} [type] Type of managed service identity. Possible values - * include: 'SystemAssigned' - * @member {string} [tenantId] Tenant of managed service identity. - * @member {string} [principalId] Principal Id of managed service identity. - */ - 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' - } - } - } - } - }; - } -} - -module.exports = ManagedServiceIdentity; diff --git a/lib/services/websiteManagement2/lib/lib/models/metricAvailabilily.js b/lib/services/websiteManagement2/lib/lib/models/metricAvailabilily.js deleted file mode 100644 index 7957ab3882..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/metricAvailabilily.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/metricAvailability.js b/lib/services/websiteManagement2/lib/lib/models/metricAvailability.js deleted file mode 100644 index 84a9285bd4..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/metricAvailability.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/metricDefinition.js b/lib/services/websiteManagement2/lib/lib/models/metricDefinition.js deleted file mode 100644 index 7ef23aa4c1..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/metricDefinition.js +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Metadata for a metric. - * - * @extends models['ProxyOnlyResource'] - */ -class MetricDefinition extends models['ProxyOnlyResource'] { - /** - * Create a MetricDefinition. - * @member {string} [metricDefinitionName] Name of the 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. - */ - 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' - } - }, - metricDefinitionName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - 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/lib/models/metricSpecification.js b/lib/services/websiteManagement2/lib/lib/models/metricSpecification.js deleted file mode 100644 index f181fc189b..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/metricSpecification.js +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/migrateMySqlRequest.js b/lib/services/websiteManagement2/lib/lib/models/migrateMySqlRequest.js deleted file mode 100644 index 3f5a50472d..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/migrateMySqlRequest.js +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -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/lib/models/migrateMySqlStatus.js b/lib/services/websiteManagement2/lib/lib/models/migrateMySqlStatus.js deleted file mode 100644 index 614da5a007..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/migrateMySqlStatus.js +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/nameIdentifier.js b/lib/services/websiteManagement2/lib/lib/models/nameIdentifier.js deleted file mode 100644 index 2147dc71dc..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/nameIdentifier.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/nameIdentifierCollection.js b/lib/services/websiteManagement2/lib/lib/models/nameIdentifierCollection.js deleted file mode 100644 index ea628630e0..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/nameIdentifierCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/nameValuePair.js b/lib/services/websiteManagement2/lib/lib/models/nameValuePair.js deleted file mode 100644 index 5e3cdf77c2..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/nameValuePair.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/networkAccessControlEntry.js b/lib/services/websiteManagement2/lib/lib/models/networkAccessControlEntry.js deleted file mode 100644 index 841e6205dd..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/networkAccessControlEntry.js +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/networkFeatures.js b/lib/services/websiteManagement2/lib/lib/models/networkFeatures.js deleted file mode 100644 index 8d3d2959a8..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/networkFeatures.js +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/operation.js b/lib/services/websiteManagement2/lib/lib/models/operation.js deleted file mode 100644 index 4a24b281f8..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/operation.js +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/perfMonCounterCollection.js b/lib/services/websiteManagement2/lib/lib/models/perfMonCounterCollection.js deleted file mode 100644 index f14a13dbff..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/perfMonCounterCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/perfMonResponse.js b/lib/services/websiteManagement2/lib/lib/models/perfMonResponse.js deleted file mode 100644 index a4badd3919..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/perfMonResponse.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/perfMonSample.js b/lib/services/websiteManagement2/lib/lib/models/perfMonSample.js deleted file mode 100644 index f7882a7d2e..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/perfMonSample.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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. - * @member {number} [coreCount] Core Count of worker. Not a data member - */ - 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' - } - }, - coreCount: { - required: false, - serializedName: 'coreCount', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = PerfMonSample; diff --git a/lib/services/websiteManagement2/lib/lib/models/perfMonSet.js b/lib/services/websiteManagement2/lib/lib/models/perfMonSet.js deleted file mode 100644 index 8a24e0d373..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/perfMonSet.js +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/premierAddOn.js b/lib/services/websiteManagement2/lib/lib/models/premierAddOn.js deleted file mode 100644 index ac3d6c9e2f..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/premierAddOn.js +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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} [premierAddOnName] Premier add on Name. - * @member {string} [premierAddOnLocation] Premier add on Location. - * @member {object} [premierAddOnTags] Premier add on Tags. - * @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' - } - }, - premierAddOnName: { - required: false, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, - premierAddOnLocation: { - required: false, - serializedName: 'properties.location', - type: { - name: 'String' - } - }, - premierAddOnTags: { - required: false, - serializedName: 'properties.tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - 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/lib/models/premierAddOnOffer.js b/lib/services/websiteManagement2/lib/lib/models/premierAddOnOffer.js deleted file mode 100644 index 2252e8969a..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/premierAddOnOffer.js +++ /dev/null @@ -1,171 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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 {string} [premierAddOnOfferName] Premier add on offer Name. - * @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' - } - }, - premierAddOnOfferName: { - required: false, - serializedName: 'properties.name', - 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/lib/models/premierAddOnOfferCollection.js b/lib/services/websiteManagement2/lib/lib/models/premierAddOnOfferCollection.js deleted file mode 100644 index ceecaa63c2..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/premierAddOnOfferCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/processInfo.js b/lib/services/websiteManagement2/lib/lib/models/processInfo.js deleted file mode 100644 index 094583fabf..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/processInfo.js +++ /dev/null @@ -1,405 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Process Information. - * - * @extends models['ProxyOnlyResource'] - */ -class ProcessInfo extends models['ProxyOnlyResource'] { - /** - * Create a ProcessInfo. - * @member {number} [processInfoId] ARM Identifier for deployment. - * @member {string} [processInfoName] 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} [totalProcessorTime] Total CPU time. - * @member {string} [userProcessorTime] User CPU time. - * @member {string} [privilegedProcessorTime] Privileged CPU time. - * @member {number} [workingSet64] Working set. - * @member {number} [peakWorkingSet64] Peak working set. - * @member {number} [privateMemorySize64] Private memory size. - * @member {number} [virtualMemorySize64] Virtual memory size. - * @member {number} [peakVirtualMemorySize64] Peak virtual memory usage. - * @member {number} [pagedSystemMemorySize64] Paged system memory. - * @member {number} [nonpagedSystemMemorySize64] Non-paged system memory. - * @member {number} [pagedMemorySize64] Paged memory. - * @member {number} [peakPagedMemorySize64] 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' - } - }, - processInfoId: { - required: false, - serializedName: 'properties.id', - type: { - name: 'Number' - } - }, - processInfoName: { - required: false, - serializedName: 'properties.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.isProfileRunning', - type: { - name: 'Boolean' - } - }, - isIisProfileRunning: { - required: false, - serializedName: 'properties.isIisProfileRunning', - type: { - name: 'Boolean' - } - }, - iisProfileTimeoutInSeconds: { - required: false, - serializedName: 'properties.iisProfileTimeoutInSeconds', - 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.openFileHandles', - 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.fileName', - type: { - name: 'String' - } - }, - commandLine: { - required: false, - serializedName: 'properties.commandLine', - type: { - name: 'String' - } - }, - userName: { - required: false, - serializedName: 'properties.userName', - type: { - name: 'String' - } - }, - handleCount: { - required: false, - serializedName: 'properties.handleCount', - type: { - name: 'Number' - } - }, - moduleCount: { - required: false, - serializedName: 'properties.moduleCount', - type: { - name: 'Number' - } - }, - threadCount: { - required: false, - serializedName: 'properties.threadCount', - type: { - name: 'Number' - } - }, - startTime: { - required: false, - serializedName: 'properties.startTime', - type: { - name: 'DateTime' - } - }, - totalProcessorTime: { - required: false, - serializedName: 'properties.totalProcessorTime', - type: { - name: 'String' - } - }, - userProcessorTime: { - required: false, - serializedName: 'properties.userProcessorTime', - type: { - name: 'String' - } - }, - privilegedProcessorTime: { - required: false, - serializedName: 'properties.privilegedProcessorTime', - type: { - name: 'String' - } - }, - workingSet64: { - required: false, - serializedName: 'properties.workingSet64', - type: { - name: 'Number' - } - }, - peakWorkingSet64: { - required: false, - serializedName: 'properties.peakWorkingSet64', - type: { - name: 'Number' - } - }, - privateMemorySize64: { - required: false, - serializedName: 'properties.privateMemorySize64', - type: { - name: 'Number' - } - }, - virtualMemorySize64: { - required: false, - serializedName: 'properties.virtualMemorySize64', - type: { - name: 'Number' - } - }, - peakVirtualMemorySize64: { - required: false, - serializedName: 'properties.peakVirtualMemorySize64', - type: { - name: 'Number' - } - }, - pagedSystemMemorySize64: { - required: false, - serializedName: 'properties.pagedSystemMemorySize64', - type: { - name: 'Number' - } - }, - nonpagedSystemMemorySize64: { - required: false, - serializedName: 'properties.nonpagedSystemMemorySize64', - type: { - name: 'Number' - } - }, - pagedMemorySize64: { - required: false, - serializedName: 'properties.pagedMemorySize64', - type: { - name: 'Number' - } - }, - peakPagedMemorySize64: { - required: false, - serializedName: 'properties.peakPagedMemorySize64', - type: { - name: 'Number' - } - }, - timeStamp: { - required: false, - serializedName: 'properties.timeStamp', - type: { - name: 'DateTime' - } - }, - environmentVariables: { - required: false, - serializedName: 'properties.environmentVariables', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - isScmSite: { - required: false, - serializedName: 'properties.isScmSite', - type: { - name: 'Boolean' - } - }, - isWebJob: { - required: false, - serializedName: 'properties.isWebJob', - type: { - name: 'Boolean' - } - }, - description: { - required: false, - serializedName: 'properties.description', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ProcessInfo; diff --git a/lib/services/websiteManagement2/lib/lib/models/processInfoCollection.js b/lib/services/websiteManagement2/lib/lib/models/processInfoCollection.js deleted file mode 100644 index 7ebd35ee09..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/processInfoCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/processModuleInfo.js b/lib/services/websiteManagement2/lib/lib/models/processModuleInfo.js deleted file mode 100644 index 54334a64cf..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/processModuleInfo.js +++ /dev/null @@ -1,168 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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.baseAddress', - type: { - name: 'String' - } - }, - fileName: { - required: false, - serializedName: 'properties.fileName', - type: { - name: 'String' - } - }, - href: { - required: false, - serializedName: 'properties.href', - type: { - name: 'String' - } - }, - filePath: { - required: false, - serializedName: 'properties.filePath', - type: { - name: 'String' - } - }, - moduleMemorySize: { - required: false, - serializedName: 'properties.moduleMemorySize', - type: { - name: 'Number' - } - }, - fileVersion: { - required: false, - serializedName: 'properties.fileVersion', - type: { - name: 'String' - } - }, - fileDescription: { - required: false, - serializedName: 'properties.fileDescription', - type: { - name: 'String' - } - }, - product: { - required: false, - serializedName: 'properties.product', - type: { - name: 'String' - } - }, - productVersion: { - required: false, - serializedName: 'properties.productVersion', - type: { - name: 'String' - } - }, - isDebug: { - required: false, - serializedName: 'properties.isDebug', - type: { - name: 'Boolean' - } - }, - language: { - required: false, - serializedName: 'properties.language', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ProcessModuleInfo; diff --git a/lib/services/websiteManagement2/lib/lib/models/processModuleInfoCollection.js b/lib/services/websiteManagement2/lib/lib/models/processModuleInfoCollection.js deleted file mode 100644 index 3ce4dec596..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/processModuleInfoCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/processThreadInfo.js b/lib/services/websiteManagement2/lib/lib/models/processThreadInfo.js deleted file mode 100644 index ec227556b0..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/processThreadInfo.js +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Process Thread Information. - * - * @extends models['ProxyOnlyResource'] - */ -class ProcessThreadInfo extends models['ProxyOnlyResource'] { - /** - * Create a ProcessThreadInfo. - * @member {number} [processThreadInfoId] ARM Identifier for deployment. - * @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' - } - }, - processThreadInfoId: { - required: false, - serializedName: 'properties.id', - 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.startAddress', - type: { - name: 'String' - } - }, - currentPriority: { - required: false, - serializedName: 'properties.currentPriority', - type: { - name: 'Number' - } - }, - priorityLevel: { - required: false, - serializedName: 'properties.priorityLevel', - type: { - name: 'String' - } - }, - basePriority: { - required: false, - serializedName: 'properties.basePriority', - type: { - name: 'Number' - } - }, - startTime: { - required: false, - serializedName: 'properties.startTime', - type: { - name: 'DateTime' - } - }, - totalProcessorTime: { - required: false, - serializedName: 'properties.totalProcessorTime', - type: { - name: 'String' - } - }, - userProcessorTime: { - required: false, - serializedName: 'properties.userProcessorTime', - type: { - name: 'String' - } - }, - priviledgedProcessorTime: { - required: false, - serializedName: 'properties.priviledgedProcessorTime', - type: { - name: 'String' - } - }, - state: { - required: false, - serializedName: 'properties.state', - type: { - name: 'String' - } - }, - waitReason: { - required: false, - serializedName: 'properties.waitReason', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = ProcessThreadInfo; diff --git a/lib/services/websiteManagement2/lib/lib/models/processThreadInfoCollection.js b/lib/services/websiteManagement2/lib/lib/models/processThreadInfoCollection.js deleted file mode 100644 index 5b6c63e1c9..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/processThreadInfoCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/proxyOnlyResource.js b/lib/services/websiteManagement2/lib/lib/models/proxyOnlyResource.js deleted file mode 100644 index ce25dbcdd7..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/proxyOnlyResource.js +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/publicCertificate.js b/lib/services/websiteManagement2/lib/lib/models/publicCertificate.js deleted file mode 100644 index 7d26d5e11a..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/publicCertificate.js +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/publicCertificateCollection.js b/lib/services/websiteManagement2/lib/lib/models/publicCertificateCollection.js deleted file mode 100644 index 39be88acc4..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/publicCertificateCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/pushSettings.js b/lib/services/websiteManagement2/lib/lib/models/pushSettings.js deleted file mode 100644 index 9c8bb1ec4e..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/pushSettings.js +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/rampUpRule.js b/lib/services/websiteManagement2/lib/lib/models/rampUpRule.js deleted file mode 100644 index 97701d5a8a..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/rampUpRule.js +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/recommendation.js b/lib/services/websiteManagement2/lib/lib/models/recommendation.js deleted file mode 100644 index 665993eaba..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/recommendation.js +++ /dev/null @@ -1,274 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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} [tags] The list of category tags that this recommendation - * belongs to. - * @member {string} [actionName] Name of action recommended by this object. - * @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' ] - } - }, - tags: { - required: false, - serializedName: 'properties.tags', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - actionName: { - required: false, - serializedName: 'properties.actionName', - 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/lib/models/recommendationCollection.js b/lib/services/websiteManagement2/lib/lib/models/recommendationCollection.js deleted file mode 100644 index e85014b66e..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/recommendationCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/recommendationRule.js b/lib/services/websiteManagement2/lib/lib/models/recommendationRule.js deleted file mode 100644 index 6e35b0c290..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/recommendationRule.js +++ /dev/null @@ -1,203 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Represents a recommendation rule that the recommendation engine can perform. - * - * @extends models['ProxyOnlyResource'] - */ -class RecommendationRule extends models['ProxyOnlyResource'] { - /** - * Create a RecommendationRule. - * @member {string} [recommendationRuleName] 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} [tags] An array of category tags that the rule contains. - * @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' - } - }, - recommendationRuleName: { - required: false, - serializedName: 'properties.name', - 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' ] - } - }, - tags: { - required: false, - serializedName: 'properties.tags', - 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/lib/models/reissueCertificateOrderRequest.js b/lib/services/websiteManagement2/lib/lib/models/reissueCertificateOrderRequest.js deleted file mode 100644 index b7a796250c..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/reissueCertificateOrderRequest.js +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Class representing 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/lib/models/relayServiceConnectionEntity.js b/lib/services/websiteManagement2/lib/lib/models/relayServiceConnectionEntity.js deleted file mode 100644 index c54c71585a..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/relayServiceConnectionEntity.js +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/renewCertificateOrderRequest.js b/lib/services/websiteManagement2/lib/lib/models/renewCertificateOrderRequest.js deleted file mode 100644 index b72c6763f4..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/renewCertificateOrderRequest.js +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Class representing 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/lib/models/requestsBasedTrigger.js b/lib/services/websiteManagement2/lib/lib/models/requestsBasedTrigger.js deleted file mode 100644 index 60c548d329..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/requestsBasedTrigger.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/resource.js b/lib/services/websiteManagement2/lib/lib/models/resource.js deleted file mode 100644 index ee72e3156a..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/resource.js +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/resourceCollection.js b/lib/services/websiteManagement2/lib/lib/models/resourceCollection.js deleted file mode 100644 index d49a0d8fec..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/resourceCollection.js +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/resourceHealthMetadata.js b/lib/services/websiteManagement2/lib/lib/models/resourceHealthMetadata.js deleted file mode 100644 index 7c8d1c457d..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/resourceHealthMetadata.js +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/resourceHealthMetadataCollection.js b/lib/services/websiteManagement2/lib/lib/models/resourceHealthMetadataCollection.js deleted file mode 100644 index b4be12e889..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/resourceHealthMetadataCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/resourceMetric.js b/lib/services/websiteManagement2/lib/lib/models/resourceMetric.js deleted file mode 100644 index bc89c6dc3d..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/resourceMetric.js +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/resourceMetricAvailability.js b/lib/services/websiteManagement2/lib/lib/models/resourceMetricAvailability.js deleted file mode 100644 index 477e5bb26c..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/resourceMetricAvailability.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/resourceMetricCollection.js b/lib/services/websiteManagement2/lib/lib/models/resourceMetricCollection.js deleted file mode 100644 index 579749b9a4..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/resourceMetricCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/resourceMetricDefinition.js b/lib/services/websiteManagement2/lib/lib/models/resourceMetricDefinition.js deleted file mode 100644 index 86464c5423..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/resourceMetricDefinition.js +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Metadata for the metrics. - * - * @extends models['ProxyOnlyResource'] - */ -class ResourceMetricDefinition extends models['ProxyOnlyResource'] { - /** - * Create a ResourceMetricDefinition. - * @member {object} [resourceMetricDefinitionName] Name of the metric. - * @member {string} [resourceMetricDefinitionName.value] metric name value. - * @member {string} [resourceMetricDefinitionName.localizedValue] Localized - * metric name value. - * @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 {string} [resourceMetricDefinitionId] Resource ID. - * @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' - } - }, - resourceMetricDefinitionName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'Composite', - className: 'ResourceMetricName' - } - }, - 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' - } - }, - resourceMetricDefinitionId: { - required: false, - readOnly: true, - serializedName: 'properties.id', - 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/lib/models/resourceMetricDefinitionCollection.js b/lib/services/websiteManagement2/lib/lib/models/resourceMetricDefinitionCollection.js deleted file mode 100644 index 5de7ff20bf..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/resourceMetricDefinitionCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/resourceMetricName.js b/lib/services/websiteManagement2/lib/lib/models/resourceMetricName.js deleted file mode 100644 index 8aea96ba4a..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/resourceMetricName.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/resourceMetricProperty.js b/lib/services/websiteManagement2/lib/lib/models/resourceMetricProperty.js deleted file mode 100644 index e1c189544b..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/resourceMetricProperty.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/resourceMetricValue.js b/lib/services/websiteManagement2/lib/lib/models/resourceMetricValue.js deleted file mode 100644 index 6bc292af85..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/resourceMetricValue.js +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/resourceNameAvailability.js b/lib/services/websiteManagement2/lib/lib/models/resourceNameAvailability.js deleted file mode 100644 index a733bc7a1e..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/resourceNameAvailability.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/resourceNameAvailabilityRequest.js b/lib/services/websiteManagement2/lib/lib/models/resourceNameAvailabilityRequest.js deleted file mode 100644 index fceb2c2a08..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/resourceNameAvailabilityRequest.js +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/responseMetaData.js b/lib/services/websiteManagement2/lib/lib/models/responseMetaData.js deleted file mode 100644 index 1887a5d84a..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/responseMetaData.js +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Class representing 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/lib/models/restoreRequest.js b/lib/services/websiteManagement2/lib/lib/models/restoreRequest.js deleted file mode 100644 index ed24bafc6a..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/restoreRequest.js +++ /dev/null @@ -1,193 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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'. 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' ] - } - }, - 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/lib/models/restoreResponse.js b/lib/services/websiteManagement2/lib/lib/models/restoreResponse.js deleted file mode 100644 index a3f06ae56a..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/restoreResponse.js +++ /dev/null @@ -1,89 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Response for an app restore request. - * - * @extends models['ProxyOnlyResource'] - */ -class RestoreResponse extends models['ProxyOnlyResource'] { - /** - * Create a RestoreResponse. - * @member {string} [operationId] When server starts the restore process, it - * will return an operation ID identifying that particular restore operation. - */ - constructor() { - super(); - } - - /** - * Defines the metadata of RestoreResponse - * - * @returns {object} metadata of RestoreResponse - * - */ - mapper() { - return { - required: false, - serializedName: 'RestoreResponse', - type: { - name: 'Composite', - className: 'RestoreResponse', - 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 = RestoreResponse; diff --git a/lib/services/websiteManagement2/lib/lib/models/serviceSpecification.js b/lib/services/websiteManagement2/lib/lib/models/serviceSpecification.js deleted file mode 100644 index ebb2a7b9a3..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/serviceSpecification.js +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Resource metrics service provided by Microsoft.Insights resource provider. - * - */ -class ServiceSpecification { - /** - * Create a ServiceSpecification. - * @member {array} [metricSpecifications] - */ - 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' - } - } - } - } - } - } - }; - } -} - -module.exports = ServiceSpecification; diff --git a/lib/services/websiteManagement2/lib/lib/models/site.js b/lib/services/websiteManagement2/lib/lib/models/site.js deleted file mode 100644 index daa121c8ae..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/site.js +++ /dev/null @@ -1,671 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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 {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 {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 {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 {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 {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 {boolean} [cloningInfo.ignoreQuotas] true if quotas - * should be ignored; otherwise, false. - * @member {object} [snapshotInfo] If specified during app creation, the app - * is created from a previous snapshot. - * @member {string} [snapshotInfo.snapshotTime] Point in time in which the - * app recovery should be attempted, formatted as a DateTime string. - * @member {object} [snapshotInfo.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * @member {string} [snapshotInfo.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * @member {string} [snapshotInfo.recoveryTarget.id] ARM resource ID of the - * target 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} [snapshotInfo.overwrite] If true the - * recovery operation can overwrite source app; otherwise, - * false. - * @member {boolean} [snapshotInfo.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * @member {boolean} [snapshotInfo.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. - * @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' - * @member {string} [identity.tenantId] Tenant of managed service identity. - * @member {string} [identity.principalId] Principal Id of managed service - * identity. - */ - 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' - } - }, - 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' - } - }, - snapshotInfo: { - required: false, - serializedName: 'properties.snapshotInfo', - type: { - name: 'Composite', - className: 'SnapshotRecoveryRequest' - } - }, - 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/lib/models/siteAuthSettings.js b/lib/services/websiteManagement2/lib/lib/models/siteAuthSettings.js deleted file mode 100644 index 977f86f4dc..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/siteAuthSettings.js +++ /dev/null @@ -1,401 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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 {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' - } - }, - 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/lib/models/siteCloneability.js b/lib/services/websiteManagement2/lib/lib/models/siteCloneability.js deleted file mode 100644 index 8e5728a618..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/siteCloneability.js +++ /dev/null @@ -1,108 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/siteCloneabilityCriterion.js b/lib/services/websiteManagement2/lib/lib/models/siteCloneabilityCriterion.js deleted file mode 100644 index 7d5d208e54..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/siteCloneabilityCriterion.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/siteConfig.js b/lib/services/websiteManagement2/lib/lib/models/siteConfig.js deleted file mode 100644 index 6dd3a24a75..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/siteConfig.js +++ /dev/null @@ -1,548 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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 {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 {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 {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' - */ - 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' - } - }, - 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' - } - } - } - }, - 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' - } - }, - 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' - } - } - } - } - }; - } -} - -module.exports = SiteConfig; diff --git a/lib/services/websiteManagement2/lib/lib/models/siteConfigResource.js b/lib/services/websiteManagement2/lib/lib/models/siteConfigResource.js deleted file mode 100644 index 247ba84dc6..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/siteConfigResource.js +++ /dev/null @@ -1,581 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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 {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 {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 {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' - */ - 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' - } - }, - 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' - } - } - } - }, - 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' - } - }, - 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' - } - } - } - } - }; - } -} - -module.exports = SiteConfigResource; diff --git a/lib/services/websiteManagement2/lib/lib/models/siteConfigResourceCollection.js b/lib/services/websiteManagement2/lib/lib/models/siteConfigResourceCollection.js deleted file mode 100644 index e1668edee7..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/siteConfigResourceCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/siteConfigurationSnapshotInfo.js b/lib/services/websiteManagement2/lib/lib/models/siteConfigurationSnapshotInfo.js deleted file mode 100644 index ab201777eb..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/siteConfigurationSnapshotInfo.js +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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} [siteConfigurationSnapshotInfoId] 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' - } - }, - siteConfigurationSnapshotInfoId: { - required: false, - readOnly: true, - serializedName: 'properties.id', - type: { - name: 'Number' - } - } - } - } - }; - } -} - -module.exports = SiteConfigurationSnapshotInfo; diff --git a/lib/services/websiteManagement2/lib/lib/models/siteConfigurationSnapshotInfoCollection.js b/lib/services/websiteManagement2/lib/lib/models/siteConfigurationSnapshotInfoCollection.js deleted file mode 100644 index 6bdb27ef62..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/siteConfigurationSnapshotInfoCollection.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/siteExtensionInfo.js b/lib/services/websiteManagement2/lib/lib/models/siteExtensionInfo.js deleted file mode 100644 index 8cd1cf009f..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/siteExtensionInfo.js +++ /dev/null @@ -1,249 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Site Extension Information. - * - * @extends models['ProxyOnlyResource'] - */ -class SiteExtensionInfo extends models['ProxyOnlyResource'] { - /** - * Create a SiteExtensionInfo. - * @member {string} [siteExtensionInfoId] Site extension ID. - * @member {string} [title] Site extension title. - * @member {string} [siteExtensionInfoType] 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} [installationArgs] 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' - } - }, - siteExtensionInfoId: { - required: false, - serializedName: 'properties.id', - type: { - name: 'String' - } - }, - title: { - required: false, - serializedName: 'properties.title', - type: { - name: 'String' - } - }, - siteExtensionInfoType: { - required: false, - serializedName: 'properties.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.extensionUrl', - type: { - name: 'String' - } - }, - projectUrl: { - required: false, - serializedName: 'properties.projectUrl', - type: { - name: 'String' - } - }, - iconUrl: { - required: false, - serializedName: 'properties.iconUrl', - type: { - name: 'String' - } - }, - licenseUrl: { - required: false, - serializedName: 'properties.licenseUrl', - type: { - name: 'String' - } - }, - feedUrl: { - required: false, - serializedName: 'properties.feedUrl', - type: { - name: 'String' - } - }, - authors: { - required: false, - serializedName: 'properties.authors', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, - installationArgs: { - required: false, - serializedName: 'properties.installationArgs', - type: { - name: 'String' - } - }, - publishedDateTime: { - required: false, - serializedName: 'properties.publishedDateTime', - type: { - name: 'DateTime' - } - }, - downloadCount: { - required: false, - serializedName: 'properties.downloadCount', - type: { - name: 'Number' - } - }, - localIsLatestVersion: { - required: false, - serializedName: 'properties.localIsLatestVersion', - type: { - name: 'Boolean' - } - }, - localPath: { - required: false, - serializedName: 'properties.localPath', - type: { - name: 'String' - } - }, - installedDateTime: { - required: false, - serializedName: 'properties.installedDateTime', - 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/lib/models/siteExtensionInfoCollection.js b/lib/services/websiteManagement2/lib/lib/models/siteExtensionInfoCollection.js deleted file mode 100644 index be20a01f06..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/siteExtensionInfoCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/siteInstance.js b/lib/services/websiteManagement2/lib/lib/models/siteInstance.js deleted file mode 100644 index 850f9772ca..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/siteInstance.js +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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.name', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = SiteInstance; diff --git a/lib/services/websiteManagement2/lib/lib/models/siteLimits.js b/lib/services/websiteManagement2/lib/lib/models/siteLimits.js deleted file mode 100644 index 48f8562cea..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/siteLimits.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/siteLogsConfig.js b/lib/services/websiteManagement2/lib/lib/models/siteLogsConfig.js deleted file mode 100644 index 04f1df34a8..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/siteLogsConfig.js +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/siteMachineKey.js b/lib/services/websiteManagement2/lib/lib/models/siteMachineKey.js deleted file mode 100644 index e60a1445f6..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/siteMachineKey.js +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/sitePatchResource.js b/lib/services/websiteManagement2/lib/lib/models/sitePatchResource.js deleted file mode 100644 index 91322a206d..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/sitePatchResource.js +++ /dev/null @@ -1,636 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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 {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 {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 {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 {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 {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 {boolean} [cloningInfo.ignoreQuotas] true if quotas - * should be ignored; otherwise, false. - * @member {object} [snapshotInfo] If specified during app creation, the app - * is created from a previous snapshot. - * @member {string} [snapshotInfo.snapshotTime] Point in time in which the - * app recovery should be attempted, formatted as a DateTime string. - * @member {object} [snapshotInfo.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * @member {string} [snapshotInfo.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * @member {string} [snapshotInfo.recoveryTarget.id] ARM resource ID of the - * target 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} [snapshotInfo.overwrite] If true the - * recovery operation can overwrite source app; otherwise, - * false. - * @member {boolean} [snapshotInfo.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * @member {boolean} [snapshotInfo.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. - * @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' - } - }, - 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' - } - }, - snapshotInfo: { - required: false, - serializedName: 'properties.snapshotInfo', - type: { - name: 'Composite', - className: 'SnapshotRecoveryRequest' - } - }, - 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/lib/models/sitePhpErrorLogFlag.js b/lib/services/websiteManagement2/lib/lib/models/sitePhpErrorLogFlag.js deleted file mode 100644 index bdd71e4e43..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/sitePhpErrorLogFlag.js +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/siteSeal.js b/lib/services/websiteManagement2/lib/lib/models/siteSeal.js deleted file mode 100644 index 42e247d6c4..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/siteSeal.js +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/siteSealRequest.js b/lib/services/websiteManagement2/lib/lib/models/siteSealRequest.js deleted file mode 100644 index 1745db2223..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/siteSealRequest.js +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/siteSourceControl.js b/lib/services/websiteManagement2/lib/lib/models/siteSourceControl.js deleted file mode 100644 index 492efb717f..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/siteSourceControl.js +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/skuCapacity.js b/lib/services/websiteManagement2/lib/lib/models/skuCapacity.js deleted file mode 100644 index 975b91bfd9..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/skuCapacity.js +++ /dev/null @@ -1,80 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/skuDescription.js b/lib/services/websiteManagement2/lib/lib/models/skuDescription.js deleted file mode 100644 index 25c3b62002..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/skuDescription.js +++ /dev/null @@ -1,137 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/skuInfo.js b/lib/services/websiteManagement2/lib/lib/models/skuInfo.js deleted file mode 100644 index ccf4d0de83..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/skuInfo.js +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/skuInfoCollection.js b/lib/services/websiteManagement2/lib/lib/models/skuInfoCollection.js deleted file mode 100644 index d82ba762bd..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/skuInfoCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/skuInfos.js b/lib/services/websiteManagement2/lib/lib/models/skuInfos.js deleted file mode 100644 index 229a953e50..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/skuInfos.js +++ /dev/null @@ -1,70 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/slotConfigNamesResource.js b/lib/services/websiteManagement2/lib/lib/models/slotConfigNamesResource.js deleted file mode 100644 index e64eb91f19..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/slotConfigNamesResource.js +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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. - */ - 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' - } - } - } - } - } - } - }; - } -} - -module.exports = SlotConfigNamesResource; diff --git a/lib/services/websiteManagement2/lib/lib/models/slotDifference.js b/lib/services/websiteManagement2/lib/lib/models/slotDifference.js deleted file mode 100644 index f20bdff1da..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/slotDifference.js +++ /dev/null @@ -1,147 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * A setting difference between two deployment slots of an app. - * - * @extends models['ProxyOnlyResource'] - */ -class SlotDifference extends models['ProxyOnlyResource'] { - /** - * Create a SlotDifference. - * @member {string} [slotDifferenceType] Type 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' - } - }, - slotDifferenceType: { - required: false, - readOnly: true, - serializedName: 'properties.type', - 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/lib/models/slotDifferenceCollection.js b/lib/services/websiteManagement2/lib/lib/models/slotDifferenceCollection.js deleted file mode 100644 index ff836aff95..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/slotDifferenceCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/slotSwapStatus.js b/lib/services/websiteManagement2/lib/lib/models/slotSwapStatus.js deleted file mode 100644 index 6d399a5285..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/slotSwapStatus.js +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * The 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/lib/models/slowRequestsBasedTrigger.js b/lib/services/websiteManagement2/lib/lib/models/slowRequestsBasedTrigger.js deleted file mode 100644 index 30602cb26d..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/slowRequestsBasedTrigger.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/snapshot.js b/lib/services/websiteManagement2/lib/lib/models/snapshot.js deleted file mode 100644 index 9420d3e70c..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/snapshot.js +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/snapshotCollection.js b/lib/services/websiteManagement2/lib/lib/models/snapshotCollection.js deleted file mode 100644 index b6729f556f..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/snapshotCollection.js +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/snapshotRecoveryRequest.js b/lib/services/websiteManagement2/lib/lib/models/snapshotRecoveryRequest.js deleted file mode 100644 index e59a088c7c..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/snapshotRecoveryRequest.js +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Details about app recovery operation. - * - * @extends models['ProxyOnlyResource'] - */ -class SnapshotRecoveryRequest extends models['ProxyOnlyResource'] { - /** - * Create a SnapshotRecoveryRequest. - * @member {string} [snapshotTime] Point in time in which the app recovery - * should be attempted, formatted as a DateTime string. - * @member {object} [recoveryTarget] Specifies the web app that snapshot - * contents will be written to. - * @member {string} [recoveryTarget.location] Geographical location of the - * target web app, e.g. SouthEastAsia, SouthCentralUS - * @member {string} [recoveryTarget.id] ARM resource ID of the target 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 recovery 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 SnapshotRecoveryRequest - * - * @returns {object} metadata of SnapshotRecoveryRequest - * - */ - mapper() { - return { - required: false, - serializedName: 'SnapshotRecoveryRequest', - type: { - name: 'Composite', - className: 'SnapshotRecoveryRequest', - 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' - } - }, - recoveryTarget: { - required: false, - serializedName: 'properties.recoveryTarget', - type: { - name: 'Composite', - className: 'SnapshotRecoveryTarget' - } - }, - 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 = SnapshotRecoveryRequest; diff --git a/lib/services/websiteManagement2/lib/lib/models/snapshotRecoveryTarget.js b/lib/services/websiteManagement2/lib/lib/models/snapshotRecoveryTarget.js deleted file mode 100644 index 9770a44e27..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/snapshotRecoveryTarget.js +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Specifies the web app that snapshot contents will be written to. - * - */ -class SnapshotRecoveryTarget { - /** - * Create a SnapshotRecoveryTarget. - * @member {string} [location] Geographical location of the target web app, - * e.g. SouthEastAsia, SouthCentralUS - * @member {string} [id] ARM resource ID of the target 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 SnapshotRecoveryTarget - * - * @returns {object} metadata of SnapshotRecoveryTarget - * - */ - mapper() { - return { - required: false, - serializedName: 'SnapshotRecoveryTarget', - type: { - name: 'Composite', - className: 'SnapshotRecoveryTarget', - modelProperties: { - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = SnapshotRecoveryTarget; diff --git a/lib/services/websiteManagement2/lib/lib/models/solution.js b/lib/services/websiteManagement2/lib/lib/models/solution.js deleted file mode 100644 index 1b42d6409a..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/solution.js +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Class Representing 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/lib/models/sourceControl.js b/lib/services/websiteManagement2/lib/lib/models/sourceControl.js deleted file mode 100644 index 0c0d72a318..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/sourceControl.js +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * The source control OAuth token. - * - * @extends models['ProxyOnlyResource'] - */ -class SourceControl extends models['ProxyOnlyResource'] { - /** - * Create a SourceControl. - * @member {string} [sourceControlName] Name or source control type. - * @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' - } - }, - sourceControlName: { - required: false, - serializedName: 'properties.name', - 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/lib/models/sourceControlCollection.js b/lib/services/websiteManagement2/lib/lib/models/sourceControlCollection.js deleted file mode 100644 index 9fd89247ed..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/sourceControlCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/stackMajorVersion.js b/lib/services/websiteManagement2/lib/lib/models/stackMajorVersion.js deleted file mode 100644 index f8a3e54984..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/stackMajorVersion.js +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/stackMinorVersion.js b/lib/services/websiteManagement2/lib/lib/models/stackMinorVersion.js deleted file mode 100644 index 2154f681e0..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/stackMinorVersion.js +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/stampCapacity.js b/lib/services/websiteManagement2/lib/lib/models/stampCapacity.js deleted file mode 100644 index 8cb844d445..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/stampCapacity.js +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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: 'Default', 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3' - * @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. - */ - 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: [ 'Default', 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3' ] - } - }, - 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' - } - } - } - } - }; - } -} - -module.exports = StampCapacity; diff --git a/lib/services/websiteManagement2/lib/lib/models/stampCapacityCollection.js b/lib/services/websiteManagement2/lib/lib/models/stampCapacityCollection.js deleted file mode 100644 index 0d06935381..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/stampCapacityCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/statusCodesBasedTrigger.js b/lib/services/websiteManagement2/lib/lib/models/statusCodesBasedTrigger.js deleted file mode 100644 index dbbf1ac65e..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/statusCodesBasedTrigger.js +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/storageMigrationOptions.js b/lib/services/websiteManagement2/lib/lib/models/storageMigrationOptions.js deleted file mode 100644 index de8a5cd59a..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/storageMigrationOptions.js +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/storageMigrationResponse.js b/lib/services/websiteManagement2/lib/lib/models/storageMigrationResponse.js deleted file mode 100644 index 06af20fad8..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/storageMigrationResponse.js +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/stringDictionary.js b/lib/services/websiteManagement2/lib/lib/models/stringDictionary.js deleted file mode 100644 index 38f97b7edb..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/stringDictionary.js +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/tldLegalAgreement.js b/lib/services/websiteManagement2/lib/lib/models/tldLegalAgreement.js deleted file mode 100644 index 55671d5cb5..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/tldLegalAgreement.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/tldLegalAgreementCollection.js b/lib/services/websiteManagement2/lib/lib/models/tldLegalAgreementCollection.js deleted file mode 100644 index 78ce4ed7f2..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/tldLegalAgreementCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/topLevelDomain.js b/lib/services/websiteManagement2/lib/lib/models/topLevelDomain.js deleted file mode 100644 index 76d8577eaf..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/topLevelDomain.js +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * A top level domain object. - * - * @extends models['ProxyOnlyResource'] - */ -class TopLevelDomain extends models['ProxyOnlyResource'] { - /** - * Create a TopLevelDomain. - * @member {string} [domainName] Name of the top level domain. - * @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' - } - }, - domainName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, - privacy: { - required: false, - serializedName: 'properties.privacy', - type: { - name: 'Boolean' - } - } - } - } - }; - } -} - -module.exports = TopLevelDomain; diff --git a/lib/services/websiteManagement2/lib/lib/models/topLevelDomainAgreementOption.js b/lib/services/websiteManagement2/lib/lib/models/topLevelDomainAgreementOption.js deleted file mode 100644 index f444781f37..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/topLevelDomainAgreementOption.js +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/topLevelDomainCollection.js b/lib/services/websiteManagement2/lib/lib/models/topLevelDomainCollection.js deleted file mode 100644 index aa7c32fbb3..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/topLevelDomainCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/triggeredJobHistory.js b/lib/services/websiteManagement2/lib/lib/models/triggeredJobHistory.js deleted file mode 100644 index dda09c1cae..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/triggeredJobHistory.js +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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} [triggeredJobRuns] 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' - } - }, - triggeredJobRuns: { - required: false, - serializedName: 'properties.triggeredJobRuns', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'TriggeredJobRunElementType', - type: { - name: 'Composite', - className: 'TriggeredJobRun' - } - } - } - } - } - } - }; - } -} - -module.exports = TriggeredJobHistory; diff --git a/lib/services/websiteManagement2/lib/lib/models/triggeredJobHistoryCollection.js b/lib/services/websiteManagement2/lib/lib/models/triggeredJobHistoryCollection.js deleted file mode 100644 index 37516f3fba..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/triggeredJobHistoryCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/triggeredJobRun.js b/lib/services/websiteManagement2/lib/lib/models/triggeredJobRun.js deleted file mode 100644 index dafb649e30..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/triggeredJobRun.js +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Triggered Web Job Run Information. - * - * @extends models['ProxyOnlyResource'] - */ -class TriggeredJobRun extends models['ProxyOnlyResource'] { - /** - * Create a TriggeredJobRun. - * @member {string} [triggeredJobRunId] Job ID. - * @member {string} [triggeredJobRunName] 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' - } - }, - triggeredJobRunId: { - required: false, - serializedName: 'properties.id', - type: { - name: 'String' - } - }, - triggeredJobRunName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, - status: { - required: false, - serializedName: 'properties.status', - type: { - name: 'Enum', - allowedValues: [ 'Success', 'Failed', 'Error' ] - } - }, - startTime: { - required: false, - serializedName: 'properties.startTime', - type: { - name: 'DateTime' - } - }, - endTime: { - required: false, - serializedName: 'properties.endTime', - type: { - name: 'DateTime' - } - }, - duration: { - required: false, - serializedName: 'properties.duration', - type: { - name: 'String' - } - }, - outputUrl: { - required: false, - serializedName: 'properties.outputUrl', - type: { - name: 'String' - } - }, - errorUrl: { - required: false, - serializedName: 'properties.errorUrl', - type: { - name: 'String' - } - }, - url: { - required: false, - serializedName: 'properties.url', - type: { - name: 'String' - } - }, - jobName: { - required: false, - serializedName: 'properties.jobName', - type: { - name: 'String' - } - }, - trigger: { - required: false, - serializedName: 'properties.trigger', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = TriggeredJobRun; diff --git a/lib/services/websiteManagement2/lib/lib/models/triggeredWebJob.js b/lib/services/websiteManagement2/lib/lib/models/triggeredWebJob.js deleted file mode 100644 index 076ffffe05..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/triggeredWebJob.js +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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.triggeredJobRunId] Job ID. - * @member {string} [latestRun.triggeredJobRunName] 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} [triggeredWebJobName] Job name. Used as job identifier in - * ARM resource URI. - * @member {string} [runCommand] Run command. - * @member {string} [url] Job URL. - * @member {string} [extraInfoUrl] Extra Info URL. - * @member {string} [jobType] 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.latestRun', - type: { - name: 'Composite', - className: 'TriggeredJobRun' - } - }, - historyUrl: { - required: false, - serializedName: 'properties.historyUrl', - type: { - name: 'String' - } - }, - schedulerLogsUrl: { - required: false, - serializedName: 'properties.schedulerLogsUrl', - type: { - name: 'String' - } - }, - triggeredWebJobName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, - runCommand: { - required: false, - serializedName: 'properties.runCommand', - type: { - name: 'String' - } - }, - url: { - required: false, - serializedName: 'properties.url', - type: { - name: 'String' - } - }, - extraInfoUrl: { - required: false, - serializedName: 'properties.extraInfoUrl', - type: { - name: 'String' - } - }, - jobType: { - required: false, - serializedName: 'properties.jobType', - type: { - name: 'Enum', - allowedValues: [ 'Continuous', 'Triggered' ] - } - }, - error: { - required: false, - serializedName: 'properties.error', - type: { - name: 'String' - } - }, - usingSdk: { - required: false, - serializedName: 'properties.usingSdk', - 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/lib/models/triggeredWebJobCollection.js b/lib/services/websiteManagement2/lib/lib/models/triggeredWebJobCollection.js deleted file mode 100644 index 4affcd2633..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/triggeredWebJobCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/usage.js b/lib/services/websiteManagement2/lib/lib/models/usage.js deleted file mode 100644 index a8bb508dd5..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/usage.js +++ /dev/null @@ -1,162 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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} [usageName] Name of the quota. - * @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' - } - }, - usageName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - 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/lib/models/usageCollection.js b/lib/services/websiteManagement2/lib/lib/models/usageCollection.js deleted file mode 100644 index 566e79b52b..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/usageCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/user.js b/lib/services/websiteManagement2/lib/lib/models/user.js deleted file mode 100644 index 8f3d0fbad6..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/user.js +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * User crendentials used for publishing activity. - * - * @extends models['ProxyOnlyResource'] - */ -class User extends models['ProxyOnlyResource'] { - /** - * Create a User. - * @member {string} [userName] Username - * @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. - */ - 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' - } - }, - userName: { - required: false, - serializedName: 'properties.name', - 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' - } - } - } - } - }; - } -} - -module.exports = User; diff --git a/lib/services/websiteManagement2/lib/lib/models/validateRequest.js b/lib/services/websiteManagement2/lib/lib/models/validateRequest.js deleted file mode 100644 index 479983a00f..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/validateRequest.js +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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. - */ - 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' - } - } - } - } - }; - } -} - -module.exports = ValidateRequest; diff --git a/lib/services/websiteManagement2/lib/lib/models/validateResponse.js b/lib/services/websiteManagement2/lib/lib/models/validateResponse.js deleted file mode 100644 index e36d4735e4..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/validateResponse.js +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/validateResponseError.js b/lib/services/websiteManagement2/lib/lib/models/validateResponseError.js deleted file mode 100644 index 3fecb30d68..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/validateResponseError.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/virtualApplication.js b/lib/services/websiteManagement2/lib/lib/models/virtualApplication.js deleted file mode 100644 index c85bbd6402..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/virtualApplication.js +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/virtualDirectory.js b/lib/services/websiteManagement2/lib/lib/models/virtualDirectory.js deleted file mode 100644 index 6950d3d013..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/virtualDirectory.js +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/virtualIPMapping.js b/lib/services/websiteManagement2/lib/lib/models/virtualIPMapping.js deleted file mode 100644 index 34ac5296e9..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/virtualIPMapping.js +++ /dev/null @@ -1,76 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/virtualNetworkProfile.js b/lib/services/websiteManagement2/lib/lib/models/virtualNetworkProfile.js deleted file mode 100644 index c1f1b1b162..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/virtualNetworkProfile.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/vnetGateway.js b/lib/services/websiteManagement2/lib/lib/models/vnetGateway.js deleted file mode 100644 index 1019567d6e..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/vnetGateway.js +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/vnetInfo.js b/lib/services/websiteManagement2/lib/lib/models/vnetInfo.js deleted file mode 100644 index 6340d209a5..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/vnetInfo.js +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/vnetParameters.js b/lib/services/websiteManagement2/lib/lib/models/vnetParameters.js deleted file mode 100644 index a3a8a850f0..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/vnetParameters.js +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/vnetRoute.js b/lib/services/websiteManagement2/lib/lib/models/vnetRoute.js deleted file mode 100644 index 5df4cf5959..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/vnetRoute.js +++ /dev/null @@ -1,123 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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} [vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * @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' - } - }, - vnetRouteName: { - required: false, - serializedName: 'properties.name', - 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/lib/models/vnetValidationFailureDetails.js b/lib/services/websiteManagement2/lib/lib/models/vnetValidationFailureDetails.js deleted file mode 100644 index f8b35f16b6..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/vnetValidationFailureDetails.js +++ /dev/null @@ -1,105 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/vnetValidationTestFailure.js b/lib/services/websiteManagement2/lib/lib/models/vnetValidationTestFailure.js deleted file mode 100644 index bc2219df3a..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/vnetValidationTestFailure.js +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/models/webAppCollection.js b/lib/services/websiteManagement2/lib/lib/models/webAppCollection.js deleted file mode 100644 index 48876fe2b2..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/webAppCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/webAppInstanceCollection.js b/lib/services/websiteManagement2/lib/lib/models/webAppInstanceCollection.js deleted file mode 100644 index 326dc57d43..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/webAppInstanceCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/webJob.js b/lib/services/websiteManagement2/lib/lib/models/webJob.js deleted file mode 100644 index 8f2ed44730..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/webJob.js +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Web Job Information. - * - * @extends models['ProxyOnlyResource'] - */ -class WebJob extends models['ProxyOnlyResource'] { - /** - * Create a WebJob. - * @member {string} [webJobName] Job name. Used as job identifier in ARM - * resource URI. - * @member {string} [runCommand] Run command. - * @member {string} [url] Job URL. - * @member {string} [extraInfoUrl] Extra Info URL. - * @member {string} [jobType] 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' - } - }, - webJobName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, - runCommand: { - required: false, - serializedName: 'properties.runCommand', - type: { - name: 'String' - } - }, - url: { - required: false, - serializedName: 'properties.url', - type: { - name: 'String' - } - }, - extraInfoUrl: { - required: false, - serializedName: 'properties.extraInfoUrl', - type: { - name: 'String' - } - }, - jobType: { - required: false, - serializedName: 'properties.jobType', - type: { - name: 'Enum', - allowedValues: [ 'Continuous', 'Triggered' ] - } - }, - error: { - required: false, - serializedName: 'properties.error', - type: { - name: 'String' - } - }, - usingSdk: { - required: false, - serializedName: 'properties.usingSdk', - 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/lib/models/webJobCollection.js b/lib/services/websiteManagement2/lib/lib/models/webJobCollection.js deleted file mode 100644 index 6e3f47cb45..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/webJobCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/workerPool.js b/lib/services/websiteManagement2/lib/lib/models/workerPool.js deleted file mode 100644 index b7896d3594..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/workerPool.js +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/workerPoolCollection.js b/lib/services/websiteManagement2/lib/lib/models/workerPoolCollection.js deleted file mode 100644 index a2595a2197..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/workerPoolCollection.js +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * 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/lib/models/workerPoolResource.js b/lib/services/websiteManagement2/lib/lib/models/workerPoolResource.js deleted file mode 100644 index b8da1fe66f..0000000000 --- a/lib/services/websiteManagement2/lib/lib/models/workerPoolResource.js +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * 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/lib/operations/appServiceCertificateOrders.js b/lib/services/websiteManagement2/lib/lib/operations/appServiceCertificateOrders.js deleted file mode 100644 index 66ac67f507..0000000000 --- a/lib/services/websiteManagement2/lib/lib/operations/appServiceCertificateOrders.js +++ /dev/null @@ -1,6774 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * @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.'); - } - let apiVersion = '2015-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.CertificateRegistration/certificateOrders'; - 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['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.'); - } - let apiVersion = '2015-08-01'; - // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.'); - } - let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(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.'); - } - let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(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.'); - } - let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.'); - } - let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.'); - } - let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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; - let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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 (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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.'); - } - let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.'); - } - let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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 = { - 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.'); - } - let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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 = { - 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.'); - } - let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2015-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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/lib/operations/appServiceEnvironments.js b/lib/services/websiteManagement2/lib/lib/operations/appServiceEnvironments.js deleted file mode 100644 index 77b8ecdb35..0000000000 --- a/lib/services/websiteManagement2/lib/lib/operations/appServiceEnvironments.js +++ /dev/null @@ -1,18725 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * @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.'); - } - let apiVersion = '2016-09-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.Web/hostingEnvironments'; - 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['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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 {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 {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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // 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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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; - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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; - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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; - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // 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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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; - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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; - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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; - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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; - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 {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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(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; - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(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 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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 _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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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._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._beginCreateOrUpdateMultiRolePool = _beginCreateOrUpdateMultiRolePool; - this._beginResume = _beginResume; - this._beginSuspend = _beginSuspend; - this._beginCreateOrUpdateWorkerPool = _beginCreateOrUpdateWorkerPool; - this._listNext = _listNext; - this._listByResourceGroupNext = _listByResourceGroupNext; - this._listCapacitiesNext = _listCapacitiesNext; - 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._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 {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 {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 {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 {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 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 {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 {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 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 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 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/lib/operations/appServicePlans.js b/lib/services/websiteManagement2/lib/lib/operations/appServicePlans.js deleted file mode 100644 index 418daf0d0c..0000000000 --- a/lib/services/websiteManagement2/lib/lib/operations/appServicePlans.js +++ /dev/null @@ -1,10483 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * @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; - let apiVersion = '2016-09-01'; - // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.appServicePlanName Name for the App Service - * plan. - * - * @param {string} [appServicePlan.workerTierName] Target worker tier assigned - * to the App Service plan. - * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * - * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for - * the App Service Environment to use for the App Service plan. - * - * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of - * the App Service Environment. - * - * @param {boolean} [appServicePlan.perSiteScaling] If true, apps - * assigned to this App Service plan can be scaled independently. - * If false, apps assigned to this App Service plan will scale to - * all instances of the plan. - * - * @param {boolean} [appServicePlan.isSpot] If true, this App - * Service Plan owns spot instances. - * - * @param {date} [appServicePlan.spotExpirationTime] The time when the server - * farm expires. Valid only if it is a spot server farm. - * - * @param {boolean} [appServicePlan.reserved] If Linux 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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(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.appServicePlanPatchResourceName Name for the - * App Service plan. - * - * @param {string} [appServicePlan.workerTierName] Target worker tier assigned - * to the App Service plan. - * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * - * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for - * the App Service Environment to use for the App Service plan. - * - * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of - * the App Service Environment. - * - * @param {boolean} [appServicePlan.perSiteScaling] If true, apps - * assigned to this App Service plan can be scaled independently. - * If false, apps assigned to this App Service plan will scale to - * all instances of the plan. - * - * @param {boolean} [appServicePlan.isSpot] If true, this App - * Service Plan owns spot instances. - * - * @param {date} [appServicePlan.spotExpirationTime] The time when the server - * farm expires. Valid only if it is a spot server farm. - * - * @param {boolean} [appServicePlan.reserved] If Linux 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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // 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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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; - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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; - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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; - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // 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; - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // 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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // 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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * - * @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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(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.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * - * @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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.appServicePlanName Name for the App Service - * plan. - * - * @param {string} [appServicePlan.workerTierName] Target worker tier assigned - * to the App Service plan. - * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * - * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for - * the App Service Environment to use for the App Service plan. - * - * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of - * the App Service Environment. - * - * @param {boolean} [appServicePlan.perSiteScaling] If true, apps - * assigned to this App Service plan can be scaled independently. - * If false, apps assigned to this App Service plan will scale to - * all instances of the plan. - * - * @param {boolean} [appServicePlan.isSpot] If true, this App - * Service Plan owns spot instances. - * - * @param {date} [appServicePlan.spotExpirationTime] The time when the server - * farm expires. Valid only if it is a spot server farm. - * - * @param {boolean} [appServicePlan.reserved] If Linux 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.'); - } - let apiVersion = '2016-09-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.appServicePlanName Name for the App Service - * plan. - * - * @param {string} [appServicePlan.workerTierName] Target worker tier assigned - * to the App Service plan. - * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * - * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for - * the App Service Environment to use for the App Service plan. - * - * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of - * the App Service Environment. - * - * @param {boolean} [appServicePlan.perSiteScaling] If true, apps - * assigned to this App Service plan can be scaled independently. - * If false, apps assigned to this App Service plan will scale to - * all instances of the plan. - * - * @param {boolean} [appServicePlan.isSpot] If true, this App - * Service Plan owns spot instances. - * - * @param {date} [appServicePlan.spotExpirationTime] The time when the server - * farm expires. Valid only if it is a spot server farm. - * - * @param {boolean} [appServicePlan.reserved] If Linux 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.appServicePlanName Name for the App Service - * plan. - * - * @param {string} [appServicePlan.workerTierName] Target worker tier assigned - * to the App Service plan. - * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * - * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for - * the App Service Environment to use for the App Service plan. - * - * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of - * the App Service Environment. - * - * @param {boolean} [appServicePlan.perSiteScaling] If true, apps - * assigned to this App Service plan can be scaled independently. - * If false, apps assigned to this App Service plan will scale to - * all instances of the plan. - * - * @param {boolean} [appServicePlan.isSpot] If true, this App - * Service Plan owns spot instances. - * - * @param {date} [appServicePlan.spotExpirationTime] The time when the server - * farm expires. Valid only if it is a spot server farm. - * - * @param {boolean} [appServicePlan.reserved] If Linux 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.appServicePlanPatchResourceName Name for the - * App Service plan. - * - * @param {string} [appServicePlan.workerTierName] Target worker tier assigned - * to the App Service plan. - * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * - * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for - * the App Service Environment to use for the App Service plan. - * - * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of - * the App Service Environment. - * - * @param {boolean} [appServicePlan.perSiteScaling] If true, apps - * assigned to this App Service plan can be scaled independently. - * If false, apps assigned to this App Service plan will scale to - * all instances of the plan. - * - * @param {boolean} [appServicePlan.isSpot] If true, this App - * Service Plan owns spot instances. - * - * @param {date} [appServicePlan.spotExpirationTime] The time when the server - * farm expires. Valid only if it is a spot server farm. - * - * @param {boolean} [appServicePlan.reserved] If Linux 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.appServicePlanPatchResourceName Name for the - * App Service plan. - * - * @param {string} [appServicePlan.workerTierName] Target worker tier assigned - * to the App Service plan. - * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * - * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for - * the App Service Environment to use for the App Service plan. - * - * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of - * the App Service Environment. - * - * @param {boolean} [appServicePlan.perSiteScaling] If true, apps - * assigned to this App Service plan can be scaled independently. - * If false, apps assigned to this App Service plan will scale to - * all instances of the plan. - * - * @param {boolean} [appServicePlan.isSpot] If true, this App - * Service Plan owns spot instances. - * - * @param {date} [appServicePlan.spotExpirationTime] The time when the server - * farm expires. Valid only if it is a spot server farm. - * - * @param {boolean} [appServicePlan.reserved] If Linux 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.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * - * @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.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * - * @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.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * - * @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.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * - * @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.appServicePlanName Name for the App Service - * plan. - * - * @param {string} [appServicePlan.workerTierName] Target worker tier assigned - * to the App Service plan. - * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * - * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for - * the App Service Environment to use for the App Service plan. - * - * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of - * the App Service Environment. - * - * @param {boolean} [appServicePlan.perSiteScaling] If true, apps - * assigned to this App Service plan can be scaled independently. - * If false, apps assigned to this App Service plan will scale to - * all instances of the plan. - * - * @param {boolean} [appServicePlan.isSpot] If true, this App - * Service Plan owns spot instances. - * - * @param {date} [appServicePlan.spotExpirationTime] The time when the server - * farm expires. Valid only if it is a spot server farm. - * - * @param {boolean} [appServicePlan.reserved] If Linux 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.appServicePlanName Name for the App Service - * plan. - * - * @param {string} [appServicePlan.workerTierName] Target worker tier assigned - * to the App Service plan. - * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * - * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for - * the App Service Environment to use for the App Service plan. - * - * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of - * the App Service Environment. - * - * @param {boolean} [appServicePlan.perSiteScaling] If true, apps - * assigned to this App Service plan can be scaled independently. - * If false, apps assigned to this App Service plan will scale to - * all instances of the plan. - * - * @param {boolean} [appServicePlan.isSpot] If true, this App - * Service Plan owns spot instances. - * - * @param {date} [appServicePlan.spotExpirationTime] The time when the server - * farm expires. Valid only if it is a spot server farm. - * - * @param {boolean} [appServicePlan.reserved] If Linux 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/lib/operations/billingMeters.js b/lib/services/websiteManagement2/lib/lib/operations/billingMeters.js deleted file mode 100644 index 19ed4bd40c..0000000000 --- a/lib/services/websiteManagement2/lib/lib/operations/billingMeters.js +++ /dev/null @@ -1,483 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.billingLocation] Azure Location of billable - * resource - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link BillingMeterCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _list(options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - let billingLocation = (options && options.billingLocation !== undefined) ? options.billingLocation : undefined; - let apiVersion = '2016-03-01'; - // Validate - try { - if (billingLocation !== null && billingLocation !== undefined && typeof billingLocation.valueOf() !== 'string') { - throw new Error('billingLocation must be of type string.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/billingMeters'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - if (billingLocation !== null && billingLocation !== undefined) { - queryParameters.push('billingLocation=' + encodeURIComponent(billingLocation)); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BillingMeterCollection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link BillingMeterCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _listNext(nextPageLink, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BillingMeterCollection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** Class representing a BillingMeters. */ -class BillingMeters { - /** - * Create a BillingMeters. - * @param {WebSiteManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._listNext = _listNext; - } - - /** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.billingLocation] Azure Location of billable - * resource - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.billingLocation] Azure Location of billable - * resource - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {BillingMeterCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link BillingMeterCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - list(options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(options, optionalCallback); - } - } - - /** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {BillingMeterCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link BillingMeterCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listNext(nextPageLink, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = BillingMeters; diff --git a/lib/services/websiteManagement2/lib/lib/operations/certificateRegistrationProvider.js b/lib/services/websiteManagement2/lib/lib/operations/certificateRegistrationProvider.js deleted file mode 100644 index d46700b376..0000000000 --- a/lib/services/websiteManagement2/lib/lib/operations/certificateRegistrationProvider.js +++ /dev/null @@ -1,475 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * @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.'); - } - let apiVersion = '2015-08-01'; - // Validate - try { - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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/lib/operations/certificates.js b/lib/services/websiteManagement2/lib/lib/operations/certificates.js deleted file mode 100644 index 601943e575..0000000000 --- a/lib/services/websiteManagement2/lib/lib/operations/certificates.js +++ /dev/null @@ -1,2089 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * @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.'); - } - let apiVersion = '2016-03-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.Web/certificates'; - 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['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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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/lib/operations/deletedWebApps.js b/lib/services/websiteManagement2/lib/lib/operations/deletedWebApps.js deleted file mode 100644 index 50d8c1e457..0000000000 --- a/lib/services/websiteManagement2/lib/lib/operations/deletedWebApps.js +++ /dev/null @@ -1,467 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * @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.'); - } - let apiVersion = '2016-03-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.Web/deletedSites'; - 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['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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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/lib/operations/diagnostics.js b/lib/services/websiteManagement2/lib/lib/operations/diagnostics.js deleted file mode 100644 index 9eb79eb3f3..0000000000 --- a/lib/services/websiteManagement2/lib/lib/operations/diagnostics.js +++ /dev/null @@ -1,6345 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * @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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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; - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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; - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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 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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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; - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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; - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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._listSiteDiagnosticCategories = _listSiteDiagnosticCategories; - this._getSiteDiagnosticCategory = _getSiteDiagnosticCategory; - this._listSiteAnalyses = _listSiteAnalyses; - this._getSiteAnalysis = _getSiteAnalysis; - this._executeSiteAnalysis = _executeSiteAnalysis; - this._listSiteDetectors = _listSiteDetectors; - this._getSiteDetector = _getSiteDetector; - this._executeSiteDetector = _executeSiteDetector; - 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._listSiteDiagnosticCategoriesNext = _listSiteDiagnosticCategoriesNext; - this._listSiteAnalysesNext = _listSiteAnalysesNext; - this._listSiteDetectorsNext = _listSiteDetectorsNext; - this._getSiteDetectorNext = _getSiteDetectorNext; - this._listSiteDiagnosticCategoriesSlotNext = _listSiteDiagnosticCategoriesSlotNext; - this._listSiteAnalysesSlotNext = _listSiteAnalysesSlotNext; - this._listSiteDetectorsSlotNext = _listSiteDetectorsSlotNext; - this._getSiteDetectorSlotNext = _getSiteDetectorSlotNext; - } - - /** - * @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 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 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 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/lib/operations/domainRegistrationProvider.js b/lib/services/websiteManagement2/lib/lib/operations/domainRegistrationProvider.js deleted file mode 100644 index 6de060c6f0..0000000000 --- a/lib/services/websiteManagement2/lib/lib/operations/domainRegistrationProvider.js +++ /dev/null @@ -1,475 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * @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.'); - } - let apiVersion = '2015-04-01'; - // Validate - try { - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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/lib/operations/domains.js b/lib/services/websiteManagement2/lib/lib/operations/domains.js deleted file mode 100644 index 87984bef5e..0000000000 --- a/lib/services/websiteManagement2/lib/lib/operations/domains.js +++ /dev/null @@ -1,5682 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * @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; - let apiVersion = '2015-04-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 (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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2015-04-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.DomainRegistration/domains'; - 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['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.'); - } - let apiVersion = '2015-04-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.DomainRegistration/generateSsoRequest'; - 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) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2015-04-01'; - // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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; - let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(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.'); - } - let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(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.'); - } - let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - 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); - }); -} - -/** - * @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.'); - } - let apiVersion = '2015-04-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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/lib/operations/index.d.ts b/lib/services/websiteManagement2/lib/lib/operations/index.d.ts deleted file mode 100644 index 7ca9bd6da2..0000000000 --- a/lib/services/websiteManagement2/lib/lib/operations/index.d.ts +++ /dev/null @@ -1,56146 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. -*/ - -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 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 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 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 Get Diagnostics Categories - * - * Get Diagnostics Categories - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listSiteDiagnosticCategoriesSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get Diagnostics Categories - * - * Get Diagnostics Categories - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {DiagnosticCategoryCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {DiagnosticCategoryCollection} [result] - The deserialized result object if an error did not occur. - * See {@link DiagnosticCategoryCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listSiteDiagnosticCategoriesSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listSiteDiagnosticCategoriesSlotNext(nextPageLink: string, callback: ServiceCallback): void; - listSiteDiagnosticCategoriesSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get Site Analyses - * - * Get Site Analyses - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listSiteAnalysesSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get Site Analyses - * - * Get Site Analyses - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {DiagnosticAnalysisCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {DiagnosticAnalysisCollection} [result] - The deserialized result object if an error did not occur. - * See {@link DiagnosticAnalysisCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listSiteAnalysesSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listSiteAnalysesSlotNext(nextPageLink: string, callback: ServiceCallback): void; - listSiteAnalysesSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get Detectors - * - * Get Detectors - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listSiteDetectorsSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get Detectors - * - * Get Detectors - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {DiagnosticDetectorCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {DiagnosticDetectorCollection} [result] - The deserialized result object if an error did not occur. - * See {@link DiagnosticDetectorCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listSiteDetectorsSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listSiteDetectorsSlotNext(nextPageLink: string, callback: ServiceCallback): void; - listSiteDetectorsSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get Detector - * - * Get Detector - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getSiteDetectorSlotNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get Detector - * - * Get Detector - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {DiagnosticDetectorCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {DiagnosticDetectorCollection} [result] - The deserialized result object if an error did not occur. - * See {@link DiagnosticDetectorCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getSiteDetectorSlotNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getSiteDetectorSlotNext(nextPageLink: string, callback: ServiceCallback): void; - getSiteDetectorSlotNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Provider - * __NOTE__: An instance of this class is automatically created for an - * instance of the WebSiteManagementClient. - */ -export interface Provider { - - - /** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.osTypeSelected] Possible values include: 'Windows', - * 'Linux' - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getAvailableStacksWithHttpOperationResponse(options?: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.osTypeSelected] Possible values include: 'Windows', - * 'Linux' - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ApplicationStackCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ApplicationStackCollection} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationStackCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getAvailableStacks(options?: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - getAvailableStacks(callback: ServiceCallback): void; - getAvailableStacks(options: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets all available operations for the Microsoft.Web resource - * provider. Also exposes resource metric definitions - * - * Gets all available operations for the Microsoft.Web resource provider. Also - * exposes resource metric definitions - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listOperationsWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets all available operations for the Microsoft.Web resource - * provider. Also exposes resource metric definitions - * - * Gets all available operations for the Microsoft.Web resource provider. Also - * exposes resource metric definitions - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {CsmOperationCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {CsmOperationCollection} [result] - The deserialized result object if an error did not occur. - * See {@link CsmOperationCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listOperations(options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listOperations(callback: ServiceCallback): void; - listOperations(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.osTypeSelected] Possible values include: 'Windows', - * 'Linux' - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getAvailableStacksOnPremWithHttpOperationResponse(options?: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.osTypeSelected] Possible values include: 'Windows', - * 'Linux' - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ApplicationStackCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ApplicationStackCollection} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationStackCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getAvailableStacksOnPrem(options?: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - getAvailableStacksOnPrem(callback: ServiceCallback): void; - getAvailableStacksOnPrem(options: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getAvailableStacksNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ApplicationStackCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ApplicationStackCollection} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationStackCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getAvailableStacksNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getAvailableStacksNext(nextPageLink: string, callback: ServiceCallback): void; - getAvailableStacksNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets all available operations for the Microsoft.Web resource - * provider. Also exposes resource metric definitions - * - * Gets all available operations for the Microsoft.Web resource provider. Also - * exposes resource metric definitions - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listOperationsNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets all available operations for the Microsoft.Web resource - * provider. Also exposes resource metric definitions - * - * Gets all available operations for the Microsoft.Web resource provider. Also - * exposes resource metric definitions - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {CsmOperationCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {CsmOperationCollection} [result] - The deserialized result object if an error did not occur. - * See {@link CsmOperationCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listOperationsNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listOperationsNext(nextPageLink: string, callback: ServiceCallback): void; - listOperationsNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getAvailableStacksOnPremNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ApplicationStackCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ApplicationStackCollection} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationStackCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getAvailableStacksOnPremNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getAvailableStacksOnPremNext(nextPageLink: string, callback: ServiceCallback): void; - getAvailableStacksOnPremNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * Recommendations - * __NOTE__: An instance of this class is automatically created for an - * instance of the WebSiteManagementClient. - */ -export interface Recommendations { - - - /** - * @summary List all recommendations for a subscription. - * - * List all recommendations for a subscription. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.featured] Specify true to return only - * the most critical recommendations. The default is false, which - * returns all recommendations. - * - * @param {string} [options.filter] Filter is specified by using OData syntax. - * Example: $filter=channels 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=channels 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 {string} [options.filter] Filter is specified by using OData syntax. - * Example: $filter=channels 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?: { 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 {string} [options.filter] Filter is specified by using OData syntax. - * Example: $filter=channels 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?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listHistoryForWebApp(resourceGroupName: string, siteName: string, callback: ServiceCallback): void; - listHistoryForWebApp(resourceGroupName: string, siteName: string, options: { 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=channels - * 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=channels - * 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 - * 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; -} - -/** - * @class - * BillingMeters - * __NOTE__: An instance of this class is automatically created for an - * instance of the WebSiteManagementClient. - */ -export interface BillingMeters { - - - /** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.billingLocation] Azure Location of billable - * resource - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listWithHttpOperationResponse(options?: { billingLocation? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.billingLocation] Azure Location of billable - * resource - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {BillingMeterCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {BillingMeterCollection} [result] - The deserialized result object if an error did not occur. - * See {@link BillingMeterCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - list(options?: { billingLocation? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - list(callback: ServiceCallback): void; - list(options: { billingLocation? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listNextWithHttpOperationResponse(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {BillingMeterCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {BillingMeterCollection} [result] - The deserialized result object if an error did not occur. - * See {@link BillingMeterCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listNext(nextPageLink: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNext(nextPageLink: string, callback: ServiceCallback): void; - listNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; -} - -/** - * @class - * WebApps - * __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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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' - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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' - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} 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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @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 {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * - * @param {object} [options.customHeaders] Headers that 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, skipDnsRegistration? : 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [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, skipDnsRegistration? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; - deleteMethod(resourceGroupName: string, name: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, name: string, options: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, skipDnsRegistration? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} 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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - update(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, callback: ServiceCallback): void; - update(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, options: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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 Discovers an existing app backup that can be restored from a blob - * in Azure storage. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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. - */ - discoverRestoreWithHttpOperationResponse(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. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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. - */ - discoverRestore(resourceGroupName: string, name: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - discoverRestore(resourceGroupName: string, name: string, request: models.RestoreRequest, callback: ServiceCallback): void; - discoverRestore(resourceGroupName: string, name: string, request: models.RestoreRequest, 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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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' - * - * @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' - * - * @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 {RestoreResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {RestoreResponse} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} for more information. - * - * {WebResource} [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 {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 {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 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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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 {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 {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 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 {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 {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 {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.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that 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 {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 {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 {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.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 {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 {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 {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.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that 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 {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 {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 {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.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. - */ - getWebSiteContainerLogsZipWithHttpOperationResponse(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. - */ - getWebSiteContainerLogsZip(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getWebSiteContainerLogsZip(resourceGroupName: string, name: string, callback: ServiceCallback): void; - getWebSiteContainerLogsZip(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 {string} [deployment.deploymentId] Identifier for deployment. - * - * @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 {string} [deployment.deploymentId] Identifier for deployment. - * - * @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 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.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.scriptRootPathHref] Script root path URI. - * - * @param {string} [functionEnvelope.scriptHref] Script URI. - * - * @param {string} [functionEnvelope.configHref] Config URI. - * - * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. - * - * @param {string} [functionEnvelope.href] Function URI. - * - * @param {object} [functionEnvelope.config] Config information. - * - * @param {object} [functionEnvelope.files] File list. - * - * @param {string} [functionEnvelope.testData] Test data used when testing via - * the Azure Portal. - * - * @param {string} [functionEnvelope.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {FunctionEnvelope} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {FunctionEnvelope} [result] - The deserialized result object if an error did not occur. - * See {@link FunctionEnvelope} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createFunction(resourceGroupName: string, name: string, functionName: string, functionEnvelope: models.FunctionEnvelope, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createFunction(resourceGroupName: string, name: string, functionName: string, functionEnvelope: models.FunctionEnvelope, callback: ServiceCallback): void; - createFunction(resourceGroupName: string, name: string, functionName: string, functionEnvelope: models.FunctionEnvelope, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Delete a function for web site, or a deployment slot. - * - * Delete a function for web site, or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} functionName Function name. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - deleteFunctionWithHttpOperationResponse(resourceGroupName: string, name: string, functionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Delete a function for web site, or a deployment slot. - * - * Delete a function for web site, or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} functionName Function name. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - deleteFunction(resourceGroupName: string, name: string, functionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteFunction(resourceGroupName: string, name: string, functionName: string, callback: ServiceCallback): void; - deleteFunction(resourceGroupName: string, name: string, functionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get function secrets for a function in a web site, or a deployment - * slot. - * - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} functionName Function name. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listFunctionSecretsWithHttpOperationResponse(resourceGroupName: string, name: string, functionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get function secrets for a function in a web site, or a deployment - * slot. - * - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} functionName Function name. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {FunctionSecrets} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {FunctionSecrets} [result] - The deserialized result object if an error did not occur. - * See {@link FunctionSecrets} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listFunctionSecrets(resourceGroupName: string, name: string, functionName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listFunctionSecrets(resourceGroupName: string, name: string, functionName: string, callback: ServiceCallback): void; - listFunctionSecrets(resourceGroupName: string, name: string, functionName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get hostname bindings for an app or a deployment slot. - * - * Get hostname bindings for an app or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listHostNameBindingsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get hostname bindings for an app or a deployment slot. - * - * Get hostname bindings for an app or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {HostNameBindingCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {HostNameBindingCollection} [result] - The deserialized result object if an error did not occur. - * See {@link HostNameBindingCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listHostNameBindings(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listHostNameBindings(resourceGroupName: string, name: string, callback: ServiceCallback): void; - listHostNameBindings(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get the named hostname binding for an app (or deployment slot, if - * specified). - * - * Get the named hostname binding for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} hostName Hostname in the hostname binding. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getHostNameBindingWithHttpOperationResponse(resourceGroupName: string, name: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get the named hostname binding for an app (or deployment slot, if - * specified). - * - * Get the named hostname binding for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} hostName Hostname in the hostname binding. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {HostNameBinding} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {HostNameBinding} [result] - The deserialized result object if an error did not occur. - * See {@link HostNameBinding} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getHostNameBinding(resourceGroupName: string, name: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getHostNameBinding(resourceGroupName: string, name: string, hostName: string, callback: ServiceCallback): void; - getHostNameBinding(resourceGroupName: string, name: string, hostName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Creates a hostname binding for an app. - * - * Creates a hostname binding for an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} hostName Hostname in the hostname binding. - * - * @param {object} hostNameBinding Binding details. This is the JSON - * representation of a HostNameBinding object. - * - * @param {string} [hostNameBinding.siteName] App Service app name. - * - * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain - * resource URI. - * - * @param {string} [hostNameBinding.azureResourceName] Azure resource name. - * - * @param {string} [hostNameBinding.azureResourceType] Azure resource type. - * Possible values include: 'Website', 'TrafficManager' - * - * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS - * record type. Possible values include: 'CName', 'A' - * - * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible - * values include: 'Verified', 'Managed' - * - * @param {string} [hostNameBinding.sslState] SSL type. Possible values - * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' - * - * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint - * - * @param {string} [hostNameBinding.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateHostNameBindingWithHttpOperationResponse(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Creates a hostname binding for an app. - * - * Creates a hostname binding for an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} hostName Hostname in the hostname binding. - * - * @param {object} hostNameBinding Binding details. This is the JSON - * representation of a HostNameBinding object. - * - * @param {string} [hostNameBinding.siteName] App Service app name. - * - * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain - * resource URI. - * - * @param {string} [hostNameBinding.azureResourceName] Azure resource name. - * - * @param {string} [hostNameBinding.azureResourceType] Azure resource type. - * Possible values include: 'Website', 'TrafficManager' - * - * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS - * record type. Possible values include: 'CName', 'A' - * - * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible - * values include: 'Verified', 'Managed' - * - * @param {string} [hostNameBinding.sslState] SSL type. Possible values - * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' - * - * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint - * - * @param {string} [hostNameBinding.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {HostNameBinding} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {HostNameBinding} [result] - The deserialized result object if an error did not occur. - * See {@link HostNameBinding} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdateHostNameBinding(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdateHostNameBinding(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, callback: ServiceCallback): void; - createOrUpdateHostNameBinding(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Deletes a hostname binding for an app. - * - * Deletes a hostname binding for an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} hostName Hostname in the hostname binding. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - deleteHostNameBindingWithHttpOperationResponse(resourceGroupName: string, name: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Deletes a hostname binding for an app. - * - * Deletes a hostname binding for an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} hostName Hostname in the hostname binding. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - deleteHostNameBinding(resourceGroupName: string, name: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteHostNameBinding(resourceGroupName: string, name: string, hostName: string, callback: ServiceCallback): void; - deleteHostNameBinding(resourceGroupName: string, name: string, hostName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web - * App. - * - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getHybridConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web - * App. - * - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {HybridConnection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {HybridConnection} [result] - The deserialized result object if an error did not occur. - * See {@link HybridConnection} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, callback: ServiceCallback): void; - getHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Creates a new Hybrid Connection using a Service Bus relay. - * - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} connectionEnvelope The details of the hybrid connection. - * - * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the - * Service Bus namespace. - * - * @param {string} [connectionEnvelope.relayName] The name of the Service Bus - * relay. - * - * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service - * Bus relay. - * - * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. - * - * @param {number} [connectionEnvelope.port] The port of the endpoint. - * - * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus - * key which has Send permissions. This is used to authenticate to Service Bus. - * - * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service - * Bus key. This is used to authenticate to Service Bus. In ARM this key will - * not be returned - * normally, use the POST /listKeys API instead. - * - * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the - * service bus endpoint. By default this is .servicebus.windows.net - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateHybridConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Creates a new Hybrid Connection using a Service Bus relay. - * - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} connectionEnvelope The details of the hybrid connection. - * - * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the - * Service Bus namespace. - * - * @param {string} [connectionEnvelope.relayName] The name of the Service Bus - * relay. - * - * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service - * Bus relay. - * - * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. - * - * @param {number} [connectionEnvelope.port] The port of the endpoint. - * - * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus - * key which has Send permissions. This is used to authenticate to Service Bus. - * - * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service - * Bus key. This is used to authenticate to Service Bus. In ARM this key will - * not be returned - * normally, use the POST /listKeys API instead. - * - * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the - * service bus endpoint. By default this is .servicebus.windows.net - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {HybridConnection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {HybridConnection} [result] - The deserialized result object if an error did not occur. - * See {@link HybridConnection} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, callback: ServiceCallback): void; - createOrUpdateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Removes a Hybrid Connection from this site. - * - * Removes a Hybrid Connection from this site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - deleteHybridConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Removes a Hybrid Connection from this site. - * - * Removes a Hybrid Connection from this site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - deleteHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, callback: ServiceCallback): void; - deleteHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Creates a new Hybrid Connection using a Service Bus relay. - * - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} connectionEnvelope The details of the hybrid connection. - * - * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the - * Service Bus namespace. - * - * @param {string} [connectionEnvelope.relayName] The name of the Service Bus - * relay. - * - * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service - * Bus relay. - * - * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. - * - * @param {number} [connectionEnvelope.port] The port of the endpoint. - * - * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus - * key which has Send permissions. This is used to authenticate to Service Bus. - * - * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service - * Bus key. This is used to authenticate to Service Bus. In ARM this key will - * not be returned - * normally, use the POST /listKeys API instead. - * - * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the - * service bus endpoint. By default this is .servicebus.windows.net - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - updateHybridConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Creates a new Hybrid Connection using a Service Bus relay. - * - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} connectionEnvelope The details of the hybrid connection. - * - * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the - * Service Bus namespace. - * - * @param {string} [connectionEnvelope.relayName] The name of the Service Bus - * relay. - * - * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service - * Bus relay. - * - * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. - * - * @param {number} [connectionEnvelope.port] The port of the endpoint. - * - * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus - * key which has Send permissions. This is used to authenticate to Service Bus. - * - * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service - * Bus key. This is used to authenticate to Service Bus. In ARM this key will - * not be returned - * normally, use the POST /listKeys API instead. - * - * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the - * service bus endpoint. By default this is .servicebus.windows.net - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {HybridConnection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {HybridConnection} [result] - The deserialized result object if an error did not occur. - * See {@link HybridConnection} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - updateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, callback: ServiceCallback): void; - updateHybridConnection(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets the send key name and value for a Hybrid Connection. - * - * Gets the send key name and value for a Hybrid Connection. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listHybridConnectionKeysWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets the send key name and value for a Hybrid Connection. - * - * Gets the send key name and value for a Hybrid Connection. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {HybridConnectionKey} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {HybridConnectionKey} [result] - The deserialized result object if an error did not occur. - * See {@link HybridConnectionKey} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listHybridConnectionKeys(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listHybridConnectionKeys(resourceGroupName: string, name: string, namespaceName: string, relayName: string, callback: ServiceCallback): void; - listHybridConnectionKeys(resourceGroupName: string, name: string, namespaceName: string, relayName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listHybridConnectionsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {HybridConnection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {HybridConnection} [result] - The deserialized result object if an error did not occur. - * See {@link HybridConnection} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listHybridConnections(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listHybridConnections(resourceGroupName: string, name: string, callback: ServiceCallback): void; - listHybridConnections(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets hybrid connections configured for an app (or deployment slot, - * if specified). - * - * Gets hybrid connections configured for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listRelayServiceConnectionsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets hybrid connections configured for an app (or deployment slot, - * if specified). - * - * Gets hybrid connections configured for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {RelayServiceConnectionEntity} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. - * See {@link RelayServiceConnectionEntity} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listRelayServiceConnections(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listRelayServiceConnections(resourceGroupName: string, name: string, callback: ServiceCallback): void; - listRelayServiceConnections(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets a hybrid connection configuration by its name. - * - * Gets a hybrid connection configuration by its name. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getRelayServiceConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets a hybrid connection configuration by its name. - * - * Gets a hybrid connection configuration by its name. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {RelayServiceConnectionEntity} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. - * See {@link RelayServiceConnectionEntity} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, callback: ServiceCallback): void; - getRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). - * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {object} connectionEnvelope Details of the hybrid connection - * configuration. - * - * @param {string} [connectionEnvelope.entityName] - * - * @param {string} [connectionEnvelope.entityConnectionString] - * - * @param {string} [connectionEnvelope.resourceType] - * - * @param {string} [connectionEnvelope.resourceConnectionString] - * - * @param {string} [connectionEnvelope.hostname] - * - * @param {number} [connectionEnvelope.port] - * - * @param {string} [connectionEnvelope.biztalkUri] - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateRelayServiceConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). - * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {object} connectionEnvelope Details of the hybrid connection - * configuration. - * - * @param {string} [connectionEnvelope.entityName] - * - * @param {string} [connectionEnvelope.entityConnectionString] - * - * @param {string} [connectionEnvelope.resourceType] - * - * @param {string} [connectionEnvelope.resourceConnectionString] - * - * @param {string} [connectionEnvelope.hostname] - * - * @param {number} [connectionEnvelope.port] - * - * @param {string} [connectionEnvelope.biztalkUri] - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {RelayServiceConnectionEntity} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. - * See {@link RelayServiceConnectionEntity} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, callback: ServiceCallback): void; - createOrUpdateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Deletes a relay service connection by its name. - * - * Deletes a relay service connection by its name. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - deleteRelayServiceConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Deletes a relay service connection by its name. - * - * Deletes a relay service connection by its name. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - deleteRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, callback: ServiceCallback): void; - deleteRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). - * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {object} connectionEnvelope Details of the hybrid connection - * configuration. - * - * @param {string} [connectionEnvelope.entityName] - * - * @param {string} [connectionEnvelope.entityConnectionString] - * - * @param {string} [connectionEnvelope.resourceType] - * - * @param {string} [connectionEnvelope.resourceConnectionString] - * - * @param {string} [connectionEnvelope.hostname] - * - * @param {number} [connectionEnvelope.port] - * - * @param {string} [connectionEnvelope.biztalkUri] - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - updateRelayServiceConnectionWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). - * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {object} connectionEnvelope Details of the hybrid connection - * configuration. - * - * @param {string} [connectionEnvelope.entityName] - * - * @param {string} [connectionEnvelope.entityConnectionString] - * - * @param {string} [connectionEnvelope.resourceType] - * - * @param {string} [connectionEnvelope.resourceConnectionString] - * - * @param {string} [connectionEnvelope.hostname] - * - * @param {number} [connectionEnvelope.port] - * - * @param {string} [connectionEnvelope.biztalkUri] - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {RelayServiceConnectionEntity} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. - * See {@link RelayServiceConnectionEntity} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - updateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, callback: ServiceCallback): void; - updateRelayServiceConnection(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets all scale-out instances of an app. - * - * Gets all scale-out instances of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listInstanceIdentifiersWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets all scale-out instances of an app. - * - * Gets all scale-out instances of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {WebAppInstanceCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {WebAppInstanceCollection} [result] - The deserialized result object if an error did not occur. - * See {@link WebAppInstanceCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listInstanceIdentifiers(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listInstanceIdentifiers(resourceGroupName: string, name: string, callback: ServiceCallback): void; - listInstanceIdentifiers(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get the status of the last MSDeploy operation. - * - * Get the status of the last MSDeploy operation. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} instanceId ID of web app instance. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getInstanceMsDeployStatusWithHttpOperationResponse(resourceGroupName: string, name: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get the status of the last MSDeploy operation. - * - * Get the status of the last MSDeploy operation. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} instanceId ID of web app instance. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MSDeployStatus} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MSDeployStatus} [result] - The deserialized result object if an error did not occur. - * See {@link MSDeployStatus} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getInstanceMsDeployStatus(resourceGroupName: string, name: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getInstanceMsDeployStatus(resourceGroupName: string, name: string, instanceId: string, callback: ServiceCallback): void; - getInstanceMsDeployStatus(resourceGroupName: string, name: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Invoke the MSDeploy web app extension. - * - * Invoke the MSDeploy web app extension. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} instanceId ID of web app instance. - * - * @param {object} mSDeploy Details of MSDeploy operation - * - * @param {string} [mSDeploy.packageUri] Package URI - * - * @param {string} [mSDeploy.connectionString] SQL Connection String - * - * @param {string} [mSDeploy.dbType] Database Type - * - * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy - * Parameters file. Must not be set if SetParameters is used. - * - * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be - * set if SetParametersXmlFileUri is used. - * - * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy - * operation skips the App_Data directory. - * If set to true, the existing App_Data directory on the - * destination - * will not be deleted, and any App_Data directory in the source will be - * ignored. - * Setting is false by default. - * - * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the - * MSDeploy operation executes. - * Setting is false by default. - * - * @param {string} [mSDeploy.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createInstanceMSDeployOperationWithHttpOperationResponse(resourceGroupName: string, name: string, instanceId: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Invoke the MSDeploy web app extension. - * - * Invoke the MSDeploy web app extension. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} instanceId ID of web app instance. - * - * @param {object} mSDeploy Details of MSDeploy operation - * - * @param {string} [mSDeploy.packageUri] Package URI - * - * @param {string} [mSDeploy.connectionString] SQL Connection String - * - * @param {string} [mSDeploy.dbType] Database Type - * - * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy - * Parameters file. Must not be set if SetParameters is used. - * - * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be - * set if SetParametersXmlFileUri is used. - * - * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy - * operation skips the App_Data directory. - * If set to true, the existing App_Data directory on the - * destination - * will not be deleted, and any App_Data directory in the source will be - * ignored. - * Setting is false by default. - * - * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the - * MSDeploy operation executes. - * Setting is false by default. - * - * @param {string} [mSDeploy.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MSDeployStatus} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MSDeployStatus} [result] - The deserialized result object if an error did not occur. - * See {@link MSDeployStatus} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createInstanceMSDeployOperation(resourceGroupName: string, name: string, instanceId: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createInstanceMSDeployOperation(resourceGroupName: string, name: string, instanceId: string, mSDeploy: models.MSDeploy, callback: ServiceCallback): void; - createInstanceMSDeployOperation(resourceGroupName: string, name: string, instanceId: string, mSDeploy: models.MSDeploy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get the MSDeploy Log for the last MSDeploy operation. - * - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} instanceId ID of web app instance. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getInstanceMSDeployLogWithHttpOperationResponse(resourceGroupName: string, name: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get the MSDeploy Log for the last MSDeploy operation. - * - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} instanceId ID of web app instance. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MSDeployLog} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MSDeployLog} [result] - The deserialized result object if an error did not occur. - * See {@link MSDeployLog} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getInstanceMSDeployLog(resourceGroupName: string, name: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getInstanceMSDeployLog(resourceGroupName: string, name: string, instanceId: string, callback: ServiceCallback): void; - getInstanceMSDeployLog(resourceGroupName: string, name: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. - * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listInstanceProcessesWithHttpOperationResponse(resourceGroupName: string, name: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. - * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ProcessInfoCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ProcessInfoCollection} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessInfoCollection} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listInstanceProcesses(resourceGroupName: string, name: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listInstanceProcesses(resourceGroupName: string, name: string, instanceId: string, callback: ServiceCallback): void; - listInstanceProcesses(resourceGroupName: string, name: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. - * - * Get process information by its ID for a specific scaled-out instance in a - * web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getInstanceProcessWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. - * - * Get process information by its ID for a specific scaled-out instance in a - * web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ProcessInfo} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ProcessInfo} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessInfo} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, callback: ServiceCallback): void; - getInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Terminate a process by its ID for a web site, or a deployment slot, - * or specific scaled-out instance in a web site. - * - * Terminate a process by its ID for a web site, or a deployment slot, or - * specific scaled-out instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - deleteInstanceProcessWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Terminate a process by its ID for a web site, or a deployment slot, - * or specific scaled-out instance in a web site. - * - * Terminate a process by its ID for a web site, or a deployment slot, or - * specific scaled-out instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - deleteInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, callback: ServiceCallback): void; - deleteInstanceProcess(resourceGroupName: string, name: string, processId: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get a memory dump of a process by its ID for a specific scaled-out - * instance in a web site. - * - * Get a memory dump of a process by its ID for a specific scaled-out instance - * in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getInstanceProcessDumpWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get a memory dump of a process by its ID for a specific scaled-out - * instance in a web site. - * - * Get a memory dump of a process by its ID for a specific scaled-out instance - * in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {Object} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {Object} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getInstanceProcessDump(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getInstanceProcessDump(resourceGroupName: string, name: string, processId: string, instanceId: string, callback: ServiceCallback): void; - getInstanceProcessDump(resourceGroupName: string, name: string, processId: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary List module information for a process by its ID for a specific - * scaled-out instance in a web site. - * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listInstanceProcessModulesWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary List module information for a process by its ID for a specific - * scaled-out instance in a web site. - * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ProcessModuleInfoCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ProcessModuleInfoCollection} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessModuleInfoCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listInstanceProcessModules(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listInstanceProcessModules(resourceGroupName: string, name: string, processId: string, instanceId: string, callback: ServiceCallback): void; - listInstanceProcessModules(resourceGroupName: string, name: string, processId: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. - * - * Get process information by its ID for a specific scaled-out instance in a - * web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} baseAddress Module base address. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getInstanceProcessModuleWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, baseAddress: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. - * - * Get process information by its ID for a specific scaled-out instance in a - * web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} baseAddress Module base address. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ProcessModuleInfo} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ProcessModuleInfo} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessModuleInfo} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getInstanceProcessModule(resourceGroupName: string, name: string, processId: string, baseAddress: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getInstanceProcessModule(resourceGroupName: string, name: string, processId: string, baseAddress: string, instanceId: string, callback: ServiceCallback): void; - getInstanceProcessModule(resourceGroupName: string, name: string, processId: string, baseAddress: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. - * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listInstanceProcessThreadsWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. - * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ProcessThreadInfoCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ProcessThreadInfoCollection} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessThreadInfoCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listInstanceProcessThreads(resourceGroupName: string, name: string, processId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listInstanceProcessThreads(resourceGroupName: string, name: string, processId: string, instanceId: string, callback: ServiceCallback): void; - listInstanceProcessThreads(resourceGroupName: string, name: string, processId: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get thread information by Thread ID for a specific process, in a - * specific scaled-out instance in a web site. - * - * Get thread information by Thread ID for a specific process, in a specific - * scaled-out instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} threadId TID. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getInstanceProcessThreadWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, threadId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get thread information by Thread ID for a specific process, in a - * specific scaled-out instance in a web site. - * - * Get thread information by Thread ID for a specific process, in a specific - * scaled-out instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} threadId TID. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ProcessThreadInfo} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ProcessThreadInfo} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessThreadInfo} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getInstanceProcessThread(resourceGroupName: string, name: string, processId: string, threadId: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getInstanceProcessThread(resourceGroupName: string, name: string, processId: string, threadId: string, instanceId: string, callback: ServiceCallback): void; - getInstanceProcessThread(resourceGroupName: string, name: string, processId: string, threadId: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Shows whether an app can be cloned to another resource group or - * subscription. - * - * Shows whether an app can be cloned to another resource group or - * subscription. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - isCloneableWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Shows whether an app can be cloned to another resource group or - * subscription. - * - * Shows whether an app can be cloned to another resource group or - * subscription. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {SiteCloneability} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {SiteCloneability} [result] - The deserialized result object if an error did not occur. - * See {@link SiteCloneability} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - isCloneable(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - isCloneable(resourceGroupName: string, name: string, callback: ServiceCallback): void; - isCloneable(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary This is to allow calling via powershell and ARM template. - * - * This is to allow calling via powershell and ARM template. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listSyncFunctionTriggersWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary This is to allow calling via powershell and ARM template. - * - * This is to allow calling via powershell and ARM template. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {FunctionSecrets} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {FunctionSecrets} [result] - The deserialized result object if an error did not occur. - * See {@link FunctionSecrets} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listSyncFunctionTriggers(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listSyncFunctionTriggers(resourceGroupName: string, name: string, callback: ServiceCallback): void; - listSyncFunctionTriggers(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets all metric definitions of an app (or deployment slot, if - * specified). - * - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listMetricDefinitionsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets all metric definitions of an app (or deployment slot, if - * specified). - * - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ResourceMetricDefinitionCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ResourceMetricDefinitionCollection} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceMetricDefinitionCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listMetricDefinitions(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMetricDefinitions(resourceGroupName: string, name: string, callback: ServiceCallback): void; - listMetricDefinitions(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets performance metrics of an app (or deployment slot, if - * specified). - * - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.details] Specify "true" to include metric details - * in the response. It is "false" by default. - * - * @param {string} [options.filter] Return only metrics specified in the filter - * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or - * name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime - * eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listMetricsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets performance metrics of an app (or deployment slot, if - * specified). - * - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.details] Specify "true" to include metric details - * in the response. It is "false" by default. - * - * @param {string} [options.filter] Return only metrics specified in the filter - * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or - * name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime - * eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ResourceMetricCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ResourceMetricCollection} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceMetricCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listMetrics(resourceGroupName: string, name: string, options?: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listMetrics(resourceGroupName: string, name: string, callback: ServiceCallback): void; - listMetrics(resourceGroupName: string, name: string, options: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Restores a web app. - * - * Restores a web app. - * - * @param {string} subscriptionName Azure subscription. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} migrationOptions Migration migrationOptions. - * - * @param {string} migrationOptions.azurefilesConnectionString AzureFiles - * connection string. - * - * @param {string} migrationOptions.azurefilesShare AzureFiles share. - * - * @param {boolean} [migrationOptions.switchSiteAfterMigration] - * trueif the app should be switched over; otherwise, - * false. - * - * @param {boolean} [migrationOptions.blockWriteAccessToSite] true - * if the app should be read only during copy operation; otherwise, - * false. - * - * @param {string} [migrationOptions.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - migrateStorageWithHttpOperationResponse(subscriptionName: string, resourceGroupName: string, name: string, migrationOptions: models.StorageMigrationOptions, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Restores a web app. - * - * Restores a web app. - * - * @param {string} subscriptionName Azure subscription. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} migrationOptions Migration migrationOptions. - * - * @param {string} migrationOptions.azurefilesConnectionString AzureFiles - * connection string. - * - * @param {string} migrationOptions.azurefilesShare AzureFiles share. - * - * @param {boolean} [migrationOptions.switchSiteAfterMigration] - * trueif the app should be switched over; otherwise, - * false. - * - * @param {boolean} [migrationOptions.blockWriteAccessToSite] true - * if the app should be read only during copy operation; otherwise, - * false. - * - * @param {string} [migrationOptions.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {StorageMigrationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {StorageMigrationResponse} [result] - The deserialized result object if an error did not occur. - * See {@link StorageMigrationResponse} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - migrateStorage(subscriptionName: string, resourceGroupName: string, name: string, migrationOptions: models.StorageMigrationOptions, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - migrateStorage(subscriptionName: string, resourceGroupName: string, name: string, migrationOptions: models.StorageMigrationOptions, callback: ServiceCallback): void; - migrateStorage(subscriptionName: string, resourceGroupName: string, name: string, migrationOptions: models.StorageMigrationOptions, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Migrates a local (in-app) MySql database to a remote MySql - * database. - * - * Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} migrationRequestEnvelope MySql migration options. - * - * @param {string} migrationRequestEnvelope.connectionString Connection string - * to the remote MySQL database. - * - * @param {string} migrationRequestEnvelope.migrationType The type of migration - * operation to be done. Possible values include: 'LocalToRemote', - * 'RemoteToLocal' - * - * @param {string} [migrationRequestEnvelope.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - migrateMySqlWithHttpOperationResponse(resourceGroupName: string, name: string, migrationRequestEnvelope: models.MigrateMySqlRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Migrates a local (in-app) MySql database to a remote MySql - * database. - * - * Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} migrationRequestEnvelope MySql migration options. - * - * @param {string} migrationRequestEnvelope.connectionString Connection string - * to the remote MySQL database. - * - * @param {string} migrationRequestEnvelope.migrationType The type of migration - * operation to be done. Possible values include: 'LocalToRemote', - * 'RemoteToLocal' - * - * @param {string} [migrationRequestEnvelope.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {Operation} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {Operation} [result] - The deserialized result object if an error did not occur. - * See {@link Operation} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - migrateMySql(resourceGroupName: string, name: string, migrationRequestEnvelope: models.MigrateMySqlRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - migrateMySql(resourceGroupName: string, name: string, migrationRequestEnvelope: models.MigrateMySqlRequest, callback: ServiceCallback): void; - migrateMySql(resourceGroupName: string, name: string, migrationRequestEnvelope: models.MigrateMySqlRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Returns the status of MySql in app migration, if one is active, and - * whether or not MySql in app is enabled - * - * Returns the status of MySql in app migration, if one is active, and whether - * or not MySql in app is enabled - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getMigrateMySqlStatusWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Returns the status of MySql in app migration, if one is active, and - * whether or not MySql in app is enabled - * - * Returns the status of MySql in app migration, if one is active, and whether - * or not MySql in app is enabled - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MigrateMySqlStatus} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MigrateMySqlStatus} [result] - The deserialized result object if an error did not occur. - * See {@link MigrateMySqlStatus} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getMigrateMySqlStatus(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getMigrateMySqlStatus(resourceGroupName: string, name: string, callback: ServiceCallback): void; - getMigrateMySqlStatus(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets all network features used by the app (or deployment slot, if - * specified). - * - * Gets all network features used by the app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} view The type of view. This can either be "summary" or - * "detailed". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listNetworkFeaturesWithHttpOperationResponse(resourceGroupName: string, name: string, view: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets all network features used by the app (or deployment slot, if - * specified). - * - * Gets all network features used by the app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} view The type of view. This can either be "summary" or - * "detailed". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {NetworkFeatures} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {NetworkFeatures} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkFeatures} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listNetworkFeatures(resourceGroupName: string, name: string, view: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNetworkFeatures(resourceGroupName: string, name: string, view: string, callback: ServiceCallback): void; - listNetworkFeatures(resourceGroupName: string, name: string, view: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Start capturing network packets for the site. - * - * Start capturing network packets for the site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.durationInSeconds] The duration to keep capturing - * in seconds. - * - * @param {number} [options.maxFrameLength] The maximum frame length in bytes - * (Optional). - * - * @param {string} [options.sasUrl] The Blob URL to store capture file. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - startWebSiteNetworkTraceWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Start capturing network packets for the site. - * - * Start capturing network packets for the site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.durationInSeconds] The duration to keep capturing - * in seconds. - * - * @param {number} [options.maxFrameLength] The maximum frame length in bytes - * (Optional). - * - * @param {string} [options.sasUrl] The Blob URL to store capture file. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {String} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {String} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - startWebSiteNetworkTrace(resourceGroupName: string, name: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - startWebSiteNetworkTrace(resourceGroupName: string, name: string, callback: ServiceCallback): void; - startWebSiteNetworkTrace(resourceGroupName: string, name: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Stop ongoing capturing network packets for the site. - * - * Stop ongoing capturing network packets for the site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - stopWebSiteNetworkTraceWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Stop ongoing capturing network packets for the site. - * - * Stop ongoing capturing network packets for the site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {String} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {String} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - stopWebSiteNetworkTrace(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - stopWebSiteNetworkTrace(resourceGroupName: string, name: string, callback: ServiceCallback): void; - stopWebSiteNetworkTrace(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Generates a new publishing password for an app (or deployment slot, - * if specified). - * - * Generates a new publishing password for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - generateNewSitePublishingPasswordWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Generates a new publishing password for an app (or deployment slot, - * if specified). - * - * Generates a new publishing password for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - generateNewSitePublishingPassword(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - generateNewSitePublishingPassword(resourceGroupName: string, name: string, callback: ServiceCallback): void; - generateNewSitePublishingPassword(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets perfmon counters for web app. - * - * Gets perfmon counters for web app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] Return only usages/metrics specified in the - * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq - * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain - * eq duration'[Hour|Minute|Day]'. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listPerfMonCountersWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets perfmon counters for web app. - * - * Gets perfmon counters for web app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] Return only usages/metrics specified in the - * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq - * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain - * eq duration'[Hour|Minute|Day]'. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {PerfMonCounterCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {PerfMonCounterCollection} [result] - The deserialized result object if an error did not occur. - * See {@link PerfMonCounterCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listPerfMonCounters(resourceGroupName: string, name: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listPerfMonCounters(resourceGroupName: string, name: string, callback: ServiceCallback): void; - listPerfMonCounters(resourceGroupName: string, name: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets web app's event logs. - * - * Gets web app's event logs. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getSitePhpErrorLogFlagWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets web app's event logs. - * - * Gets web app's event logs. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {SitePhpErrorLogFlag} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {SitePhpErrorLogFlag} [result] - The deserialized result object if an error did not occur. - * See {@link SitePhpErrorLogFlag} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getSitePhpErrorLogFlag(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getSitePhpErrorLogFlag(resourceGroupName: string, name: string, callback: ServiceCallback): void; - getSitePhpErrorLogFlag(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets the premier add-ons of an app. - * - * Gets the premier add-ons of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listPremierAddOnsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets the premier add-ons of an app. - * - * Gets the premier add-ons of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {PremierAddOn} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {PremierAddOn} [result] - The deserialized result object if an error did not occur. - * See {@link PremierAddOn} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listPremierAddOns(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listPremierAddOns(resourceGroupName: string, name: string, callback: ServiceCallback): void; - listPremierAddOns(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets a named add-on of an app. - * - * Gets a named add-on of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} premierAddOnName Add-on name. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getPremierAddOnWithHttpOperationResponse(resourceGroupName: string, name: string, premierAddOnName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets a named add-on of an app. - * - * Gets a named add-on of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} premierAddOnName Add-on name. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {PremierAddOn} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {PremierAddOn} [result] - The deserialized result object if an error did not occur. - * See {@link PremierAddOn} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getPremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getPremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, callback: ServiceCallback): void; - getPremierAddOn(resourceGroupName: string, name: string, premierAddOnName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Updates a named add-on of an app. - * - * Updates a named add-on of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} premierAddOnName Add-on name. - * - * @param {object} premierAddOn A JSON representation of the edited premier - * add-on. - * - * @param {string} [premierAddOn.sku] Premier add on SKU. - * - * @param {string} [premierAddOn.product] Premier add on Product. - * - * @param {string} [premierAddOn.vendor] Premier add on Vendor. - * - * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * - * @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.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * - * @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 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} [options] Optional Parameters. - * - * @param {string} [options.format] Name of the format. Valid values are: - * FileZilla3 - * WebDeploy -- default - * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' - * - * @param {object} [options.customHeaders] Headers that 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, options?: { format? : string, 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} [options] Optional Parameters. - * - * @param {string} [options.format] Name of the format. Valid values are: - * FileZilla3 - * WebDeploy -- default - * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} 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, options?: { format? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, callback: ServiceCallback): void; - listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, options: { format? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Recovers a web app to a previous snapshot. - * - * Recovers a web app to a previous snapshot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. - * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - recoverWithHttpOperationResponse(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Recovers a web app to a previous snapshot. - * - * Recovers a web app to a previous snapshot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. - * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. - */ - recover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - recover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, callback: ServiceCallback): void; - recover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, 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 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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' - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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' - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} 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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * - * @param {object} [options.customHeaders] Headers that 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, skipDnsRegistration? : 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [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, skipDnsRegistration? : 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, skipDnsRegistration? : 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} 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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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 Discovers an existing app backup that can be restored from a blob - * in Azure storage. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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. - */ - discoverRestoreSlotWithHttpOperationResponse(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. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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. - */ - discoverRestoreSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - discoverRestoreSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, callback: ServiceCallback): void; - discoverRestoreSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, 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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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' - * - * @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' - * - * @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 {RestoreResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {RestoreResponse} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} for more information. - * - * {WebResource} [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 {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 {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 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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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 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 {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 {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 {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.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 {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 {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 {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.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 {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 {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 {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.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 {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 {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 {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.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. - */ - getWebSiteContainerLogsZipSlotWithHttpOperationResponse(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. - */ - getWebSiteContainerLogsZipSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getWebSiteContainerLogsZipSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - getWebSiteContainerLogsZipSlot(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 {string} [deployment.deploymentId] Identifier for deployment. - * - * @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 {string} [deployment.deploymentId] Identifier for deployment. - * - * @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 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.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.scriptRootPathHref] Script root path URI. - * - * @param {string} [functionEnvelope.scriptHref] Script URI. - * - * @param {string} [functionEnvelope.configHref] Config URI. - * - * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. - * - * @param {string} [functionEnvelope.href] Function URI. - * - * @param {object} [functionEnvelope.config] Config information. - * - * @param {object} [functionEnvelope.files] File list. - * - * @param {string} [functionEnvelope.testData] Test data used when testing via - * the Azure Portal. - * - * @param {string} [functionEnvelope.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {FunctionEnvelope} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {FunctionEnvelope} [result] - The deserialized result object if an error did not occur. - * See {@link FunctionEnvelope} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, functionEnvelope: models.FunctionEnvelope, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, functionEnvelope: models.FunctionEnvelope, callback: ServiceCallback): void; - createInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, functionEnvelope: models.FunctionEnvelope, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Delete a function for web site, or a deployment slot. - * - * Delete a function for web site, or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} functionName Function name. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - deleteInstanceFunctionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, functionName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Delete a function for web site, or a deployment slot. - * - * Delete a function for web site, or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} functionName Function name. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - deleteInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, callback: ServiceCallback): void; - deleteInstanceFunctionSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get function secrets for a function in a web site, or a deployment - * slot. - * - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} functionName Function name. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listFunctionSecretsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, functionName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get function secrets for a function in a web site, or a deployment - * slot. - * - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} functionName Function name. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {FunctionSecrets} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {FunctionSecrets} [result] - The deserialized result object if an error did not occur. - * See {@link FunctionSecrets} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listFunctionSecretsSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listFunctionSecretsSlot(resourceGroupName: string, name: string, functionName: string, slot: string, callback: ServiceCallback): void; - listFunctionSecretsSlot(resourceGroupName: string, name: string, functionName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get hostname bindings for an app or a deployment slot. - * - * Get hostname bindings for an app or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API gets hostname bindings for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listHostNameBindingsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get hostname bindings for an app or a deployment slot. - * - * Get hostname bindings for an app or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API gets hostname bindings for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {HostNameBindingCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {HostNameBindingCollection} [result] - The deserialized result object if an error did not occur. - * See {@link HostNameBindingCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listHostNameBindingsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listHostNameBindingsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - listHostNameBindingsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get the named hostname binding for an app (or deployment slot, if - * specified). - * - * Get the named hostname binding for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API the named binding for the production slot. - * - * @param {string} hostName Hostname in the hostname binding. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getHostNameBindingSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get the named hostname binding for an app (or deployment slot, if - * specified). - * - * Get the named hostname binding for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API the named binding for the production slot. - * - * @param {string} hostName Hostname in the hostname binding. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {HostNameBinding} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {HostNameBinding} [result] - The deserialized result object if an error did not occur. - * See {@link HostNameBinding} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, callback: ServiceCallback): void; - getHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Creates a hostname binding for an app. - * - * Creates a hostname binding for an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} hostName Hostname in the hostname binding. - * - * @param {object} hostNameBinding Binding details. This is the JSON - * representation of a HostNameBinding object. - * - * @param {string} [hostNameBinding.siteName] App Service app name. - * - * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain - * resource URI. - * - * @param {string} [hostNameBinding.azureResourceName] Azure resource name. - * - * @param {string} [hostNameBinding.azureResourceType] Azure resource type. - * Possible values include: 'Website', 'TrafficManager' - * - * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS - * record type. Possible values include: 'CName', 'A' - * - * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible - * values include: 'Verified', 'Managed' - * - * @param {string} [hostNameBinding.sslState] SSL type. Possible values - * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' - * - * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint - * - * @param {string} [hostNameBinding.kind] Kind of resource. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will create a binding for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateHostNameBindingSlotWithHttpOperationResponse(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Creates a hostname binding for an app. - * - * Creates a hostname binding for an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} hostName Hostname in the hostname binding. - * - * @param {object} hostNameBinding Binding details. This is the JSON - * representation of a HostNameBinding object. - * - * @param {string} [hostNameBinding.siteName] App Service app name. - * - * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain - * resource URI. - * - * @param {string} [hostNameBinding.azureResourceName] Azure resource name. - * - * @param {string} [hostNameBinding.azureResourceType] Azure resource type. - * Possible values include: 'Website', 'TrafficManager' - * - * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS - * record type. Possible values include: 'CName', 'A' - * - * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible - * values include: 'Verified', 'Managed' - * - * @param {string} [hostNameBinding.sslState] SSL type. Possible values - * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' - * - * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint - * - * @param {string} [hostNameBinding.kind] Kind of resource. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will create a binding for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {HostNameBinding} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {HostNameBinding} [result] - The deserialized result object if an error did not occur. - * See {@link HostNameBinding} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdateHostNameBindingSlot(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdateHostNameBindingSlot(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, slot: string, callback: ServiceCallback): void; - createOrUpdateHostNameBindingSlot(resourceGroupName: string, name: string, hostName: string, hostNameBinding: models.HostNameBinding, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Deletes a hostname binding for an app. - * - * Deletes a hostname binding for an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will delete the binding for the production slot. - * - * @param {string} hostName Hostname in the hostname binding. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - deleteHostNameBindingSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Deletes a hostname binding for an app. - * - * Deletes a hostname binding for an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will delete the binding for the production slot. - * - * @param {string} hostName Hostname in the hostname binding. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - deleteHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, callback: ServiceCallback): void; - deleteHostNameBindingSlot(resourceGroupName: string, name: string, slot: string, hostName: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web - * App. - * - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {string} slot The name of the slot for the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getHybridConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web - * App. - * - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {string} slot The name of the slot for the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {HybridConnection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {HybridConnection} [result] - The deserialized result object if an error did not occur. - * See {@link HybridConnection} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, callback: ServiceCallback): void; - getHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Creates a new Hybrid Connection using a Service Bus relay. - * - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} connectionEnvelope The details of the hybrid connection. - * - * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the - * Service Bus namespace. - * - * @param {string} [connectionEnvelope.relayName] The name of the Service Bus - * relay. - * - * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service - * Bus relay. - * - * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. - * - * @param {number} [connectionEnvelope.port] The port of the endpoint. - * - * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus - * key which has Send permissions. This is used to authenticate to Service Bus. - * - * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service - * Bus key. This is used to authenticate to Service Bus. In ARM this key will - * not be returned - * normally, use the POST /listKeys API instead. - * - * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the - * service bus endpoint. By default this is .servicebus.windows.net - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {string} slot The name of the slot for the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateHybridConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Creates a new Hybrid Connection using a Service Bus relay. - * - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} connectionEnvelope The details of the hybrid connection. - * - * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the - * Service Bus namespace. - * - * @param {string} [connectionEnvelope.relayName] The name of the Service Bus - * relay. - * - * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service - * Bus relay. - * - * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. - * - * @param {number} [connectionEnvelope.port] The port of the endpoint. - * - * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus - * key which has Send permissions. This is used to authenticate to Service Bus. - * - * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service - * Bus key. This is used to authenticate to Service Bus. In ARM this key will - * not be returned - * normally, use the POST /listKeys API instead. - * - * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the - * service bus endpoint. By default this is .servicebus.windows.net - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {string} slot The name of the slot for the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {HybridConnection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {HybridConnection} [result] - The deserialized result object if an error did not occur. - * See {@link HybridConnection} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, callback: ServiceCallback): void; - createOrUpdateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Removes a Hybrid Connection from this site. - * - * Removes a Hybrid Connection from this site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {string} slot The name of the slot for the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - deleteHybridConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Removes a Hybrid Connection from this site. - * - * Removes a Hybrid Connection from this site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {string} slot The name of the slot for the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - deleteHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, callback: ServiceCallback): void; - deleteHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Creates a new Hybrid Connection using a Service Bus relay. - * - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} connectionEnvelope The details of the hybrid connection. - * - * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the - * Service Bus namespace. - * - * @param {string} [connectionEnvelope.relayName] The name of the Service Bus - * relay. - * - * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service - * Bus relay. - * - * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. - * - * @param {number} [connectionEnvelope.port] The port of the endpoint. - * - * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus - * key which has Send permissions. This is used to authenticate to Service Bus. - * - * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service - * Bus key. This is used to authenticate to Service Bus. In ARM this key will - * not be returned - * normally, use the POST /listKeys API instead. - * - * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the - * service bus endpoint. By default this is .servicebus.windows.net - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {string} slot The name of the slot for the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - updateHybridConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Creates a new Hybrid Connection using a Service Bus relay. - * - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} connectionEnvelope The details of the hybrid connection. - * - * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the - * Service Bus namespace. - * - * @param {string} [connectionEnvelope.relayName] The name of the Service Bus - * relay. - * - * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service - * Bus relay. - * - * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. - * - * @param {number} [connectionEnvelope.port] The port of the endpoint. - * - * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus - * key which has Send permissions. This is used to authenticate to Service Bus. - * - * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service - * Bus key. This is used to authenticate to Service Bus. In ARM this key will - * not be returned - * normally, use the POST /listKeys API instead. - * - * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the - * service bus endpoint. By default this is .servicebus.windows.net - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {string} slot The name of the slot for the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {HybridConnection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {HybridConnection} [result] - The deserialized result object if an error did not occur. - * See {@link HybridConnection} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - updateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, callback: ServiceCallback): void; - updateHybridConnectionSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, connectionEnvelope: models.HybridConnection, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets the send key name and value for a Hybrid Connection. - * - * Gets the send key name and value for a Hybrid Connection. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {string} slot The name of the slot for the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listHybridConnectionKeysSlotWithHttpOperationResponse(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets the send key name and value for a Hybrid Connection. - * - * Gets the send key name and value for a Hybrid Connection. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {string} slot The name of the slot for the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {HybridConnectionKey} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {HybridConnectionKey} [result] - The deserialized result object if an error did not occur. - * See {@link HybridConnectionKey} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listHybridConnectionKeysSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listHybridConnectionKeysSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, callback: ServiceCallback): void; - listHybridConnectionKeysSlot(resourceGroupName: string, name: string, namespaceName: string, relayName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} slot The name of the slot for the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listHybridConnectionsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} slot The name of the slot for the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {HybridConnection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {HybridConnection} [result] - The deserialized result object if an error did not occur. - * See {@link HybridConnection} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listHybridConnectionsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listHybridConnectionsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - listHybridConnectionsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets hybrid connections configured for an app (or deployment slot, - * if specified). - * - * Gets hybrid connections configured for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get hybrid connections for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listRelayServiceConnectionsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets hybrid connections configured for an app (or deployment slot, - * if specified). - * - * Gets hybrid connections configured for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get hybrid connections for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {RelayServiceConnectionEntity} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. - * See {@link RelayServiceConnectionEntity} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listRelayServiceConnectionsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listRelayServiceConnectionsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - listRelayServiceConnectionsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets a hybrid connection configuration by its name. - * - * Gets a hybrid connection configuration by its name. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get a hybrid connection for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets a hybrid connection configuration by its name. - * - * Gets a hybrid connection configuration by its name. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get a hybrid connection for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {RelayServiceConnectionEntity} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. - * See {@link RelayServiceConnectionEntity} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, callback: ServiceCallback): void; - getRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). - * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {object} connectionEnvelope Details of the hybrid connection - * configuration. - * - * @param {string} [connectionEnvelope.entityName] - * - * @param {string} [connectionEnvelope.entityConnectionString] - * - * @param {string} [connectionEnvelope.resourceType] - * - * @param {string} [connectionEnvelope.resourceConnectionString] - * - * @param {string} [connectionEnvelope.hostname] - * - * @param {number} [connectionEnvelope.port] - * - * @param {string} [connectionEnvelope.biztalkUri] - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will create or update a hybrid connection for the - * production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createOrUpdateRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). - * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {object} connectionEnvelope Details of the hybrid connection - * configuration. - * - * @param {string} [connectionEnvelope.entityName] - * - * @param {string} [connectionEnvelope.entityConnectionString] - * - * @param {string} [connectionEnvelope.resourceType] - * - * @param {string} [connectionEnvelope.resourceConnectionString] - * - * @param {string} [connectionEnvelope.hostname] - * - * @param {number} [connectionEnvelope.port] - * - * @param {string} [connectionEnvelope.biztalkUri] - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will create or update a hybrid connection for the - * production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {RelayServiceConnectionEntity} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. - * See {@link RelayServiceConnectionEntity} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createOrUpdateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, callback: ServiceCallback): void; - createOrUpdateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Deletes a relay service connection by its name. - * - * Deletes a relay service connection by its name. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will delete a hybrid connection for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - deleteRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Deletes a relay service connection by its name. - * - * Deletes a relay service connection by its name. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will delete a hybrid connection for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - deleteRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, callback: ServiceCallback): void; - deleteRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). - * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {object} connectionEnvelope Details of the hybrid connection - * configuration. - * - * @param {string} [connectionEnvelope.entityName] - * - * @param {string} [connectionEnvelope.entityConnectionString] - * - * @param {string} [connectionEnvelope.resourceType] - * - * @param {string} [connectionEnvelope.resourceConnectionString] - * - * @param {string} [connectionEnvelope.hostname] - * - * @param {number} [connectionEnvelope.port] - * - * @param {string} [connectionEnvelope.biztalkUri] - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will create or update a hybrid connection for the - * production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - updateRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). - * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {object} connectionEnvelope Details of the hybrid connection - * configuration. - * - * @param {string} [connectionEnvelope.entityName] - * - * @param {string} [connectionEnvelope.entityConnectionString] - * - * @param {string} [connectionEnvelope.resourceType] - * - * @param {string} [connectionEnvelope.resourceConnectionString] - * - * @param {string} [connectionEnvelope.hostname] - * - * @param {number} [connectionEnvelope.port] - * - * @param {string} [connectionEnvelope.biztalkUri] - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will create or update a hybrid connection for the - * production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {RelayServiceConnectionEntity} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {RelayServiceConnectionEntity} [result] - The deserialized result object if an error did not occur. - * See {@link RelayServiceConnectionEntity} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - updateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - updateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, callback: ServiceCallback): void; - updateRelayServiceConnectionSlot(resourceGroupName: string, name: string, entityName: string, connectionEnvelope: models.RelayServiceConnectionEntity, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets all scale-out instances of an app. - * - * Gets all scale-out instances of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API gets the production slot instances. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listInstanceIdentifiersSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets all scale-out instances of an app. - * - * Gets all scale-out instances of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API gets the production slot instances. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {WebAppInstanceCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {WebAppInstanceCollection} [result] - The deserialized result object if an error did not occur. - * See {@link WebAppInstanceCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listInstanceIdentifiersSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listInstanceIdentifiersSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - listInstanceIdentifiersSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get the status of the last MSDeploy operation. - * - * Get the status of the last MSDeploy operation. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. - * - * @param {string} instanceId ID of web app instance. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getInstanceMsDeployStatusSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get the status of the last MSDeploy operation. - * - * Get the status of the last MSDeploy operation. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. - * - * @param {string} instanceId ID of web app instance. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MSDeployStatus} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MSDeployStatus} [result] - The deserialized result object if an error did not occur. - * See {@link MSDeployStatus} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getInstanceMsDeployStatusSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getInstanceMsDeployStatusSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, callback: ServiceCallback): void; - getInstanceMsDeployStatusSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Invoke the MSDeploy web app extension. - * - * Invoke the MSDeploy web app extension. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. - * - * @param {string} instanceId ID of web app instance. - * - * @param {object} mSDeploy Details of MSDeploy operation - * - * @param {string} [mSDeploy.packageUri] Package URI - * - * @param {string} [mSDeploy.connectionString] SQL Connection String - * - * @param {string} [mSDeploy.dbType] Database Type - * - * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy - * Parameters file. Must not be set if SetParameters is used. - * - * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be - * set if SetParametersXmlFileUri is used. - * - * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy - * operation skips the App_Data directory. - * If set to true, the existing App_Data directory on the - * destination - * will not be deleted, and any App_Data directory in the source will be - * ignored. - * Setting is false by default. - * - * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the - * MSDeploy operation executes. - * Setting is false by default. - * - * @param {string} [mSDeploy.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - createInstanceMSDeployOperationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, instanceId: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Invoke the MSDeploy web app extension. - * - * Invoke the MSDeploy web app extension. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. - * - * @param {string} instanceId ID of web app instance. - * - * @param {object} mSDeploy Details of MSDeploy operation - * - * @param {string} [mSDeploy.packageUri] Package URI - * - * @param {string} [mSDeploy.connectionString] SQL Connection String - * - * @param {string} [mSDeploy.dbType] Database Type - * - * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy - * Parameters file. Must not be set if SetParameters is used. - * - * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be - * set if SetParametersXmlFileUri is used. - * - * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy - * operation skips the App_Data directory. - * If set to true, the existing App_Data directory on the - * destination - * will not be deleted, and any App_Data directory in the source will be - * ignored. - * Setting is false by default. - * - * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the - * MSDeploy operation executes. - * Setting is false by default. - * - * @param {string} [mSDeploy.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MSDeployStatus} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MSDeployStatus} [result] - The deserialized result object if an error did not occur. - * See {@link MSDeployStatus} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - createInstanceMSDeployOperationSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, mSDeploy: models.MSDeploy, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - createInstanceMSDeployOperationSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, mSDeploy: models.MSDeploy, callback: ServiceCallback): void; - createInstanceMSDeployOperationSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, mSDeploy: models.MSDeploy, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get the MSDeploy Log for the last MSDeploy operation. - * - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. - * - * @param {string} instanceId ID of web app instance. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getInstanceMSDeployLogSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get the MSDeploy Log for the last MSDeploy operation. - * - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. - * - * @param {string} instanceId ID of web app instance. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MSDeployLog} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MSDeployLog} [result] - The deserialized result object if an error did not occur. - * See {@link MSDeployLog} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getInstanceMSDeployLogSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getInstanceMSDeployLogSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, callback: ServiceCallback): void; - getInstanceMSDeployLogSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. - * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listInstanceProcessesSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. - * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ProcessInfoCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ProcessInfoCollection} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessInfoCollection} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listInstanceProcessesSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listInstanceProcessesSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, callback: ServiceCallback): void; - listInstanceProcessesSlot(resourceGroupName: string, name: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. - * - * Get process information by its ID for a specific scaled-out instance in a - * web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getInstanceProcessSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. - * - * Get process information by its ID for a specific scaled-out instance in a - * web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ProcessInfo} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ProcessInfo} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessInfo} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, callback: ServiceCallback): void; - getInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Terminate a process by its ID for a web site, or a deployment slot, - * or specific scaled-out instance in a web site. - * - * Terminate a process by its ID for a web site, or a deployment slot, or - * specific scaled-out instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - deleteInstanceProcessSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Terminate a process by its ID for a web site, or a deployment slot, - * or specific scaled-out instance in a web site. - * - * Terminate a process by its ID for a web site, or a deployment slot, or - * specific scaled-out instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - deleteInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - deleteInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, callback: ServiceCallback): void; - deleteInstanceProcessSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get a memory dump of a process by its ID for a specific scaled-out - * instance in a web site. - * - * Get a memory dump of a process by its ID for a specific scaled-out instance - * in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getInstanceProcessDumpSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get a memory dump of a process by its ID for a specific scaled-out - * instance in a web site. - * - * Get a memory dump of a process by its ID for a specific scaled-out instance - * in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {Object} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {Object} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getInstanceProcessDumpSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getInstanceProcessDumpSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, callback: ServiceCallback): void; - getInstanceProcessDumpSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary List module information for a process by its ID for a specific - * scaled-out instance in a web site. - * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listInstanceProcessModulesSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary List module information for a process by its ID for a specific - * scaled-out instance in a web site. - * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ProcessModuleInfoCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ProcessModuleInfoCollection} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessModuleInfoCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listInstanceProcessModulesSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listInstanceProcessModulesSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, callback: ServiceCallback): void; - listInstanceProcessModulesSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. - * - * Get process information by its ID for a specific scaled-out instance in a - * web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} baseAddress Module base address. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getInstanceProcessModuleSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. - * - * Get process information by its ID for a specific scaled-out instance in a - * web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} baseAddress Module base address. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ProcessModuleInfo} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ProcessModuleInfo} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessModuleInfo} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getInstanceProcessModuleSlot(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getInstanceProcessModuleSlot(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, instanceId: string, callback: ServiceCallback): void; - getInstanceProcessModuleSlot(resourceGroupName: string, name: string, processId: string, baseAddress: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. - * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listInstanceProcessThreadsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. - * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ProcessThreadInfoCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ProcessThreadInfoCollection} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessThreadInfoCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listInstanceProcessThreadsSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listInstanceProcessThreadsSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, callback: ServiceCallback): void; - listInstanceProcessThreadsSlot(resourceGroupName: string, name: string, processId: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Get thread information by Thread ID for a specific process, in a - * specific scaled-out instance in a web site. - * - * Get thread information by Thread ID for a specific process, in a specific - * scaled-out instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} threadId TID. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getInstanceProcessThreadSlotWithHttpOperationResponse(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Get thread information by Thread ID for a specific process, in a - * specific scaled-out instance in a web site. - * - * Get thread information by Thread ID for a specific process, in a specific - * scaled-out instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} threadId TID. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ProcessThreadInfo} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ProcessThreadInfo} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessThreadInfo} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getInstanceProcessThreadSlot(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, instanceId: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getInstanceProcessThreadSlot(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, instanceId: string, callback: ServiceCallback): void; - getInstanceProcessThreadSlot(resourceGroupName: string, name: string, processId: string, threadId: string, slot: string, instanceId: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Shows whether an app can be cloned to another resource group or - * subscription. - * - * Shows whether an app can be cloned to another resource group or - * subscription. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. By default, this API - * returns information on the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - isCloneableSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Shows whether an app can be cloned to another resource group or - * subscription. - * - * Shows whether an app can be cloned to another resource group or - * subscription. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. By default, this API - * returns information on the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {SiteCloneability} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {SiteCloneability} [result] - The deserialized result object if an error did not occur. - * See {@link SiteCloneability} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - isCloneableSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - isCloneableSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - isCloneableSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary This is to allow calling via powershell and ARM template. - * - * This is to allow calling via powershell and ARM template. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will restore a backup of the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listSyncFunctionTriggersSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary This is to allow calling via powershell and ARM template. - * - * This is to allow calling via powershell and ARM template. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will restore a backup of the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {FunctionSecrets} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {FunctionSecrets} [result] - The deserialized result object if an error did not occur. - * See {@link FunctionSecrets} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listSyncFunctionTriggersSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listSyncFunctionTriggersSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - listSyncFunctionTriggersSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets all metric definitions of an app (or deployment slot, if - * specified). - * - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get metric definitions of the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listMetricDefinitionsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets all metric definitions of an app (or deployment slot, if - * specified). - * - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get metric definitions of the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ResourceMetricDefinitionCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ResourceMetricDefinitionCollection} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceMetricDefinitionCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listMetricDefinitionsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listMetricDefinitionsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - listMetricDefinitionsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets performance metrics of an app (or deployment slot, if - * specified). - * - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get metrics of the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.details] Specify "true" to include metric details - * in the response. It is "false" by default. - * - * @param {string} [options.filter] Return only metrics specified in the filter - * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or - * name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime - * eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listMetricsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets performance metrics of an app (or deployment slot, if - * specified). - * - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get metrics of the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.details] Specify "true" to include metric details - * in the response. It is "false" by default. - * - * @param {string} [options.filter] Return only metrics specified in the filter - * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or - * name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime - * eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {ResourceMetricCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {ResourceMetricCollection} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceMetricCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listMetricsSlot(resourceGroupName: string, name: string, slot: string, options?: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listMetricsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - listMetricsSlot(resourceGroupName: string, name: string, slot: string, options: { details? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Returns the status of MySql in app migration, if one is active, and - * whether or not MySql in app is enabled - * - * Returns the status of MySql in app migration, if one is active, and whether - * or not MySql in app is enabled - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} slot Name of the deployment slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getMigrateMySqlStatusSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Returns the status of MySql in app migration, if one is active, and - * whether or not MySql in app is enabled - * - * Returns the status of MySql in app migration, if one is active, and whether - * or not MySql in app is enabled - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} slot Name of the deployment slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {MigrateMySqlStatus} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {MigrateMySqlStatus} [result] - The deserialized result object if an error did not occur. - * See {@link MigrateMySqlStatus} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getMigrateMySqlStatusSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getMigrateMySqlStatusSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - getMigrateMySqlStatusSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets all network features used by the app (or deployment slot, if - * specified). - * - * Gets all network features used by the app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} view The type of view. This can either be "summary" or - * "detailed". - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get network features for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listNetworkFeaturesSlotWithHttpOperationResponse(resourceGroupName: string, name: string, view: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets all network features used by the app (or deployment slot, if - * specified). - * - * Gets all network features used by the app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} view The type of view. This can either be "summary" or - * "detailed". - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get network features for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {NetworkFeatures} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {NetworkFeatures} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkFeatures} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listNetworkFeaturesSlot(resourceGroupName: string, name: string, view: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listNetworkFeaturesSlot(resourceGroupName: string, name: string, view: string, slot: string, callback: ServiceCallback): void; - listNetworkFeaturesSlot(resourceGroupName: string, name: string, view: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Start capturing network packets for the site. - * - * Start capturing network packets for the site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} slot The name of the slot for this web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.durationInSeconds] The duration to keep capturing - * in seconds. - * - * @param {number} [options.maxFrameLength] The maximum frame length in bytes - * (Optional). - * - * @param {string} [options.sasUrl] The Blob URL to store capture file. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - startWebSiteNetworkTraceSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Start capturing network packets for the site. - * - * Start capturing network packets for the site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} slot The name of the slot for this web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.durationInSeconds] The duration to keep capturing - * in seconds. - * - * @param {number} [options.maxFrameLength] The maximum frame length in bytes - * (Optional). - * - * @param {string} [options.sasUrl] The Blob URL to store capture file. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {String} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {String} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - startWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options?: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - startWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - startWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options: { durationInSeconds? : number, maxFrameLength? : number, sasUrl? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Stop ongoing capturing network packets for the site. - * - * Stop ongoing capturing network packets for the site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} slot The name of the slot for this web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - stopWebSiteNetworkTraceSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Stop ongoing capturing network packets for the site. - * - * Stop ongoing capturing network packets for the site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} slot The name of the slot for this web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {String} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {String} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - stopWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - stopWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - stopWebSiteNetworkTraceSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Generates a new publishing password for an app (or deployment slot, - * if specified). - * - * Generates a new publishing password for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API generate a new publishing password for the production - * slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - generateNewSitePublishingPasswordSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Generates a new publishing password for an app (or deployment slot, - * if specified). - * - * Generates a new publishing password for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API generate a new publishing password for the production - * slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - generateNewSitePublishingPasswordSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - generateNewSitePublishingPasswordSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - generateNewSitePublishingPasswordSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets perfmon counters for web app. - * - * Gets perfmon counters for web app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] Return only usages/metrics specified in the - * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq - * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain - * eq duration'[Hour|Minute|Day]'. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listPerfMonCountersSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets perfmon counters for web app. - * - * Gets perfmon counters for web app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] Return only usages/metrics specified in the - * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq - * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain - * eq duration'[Hour|Minute|Day]'. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {PerfMonCounterCollection} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {PerfMonCounterCollection} [result] - The deserialized result object if an error did not occur. - * See {@link PerfMonCounterCollection} for more - * information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listPerfMonCountersSlot(resourceGroupName: string, name: string, slot: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listPerfMonCountersSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - listPerfMonCountersSlot(resourceGroupName: string, name: string, slot: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets web app's event logs. - * - * Gets web app's event logs. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getSitePhpErrorLogFlagSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets web app's event logs. - * - * Gets web app's event logs. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {SitePhpErrorLogFlag} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {SitePhpErrorLogFlag} [result] - The deserialized result object if an error did not occur. - * See {@link SitePhpErrorLogFlag} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getSitePhpErrorLogFlagSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getSitePhpErrorLogFlagSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - getSitePhpErrorLogFlagSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets the premier add-ons of an app. - * - * Gets the premier add-ons of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get the premier add-ons for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - listPremierAddOnsSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets the premier add-ons of an app. - * - * Gets the premier add-ons of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get the premier add-ons for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {PremierAddOn} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {PremierAddOn} [result] - The deserialized result object if an error did not occur. - * See {@link PremierAddOn} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - listPremierAddOnsSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - listPremierAddOnsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - listPremierAddOnsSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Gets a named add-on of an app. - * - * Gets a named add-on of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} premierAddOnName Add-on name. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get the named add-on for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - getPremierAddOnSlotWithHttpOperationResponse(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Gets a named add-on of an app. - * - * Gets a named add-on of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} premierAddOnName Add-on name. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get the named add-on for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} If a callback was passed as the last - * parameter then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned. - * - * @resolve {PremierAddOn} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {PremierAddOn} [result] - The deserialized result object if an error did not occur. - * See {@link PremierAddOn} for more information. - * - * {WebResource} [request] - The HTTP Request object if an error did not occur. - * - * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. - */ - getPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, callback: ServiceCallback): void; - getPremierAddOnSlot(resourceGroupName: string, name: string, premierAddOnName: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Updates a named add-on of an app. - * - * Updates a named add-on of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} premierAddOnName Add-on name. - * - * @param {object} premierAddOn A JSON representation of the edited premier - * add-on. - * - * @param {string} [premierAddOn.sku] Premier add on SKU. - * - * @param {string} [premierAddOn.product] Premier add on Product. - * - * @param {string} [premierAddOn.vendor] Premier add on Vendor. - * - * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * - * @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.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * - * @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 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 {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 {string} [options.format] Name of the format. Valid values are: - * FileZilla3 - * WebDeploy -- default - * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' - * - * @param {object} [options.customHeaders] Headers that 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, slot: string, options?: { format? : string, 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 {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 {string} [options.format] Name of the format. Valid values are: - * FileZilla3 - * WebDeploy -- default - * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} 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, slot: string, options?: { format? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listPublishingProfileXmlWithSecretsSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - listPublishingProfileXmlWithSecretsSlot(resourceGroupName: string, name: string, slot: string, options: { format? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @summary Recovers a web app to a previous snapshot. - * - * Recovers a web app to a previous snapshot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. - * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. - */ - recoverSlotWithHttpOperationResponse(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Recovers a web app to a previous snapshot. - * - * Recovers a web app to a previous snapshot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. - * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. - */ - recoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - recoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, callback: ServiceCallback): void; - recoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, 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 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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' - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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' - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} 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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - beginCreateOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - - /** - * @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' - * - * @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' - * - * @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 {RestoreResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {RestoreResponse} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} for more information. - * - * {WebResource} [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.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.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 Recovers a web app to a previous snapshot. - * - * Recovers a web app to a previous snapshot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. - * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - */ - beginRecoverWithHttpOperationResponse(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Recovers a web app to a previous snapshot. - * - * Recovers a web app to a previous snapshot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. - * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. - */ - beginRecover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginRecover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, callback: ServiceCallback): void; - beginRecover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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' - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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' - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} 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?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, 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' - * - * @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' - * - * @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 {RestoreResponse} - The deserialized result object. - * - * @reject {Error|ServiceError} - The error object. - * - * {ServiceCallback} optionalCallback(err, result, request, response) - * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. - * - * {RestoreResponse} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} for more information. - * - * {WebResource} [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.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.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 Recovers a web app to a previous snapshot. - * - * Recovers a web app to a previous snapshot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. - * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. - */ - beginRecoverSlotWithHttpOperationResponse(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; - - /** - * @summary Recovers a web app to a previous snapshot. - * - * Recovers a web app to a previous snapshot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. - * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. - */ - beginRecoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginRecoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, callback: ServiceCallback): void; - beginRecoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, 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 {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 {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 {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 {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 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 {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 {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 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 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 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.appServicePlanName Name for the App Service - * plan. - * - * @param {string} [appServicePlan.workerTierName] Target worker tier assigned - * to the App Service plan. - * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * - * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for - * the App Service Environment to use for the App Service plan. - * - * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of - * the App Service Environment. - * - * @param {boolean} [appServicePlan.perSiteScaling] If true, apps - * assigned to this App Service plan can be scaled independently. - * If false, apps assigned to this App Service plan will scale to - * all instances of the plan. - * - * @param {boolean} [appServicePlan.isSpot] If true, this App - * Service Plan owns spot instances. - * - * @param {date} [appServicePlan.spotExpirationTime] The time when the server - * farm expires. Valid only if it is a spot server farm. - * - * @param {boolean} [appServicePlan.reserved] If Linux 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.appServicePlanName Name for the App Service - * plan. - * - * @param {string} [appServicePlan.workerTierName] Target worker tier assigned - * to the App Service plan. - * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * - * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for - * the App Service Environment to use for the App Service plan. - * - * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of - * the App Service Environment. - * - * @param {boolean} [appServicePlan.perSiteScaling] If true, apps - * assigned to this App Service plan can be scaled independently. - * If false, apps assigned to this App Service plan will scale to - * all instances of the plan. - * - * @param {boolean} [appServicePlan.isSpot] If true, this App - * Service Plan owns spot instances. - * - * @param {date} [appServicePlan.spotExpirationTime] The time when the server - * farm expires. Valid only if it is a spot server farm. - * - * @param {boolean} [appServicePlan.reserved] If Linux 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.appServicePlanPatchResourceName Name for the - * App Service plan. - * - * @param {string} [appServicePlan.workerTierName] Target worker tier assigned - * to the App Service plan. - * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * - * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for - * the App Service Environment to use for the App Service plan. - * - * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of - * the App Service Environment. - * - * @param {boolean} [appServicePlan.perSiteScaling] If true, apps - * assigned to this App Service plan can be scaled independently. - * If false, apps assigned to this App Service plan will scale to - * all instances of the plan. - * - * @param {boolean} [appServicePlan.isSpot] If true, this App - * Service Plan owns spot instances. - * - * @param {date} [appServicePlan.spotExpirationTime] The time when the server - * farm expires. Valid only if it is a spot server farm. - * - * @param {boolean} [appServicePlan.reserved] If Linux 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.appServicePlanPatchResourceName Name for the - * App Service plan. - * - * @param {string} [appServicePlan.workerTierName] Target worker tier assigned - * to the App Service plan. - * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * - * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for - * the App Service Environment to use for the App Service plan. - * - * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of - * the App Service Environment. - * - * @param {boolean} [appServicePlan.perSiteScaling] If true, apps - * assigned to this App Service plan can be scaled independently. - * If false, apps assigned to this App Service plan will scale to - * all instances of the plan. - * - * @param {boolean} [appServicePlan.isSpot] If true, this App - * Service Plan owns spot instances. - * - * @param {date} [appServicePlan.spotExpirationTime] The time when the server - * farm expires. Valid only if it is a spot server farm. - * - * @param {boolean} [appServicePlan.reserved] If Linux 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.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * - * @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.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * - * @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.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * - * @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.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * - * @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.appServicePlanName Name for the App Service - * plan. - * - * @param {string} [appServicePlan.workerTierName] Target worker tier assigned - * to the App Service plan. - * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * - * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for - * the App Service Environment to use for the App Service plan. - * - * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of - * the App Service Environment. - * - * @param {boolean} [appServicePlan.perSiteScaling] If true, apps - * assigned to this App Service plan can be scaled independently. - * If false, apps assigned to this App Service plan will scale to - * all instances of the plan. - * - * @param {boolean} [appServicePlan.isSpot] If true, this App - * Service Plan owns spot instances. - * - * @param {date} [appServicePlan.spotExpirationTime] The time when the server - * farm expires. Valid only if it is a spot server farm. - * - * @param {boolean} [appServicePlan.reserved] If Linux 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.appServicePlanName Name for the App Service - * plan. - * - * @param {string} [appServicePlan.workerTierName] Target worker tier assigned - * to the App Service plan. - * - * @param {string} [appServicePlan.adminSiteName] App Service plan - * administration site. - * - * @param {object} [appServicePlan.hostingEnvironmentProfile] Specification for - * the App Service Environment to use for the App Service plan. - * - * @param {string} [appServicePlan.hostingEnvironmentProfile.id] Resource ID of - * the App Service Environment. - * - * @param {boolean} [appServicePlan.perSiteScaling] If true, apps - * assigned to this App Service plan can be scaled independently. - * If false, apps assigned to this App Service plan will scale to - * all instances of the plan. - * - * @param {boolean} [appServicePlan.isSpot] If true, this App - * Service Plan owns spot instances. - * - * @param {date} [appServicePlan.spotExpirationTime] The time when the server - * farm expires. Valid only if it is a spot server farm. - * - * @param {boolean} [appServicePlan.reserved] If Linux 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; -} diff --git a/lib/services/websiteManagement2/lib/lib/operations/index.js b/lib/services/websiteManagement2/lib/lib/operations/index.js deleted file mode 100644 index 3a92dd8e10..0000000000 --- a/lib/services/websiteManagement2/lib/lib/operations/index.js +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -/* 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.ResourceHealthMetadataOperations = require('./resourceHealthMetadataOperations'); -exports.BillingMeters = require('./billingMeters'); -exports.WebApps = require('./webApps'); -exports.AppServiceEnvironments = require('./appServiceEnvironments'); -exports.AppServicePlans = require('./appServicePlans'); diff --git a/lib/services/websiteManagement2/lib/lib/operations/provider.js b/lib/services/websiteManagement2/lib/lib/operations/provider.js deleted file mode 100644 index e65baac626..0000000000 --- a/lib/services/websiteManagement2/lib/lib/operations/provider.js +++ /dev/null @@ -1,1379 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.osTypeSelected] Possible values include: 'Windows', - * 'Linux' - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationStackCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _getAvailableStacks(options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - let osTypeSelected = (options && options.osTypeSelected !== undefined) ? options.osTypeSelected : undefined; - let apiVersion = '2016-03-01'; - // Validate - try { - if (osTypeSelected !== null && osTypeSelected !== undefined && typeof osTypeSelected.valueOf() !== 'string') { - throw new Error('osTypeSelected must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-01'; - // Validate - try { - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['CsmOperationCollection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.osTypeSelected] Possible values include: 'Windows', - * 'Linux' - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationStackCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _getAvailableStacksOnPrem(options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - let osTypeSelected = (options && options.osTypeSelected !== undefined) ? options.osTypeSelected : undefined; - let apiVersion = '2016-03-01'; - // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ApplicationStackCollection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** Class representing a Provider. */ -class Provider { - /** - * Create a Provider. - * @param {WebSiteManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._getAvailableStacks = _getAvailableStacks; - this._listOperations = _listOperations; - this._getAvailableStacksOnPrem = _getAvailableStacksOnPrem; - this._getAvailableStacksNext = _getAvailableStacksNext; - this._listOperationsNext = _listOperationsNext; - this._getAvailableStacksOnPremNext = _getAvailableStacksOnPremNext; - } - - /** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.osTypeSelected] Possible values include: 'Windows', - * 'Linux' - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getAvailableStacksWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getAvailableStacks(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.osTypeSelected] Possible values include: 'Windows', - * 'Linux' - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {ApplicationStackCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationStackCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getAvailableStacks(options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getAvailableStacks(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getAvailableStacks(options, optionalCallback); - } - } - - /** - * @summary Gets all available operations for the Microsoft.Web resource - * provider. Also exposes resource metric definitions - * - * Gets all available operations for the Microsoft.Web resource provider. Also - * exposes resource metric definitions - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listOperationsWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listOperations(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets all available operations for the Microsoft.Web resource - * provider. Also exposes resource metric definitions - * - * Gets all available operations for the Microsoft.Web resource provider. Also - * exposes resource metric definitions - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {CsmOperationCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link CsmOperationCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listOperations(options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listOperations(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listOperations(options, optionalCallback); - } - } - - /** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.osTypeSelected] Possible values include: 'Windows', - * 'Linux' - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getAvailableStacksOnPremWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getAvailableStacksOnPrem(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.osTypeSelected] Possible values include: 'Windows', - * 'Linux' - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {ApplicationStackCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationStackCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getAvailableStacksOnPrem(options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getAvailableStacksOnPrem(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getAvailableStacksOnPrem(options, optionalCallback); - } - } - - /** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getAvailableStacksNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getAvailableStacksNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {ApplicationStackCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationStackCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getAvailableStacksNext(nextPageLink, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getAvailableStacksNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getAvailableStacksNext(nextPageLink, options, optionalCallback); - } - } - - /** - * @summary Gets all available operations for the Microsoft.Web resource - * provider. Also exposes resource metric definitions - * - * Gets all available operations for the Microsoft.Web resource provider. Also - * exposes resource metric definitions - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listOperationsNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listOperationsNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets all available operations for the Microsoft.Web resource - * provider. Also exposes resource metric definitions - * - * Gets all available operations for the Microsoft.Web resource provider. Also - * exposes resource metric definitions - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {CsmOperationCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link CsmOperationCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listOperationsNext(nextPageLink, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listOperationsNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listOperationsNext(nextPageLink, options, optionalCallback); - } - } - - /** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getAvailableStacksOnPremNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getAvailableStacksOnPremNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get available application frameworks and their versions - * - * Get available application frameworks and their versions - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {ApplicationStackCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ApplicationStackCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getAvailableStacksOnPremNext(nextPageLink, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getAvailableStacksOnPremNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getAvailableStacksOnPremNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = Provider; diff --git a/lib/services/websiteManagement2/lib/lib/operations/recommendations.js b/lib/services/websiteManagement2/lib/lib/operations/recommendations.js deleted file mode 100644 index 66adb54b6a..0000000000 --- a/lib/services/websiteManagement2/lib/lib/operations/recommendations.js +++ /dev/null @@ -1,2944 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * @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=channels 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; - let apiVersion = '2016-03-01'; - // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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.Web/recommendations/reset'; - 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 !== 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.'); - } - let apiVersion = '2016-03-01'; - // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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 {string} [options.filter] Filter is specified by using OData syntax. - * Example: $filter=channels 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 filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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 (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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (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 (filter !== null && filter !== undefined) { - queryParameters.push('$filter=' + filter); - } - 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['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=channels - * 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; - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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; - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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=channels 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=channels 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 {string} [options.filter] Filter is specified by using OData syntax. - * Example: $filter=channels 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 {string} [options.filter] Filter is specified by using OData syntax. - * Example: $filter=channels 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=channels - * 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=channels - * 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/lib/operations/resourceHealthMetadataOperations.js b/lib/services/websiteManagement2/lib/lib/operations/resourceHealthMetadataOperations.js deleted file mode 100644 index 22c45328e6..0000000000 --- a/lib/services/websiteManagement2/lib/lib/operations/resourceHealthMetadataOperations.js +++ /dev/null @@ -1,2470 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * @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.'); - } - let apiVersion = '2016-03-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.Web/resourceHealthMetadata'; - 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['DefaultErrorResponse']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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/lib/operations/topLevelDomains.js b/lib/services/websiteManagement2/lib/lib/operations/topLevelDomains.js deleted file mode 100644 index ed6c81ea55..0000000000 --- a/lib/services/websiteManagement2/lib/lib/operations/topLevelDomains.js +++ /dev/null @@ -1,1200 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * @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.'); - } - let apiVersion = '2015-04-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.DomainRegistration/topLevelDomains'; - 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['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.'); - } - let apiVersion = '2015-04-01'; - // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2015-04-01'; - // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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/lib/operations/webApps.js b/lib/services/websiteManagement2/lib/lib/operations/webApps.js deleted file mode 100644 index 5512ecb8d8..0000000000 --- a/lib/services/websiteManagement2/lib/lib/operations/webApps.js +++ /dev/null @@ -1,116459 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * @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.'); - } - let apiVersion = '2016-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.Web/sites'; - 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['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; - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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' - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [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; - let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { - throw new Error('skipDnsRegistration must be of type boolean.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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())); - } - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { - queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); - } - 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 && 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} 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.'); - } - let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; - let skipCustomDomainVerification = (options && options.skipCustomDomainVerification !== undefined) ? options.skipCustomDomainVerification : undefined; - let forceDnsRegistration = (options && options.forceDnsRegistration !== undefined) ? options.forceDnsRegistration : undefined; - let ttlInSeconds = (options && options.ttlInSeconds !== undefined) ? options.ttlInSeconds : undefined; - let apiVersion = '2016-08-01'; - // Validate - try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { - throw new Error('skipDnsRegistration must be of type boolean.'); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined && typeof skipCustomDomainVerification !== 'boolean') { - throw new Error('skipCustomDomainVerification must be of type boolean.'); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined && typeof forceDnsRegistration !== 'boolean') { - throw new Error('forceDnsRegistration must be of type boolean.'); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined && typeof ttlInSeconds.valueOf() !== 'string') { - throw new Error('ttlInSeconds must be of type string.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { - queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined) { - queryParameters.push('skipCustomDomainVerification=' + encodeURIComponent(skipCustomDomainVerification.toString())); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined) { - queryParameters.push('forceDnsRegistration=' + encodeURIComponent(forceDnsRegistration.toString())); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined) { - queryParameters.push('ttlInSeconds=' + encodeURIComponent(ttlInSeconds)); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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; - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 Discovers an existing app backup that can be restored from a blob - * in Azure storage. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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 _discoverRestore(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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/discover'; - 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(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['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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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' - * - * @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 RestoreResponse} for more information. - * - * {object} [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 - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RestoreResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in 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} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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 {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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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 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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 {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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 {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 {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 {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.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 {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 {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 {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.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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 _getWebSiteContainerLogsZip(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 apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 {string} [deployment.deploymentId] Identifier for deployment. - * - * @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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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; - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['NetworkFeatures']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * @summary Start capturing network packets for the site. - * - * Start capturing network packets for the site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.durationInSeconds] The duration to keep capturing - * in seconds. - * - * @param {number} [options.maxFrameLength] The maximum frame length in bytes - * (Optional). - * - * @param {string} [options.sasUrl] The Blob URL to store capture file. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {string} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - let durationInSeconds = (options && options.durationInSeconds !== undefined) ? options.durationInSeconds : undefined; - let maxFrameLength = (options && options.maxFrameLength !== undefined) ? options.maxFrameLength : undefined; - let sasUrl = (options && options.sasUrl !== undefined) ? options.sasUrl : undefined; - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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 = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * @summary Stop ongoing capturing network packets for the site. - * - * Stop ongoing capturing network packets for the site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {string} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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 = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * @summary Generates a new publishing password for an app (or deployment slot, - * if specified). - * - * Generates a new publishing password for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _generateNewSitePublishingPassword(resourceGroupName, name, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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; - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * - * @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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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} [options] Optional Parameters. - * - * @param {string} [options.format] Name of the format. Valid values are: - * FileZilla3 - * WebDeploy -- default - * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, 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, options, callback) { - /* jshint 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 format = (options && options.format !== undefined) ? options.format : undefined; - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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 (format !== null && format !== undefined && typeof format.valueOf() !== 'string') { - throw new Error('format must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.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 publishingProfileOptions; - if (format !== null && format !== undefined) { - publishingProfileOptions = new client.models['CsmPublishingProfileOptions'](); - publishingProfileOptions.format = format; - } - - // 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.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 Recovers a web app to a previous snapshot. - * - * Recovers a web app to a previous snapshot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. - * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.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 _recover(resourceGroupName, name, recoveryEntity, options, callback) { - /* jshint 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.beginRecover(resourceGroupName, name, recoveryEntity, 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 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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; - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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' - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [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; - let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { - throw new Error('skipDnsRegistration must be of type boolean.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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())); - } - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { - queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); - } - 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 && 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} 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.'); - } - let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; - let skipCustomDomainVerification = (options && options.skipCustomDomainVerification !== undefined) ? options.skipCustomDomainVerification : undefined; - let forceDnsRegistration = (options && options.forceDnsRegistration !== undefined) ? options.forceDnsRegistration : undefined; - let ttlInSeconds = (options && options.ttlInSeconds !== undefined) ? options.ttlInSeconds : undefined; - let apiVersion = '2016-08-01'; - // Validate - try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { - throw new Error('skipDnsRegistration must be of type boolean.'); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined && typeof skipCustomDomainVerification !== 'boolean') { - throw new Error('skipCustomDomainVerification must be of type boolean.'); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined && typeof forceDnsRegistration !== 'boolean') { - throw new Error('forceDnsRegistration must be of type boolean.'); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined && typeof ttlInSeconds.valueOf() !== 'string') { - throw new Error('ttlInSeconds must be of type string.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { - queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined) { - queryParameters.push('skipCustomDomainVerification=' + encodeURIComponent(skipCustomDomainVerification.toString())); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined) { - queryParameters.push('forceDnsRegistration=' + encodeURIComponent(forceDnsRegistration.toString())); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined) { - queryParameters.push('ttlInSeconds=' + encodeURIComponent(ttlInSeconds)); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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; - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 Discovers an existing app backup that can be restored from a blob - * in Azure storage. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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 _discoverRestoreSlot(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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/discover'; - 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(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['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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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' - * - * @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. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} for more information. - * - * {object} [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 - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RestoreResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in 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} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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 {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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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 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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 {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 {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 {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.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 {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 {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 {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.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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 _getWebSiteContainerLogsZipSlot(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 apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 {string} [deployment.deploymentId] Identifier for deployment. - * - * @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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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; - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['NetworkFeatures']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * @summary Start capturing network packets for the site. - * - * Start capturing network packets for the site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} slot The name of the slot for this web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.durationInSeconds] The duration to keep capturing - * in seconds. - * - * @param {number} [options.maxFrameLength] The maximum frame length in bytes - * (Optional). - * - * @param {string} [options.sasUrl] The Blob URL to store capture file. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {string} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - let durationInSeconds = (options && options.durationInSeconds !== undefined) ? options.durationInSeconds : undefined; - let maxFrameLength = (options && options.maxFrameLength !== undefined) ? options.maxFrameLength : undefined; - let sasUrl = (options && options.sasUrl !== undefined) ? options.sasUrl : undefined; - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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 = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * @summary Stop ongoing capturing network packets for the site. - * - * Stop ongoing capturing network packets for the site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} slot The name of the slot for this web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {string} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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 = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * @summary Generates a new publishing password for an app (or deployment slot, - * if specified). - * - * Generates a new publishing password for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API generate a new publishing password for the production - * slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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; - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * - * @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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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 {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 {string} [options.format] Name of the format. Valid values are: - * FileZilla3 - * WebDeploy -- default - * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, 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, slot, options, callback) { - /* jshint 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 format = (options && options.format !== undefined) ? options.format : undefined; - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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 (format !== null && format !== undefined && typeof format.valueOf() !== 'string') { - throw new Error('format must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.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 publishingProfileOptions; - if (format !== null && format !== undefined) { - publishingProfileOptions = new client.models['CsmPublishingProfileOptions'](); - publishingProfileOptions.format = format; - } - - // 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.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 Recovers a web app to a previous snapshot. - * - * Recovers a web app to a previous snapshot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. - * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.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 _recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, callback) { - /* jshint 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.beginRecoverSlot(resourceGroupName, name, recoveryEntity, 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 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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; - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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); - } - } - - 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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); - } - } - - 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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; - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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); - } - } - - 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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); - } - } - - 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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; - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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' - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} 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.'); - } - let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; - let skipCustomDomainVerification = (options && options.skipCustomDomainVerification !== undefined) ? options.skipCustomDomainVerification : undefined; - let forceDnsRegistration = (options && options.forceDnsRegistration !== undefined) ? options.forceDnsRegistration : undefined; - let ttlInSeconds = (options && options.ttlInSeconds !== undefined) ? options.ttlInSeconds : undefined; - let apiVersion = '2016-08-01'; - // Validate - try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { - throw new Error('skipDnsRegistration must be of type boolean.'); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined && typeof skipCustomDomainVerification !== 'boolean') { - throw new Error('skipCustomDomainVerification must be of type boolean.'); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined && typeof forceDnsRegistration !== 'boolean') { - throw new Error('forceDnsRegistration must be of type boolean.'); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined && typeof ttlInSeconds.valueOf() !== 'string') { - throw new Error('ttlInSeconds must be of type string.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { - queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined) { - queryParameters.push('skipCustomDomainVerification=' + encodeURIComponent(skipCustomDomainVerification.toString())); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined) { - queryParameters.push('forceDnsRegistration=' + encodeURIComponent(forceDnsRegistration.toString())); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined) { - queryParameters.push('ttlInSeconds=' + encodeURIComponent(ttlInSeconds)); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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' - * - * @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 RestoreResponse} for more information. - * - * {object} [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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RestoreResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in 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 _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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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.'); - } - let apiVersion = '2016-08-01'; - // 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 Recovers a web app to a previous snapshot. - * - * Recovers a web app to a previous snapshot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. - * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.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 _beginRecover(resourceGroupName, name, recoveryEntity, options, callback) { - /* jshint 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 = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === null || name === undefined || typeof name.valueOf() !== 'string') { - throw new Error('name cannot be null or undefined and it must be of type string.'); - } - if (recoveryEntity === null || recoveryEntity === undefined) { - throw new Error('recoveryEntity 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/recover'; - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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 (recoveryEntity !== null && recoveryEntity !== undefined) { - let requestModelMapper = new client.models['SnapshotRecoveryRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, recoveryEntity, 'recoveryEntity'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(recoveryEntity, null, 2)}.`); - return callback(serializationError); - } - 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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' - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} 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.'); - } - let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; - let skipCustomDomainVerification = (options && options.skipCustomDomainVerification !== undefined) ? options.skipCustomDomainVerification : undefined; - let forceDnsRegistration = (options && options.forceDnsRegistration !== undefined) ? options.forceDnsRegistration : undefined; - let ttlInSeconds = (options && options.ttlInSeconds !== undefined) ? options.ttlInSeconds : undefined; - let apiVersion = '2016-08-01'; - // Validate - try { - if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { - throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); - } - if (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { - throw new Error('skipDnsRegistration must be of type boolean.'); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined && typeof skipCustomDomainVerification !== 'boolean') { - throw new Error('skipCustomDomainVerification must be of type boolean.'); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined && typeof forceDnsRegistration !== 'boolean') { - throw new Error('forceDnsRegistration must be of type boolean.'); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined && typeof ttlInSeconds.valueOf() !== 'string') { - throw new Error('ttlInSeconds must be of type string.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { - queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined) { - queryParameters.push('skipCustomDomainVerification=' + encodeURIComponent(skipCustomDomainVerification.toString())); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined) { - queryParameters.push('forceDnsRegistration=' + encodeURIComponent(forceDnsRegistration.toString())); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined) { - queryParameters.push('ttlInSeconds=' + encodeURIComponent(ttlInSeconds)); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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' - * - * @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. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} for more information. - * - * {object} [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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RestoreResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in 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 _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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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 Recovers a web app to a previous snapshot. - * - * Recovers a web app to a previous snapshot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. - * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.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 _beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, callback) { - /* jshint 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 = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === null || name === undefined || typeof name.valueOf() !== 'string') { - throw new Error('name cannot be null or undefined and it must be of type string.'); - } - if (recoveryEntity === null || recoveryEntity === undefined) { - throw new Error('recoveryEntity 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/recover'; - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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 (recoveryEntity !== null && recoveryEntity !== undefined) { - let requestModelMapper = new client.models['SnapshotRecoveryRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, recoveryEntity, 'recoveryEntity'); - requestContent = JSON.stringify(requestModel); - } - } catch (error) { - let serializationError = new Error(`Error "${error.message}" occurred in serializing the ` + - `payload - ${JSON.stringify(recoveryEntity, null, 2)}.`); - return callback(serializationError); - } - 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(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) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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); - } - } - - 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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); - } - } - - 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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._discoverRestore = _discoverRestore; - 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._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._getConfiguration = _getConfiguration; - this._createOrUpdateConfiguration = _createOrUpdateConfiguration; - this._updateConfiguration = _updateConfiguration; - this._listConfigurationSnapshotInfo = _listConfigurationSnapshotInfo; - this._getConfigurationSnapshot = _getConfigurationSnapshot; - this._recoverSiteConfigurationSnapshot = _recoverSiteConfigurationSnapshot; - this._getWebSiteContainerLogs = _getWebSiteContainerLogs; - this._getWebSiteContainerLogsZip = _getWebSiteContainerLogsZip; - 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._listDomainOwnershipIdentifiers = _listDomainOwnershipIdentifiers; - this._getDomainOwnershipIdentifier = _getDomainOwnershipIdentifier; - this._createOrUpdateDomainOwnershipIdentifier = _createOrUpdateDomainOwnershipIdentifier; - this._deleteDomainOwnershipIdentifier = _deleteDomainOwnershipIdentifier; - this._updateDomainOwnershipIdentifier = _updateDomainOwnershipIdentifier; - this._getMSDeployStatus = _getMSDeployStatus; - this._createMSDeployOperation = _createMSDeployOperation; - this._getMSDeployLog = _getMSDeployLog; - this._listFunctions = _listFunctions; - this._getFunctionsAdminToken = _getFunctionsAdminToken; - this._getFunction = _getFunction; - this._createFunction = _createFunction; - this._deleteFunction = _deleteFunction; - this._listFunctionSecrets = _listFunctionSecrets; - this._listHostNameBindings = _listHostNameBindings; - this._getHostNameBinding = _getHostNameBinding; - this._createOrUpdateHostNameBinding = _createOrUpdateHostNameBinding; - this._deleteHostNameBinding = _deleteHostNameBinding; - this._getHybridConnection = _getHybridConnection; - this._createOrUpdateHybridConnection = _createOrUpdateHybridConnection; - this._deleteHybridConnection = _deleteHybridConnection; - this._updateHybridConnection = _updateHybridConnection; - this._listHybridConnectionKeys = _listHybridConnectionKeys; - this._listHybridConnections = _listHybridConnections; - this._listRelayServiceConnections = _listRelayServiceConnections; - this._getRelayServiceConnection = _getRelayServiceConnection; - this._createOrUpdateRelayServiceConnection = _createOrUpdateRelayServiceConnection; - this._deleteRelayServiceConnection = _deleteRelayServiceConnection; - this._updateRelayServiceConnection = _updateRelayServiceConnection; - this._listInstanceIdentifiers = _listInstanceIdentifiers; - this._getInstanceMsDeployStatus = _getInstanceMsDeployStatus; - this._createInstanceMSDeployOperation = _createInstanceMSDeployOperation; - this._getInstanceMSDeployLog = _getInstanceMSDeployLog; - this._listInstanceProcesses = _listInstanceProcesses; - this._getInstanceProcess = _getInstanceProcess; - this._deleteInstanceProcess = _deleteInstanceProcess; - this._getInstanceProcessDump = _getInstanceProcessDump; - this._listInstanceProcessModules = _listInstanceProcessModules; - this._getInstanceProcessModule = _getInstanceProcessModule; - this._listInstanceProcessThreads = _listInstanceProcessThreads; - this._getInstanceProcessThread = _getInstanceProcessThread; - this._isCloneable = _isCloneable; - this._listSyncFunctionTriggers = _listSyncFunctionTriggers; - this._listMetricDefinitions = _listMetricDefinitions; - this._listMetrics = _listMetrics; - this._migrateStorage = _migrateStorage; - this._migrateMySql = _migrateMySql; - this._getMigrateMySqlStatus = _getMigrateMySqlStatus; - this._listNetworkFeatures = _listNetworkFeatures; - this._startWebSiteNetworkTrace = _startWebSiteNetworkTrace; - this._stopWebSiteNetworkTrace = _stopWebSiteNetworkTrace; - this._generateNewSitePublishingPassword = _generateNewSitePublishingPassword; - this._listPerfMonCounters = _listPerfMonCounters; - this._getSitePhpErrorLogFlag = _getSitePhpErrorLogFlag; - this._listPremierAddOns = _listPremierAddOns; - this._getPremierAddOn = _getPremierAddOn; - this._addPremierAddOn = _addPremierAddOn; - this._deletePremierAddOn = _deletePremierAddOn; - this._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._recover = _recover; - this._resetProductionSlotConfig = _resetProductionSlotConfig; - this._restart = _restart; - 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._discoverRestoreSlot = _discoverRestoreSlot; - 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._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._getConfigurationSlot = _getConfigurationSlot; - this._createOrUpdateConfigurationSlot = _createOrUpdateConfigurationSlot; - this._updateConfigurationSlot = _updateConfigurationSlot; - this._listConfigurationSnapshotInfoSlot = _listConfigurationSnapshotInfoSlot; - this._getConfigurationSnapshotSlot = _getConfigurationSnapshotSlot; - this._recoverSiteConfigurationSnapshotSlot = _recoverSiteConfigurationSnapshotSlot; - this._getWebSiteContainerLogsSlot = _getWebSiteContainerLogsSlot; - this._getWebSiteContainerLogsZipSlot = _getWebSiteContainerLogsZipSlot; - 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._listDomainOwnershipIdentifiersSlot = _listDomainOwnershipIdentifiersSlot; - this._getDomainOwnershipIdentifierSlot = _getDomainOwnershipIdentifierSlot; - this._createOrUpdateDomainOwnershipIdentifierSlot = _createOrUpdateDomainOwnershipIdentifierSlot; - this._deleteDomainOwnershipIdentifierSlot = _deleteDomainOwnershipIdentifierSlot; - this._updateDomainOwnershipIdentifierSlot = _updateDomainOwnershipIdentifierSlot; - this._getMSDeployStatusSlot = _getMSDeployStatusSlot; - this._createMSDeployOperationSlot = _createMSDeployOperationSlot; - this._getMSDeployLogSlot = _getMSDeployLogSlot; - this._listInstanceFunctionsSlot = _listInstanceFunctionsSlot; - this._getFunctionsAdminTokenSlot = _getFunctionsAdminTokenSlot; - this._getInstanceFunctionSlot = _getInstanceFunctionSlot; - this._createInstanceFunctionSlot = _createInstanceFunctionSlot; - this._deleteInstanceFunctionSlot = _deleteInstanceFunctionSlot; - this._listFunctionSecretsSlot = _listFunctionSecretsSlot; - this._listHostNameBindingsSlot = _listHostNameBindingsSlot; - this._getHostNameBindingSlot = _getHostNameBindingSlot; - this._createOrUpdateHostNameBindingSlot = _createOrUpdateHostNameBindingSlot; - this._deleteHostNameBindingSlot = _deleteHostNameBindingSlot; - this._getHybridConnectionSlot = _getHybridConnectionSlot; - this._createOrUpdateHybridConnectionSlot = _createOrUpdateHybridConnectionSlot; - this._deleteHybridConnectionSlot = _deleteHybridConnectionSlot; - this._updateHybridConnectionSlot = _updateHybridConnectionSlot; - this._listHybridConnectionKeysSlot = _listHybridConnectionKeysSlot; - this._listHybridConnectionsSlot = _listHybridConnectionsSlot; - this._listRelayServiceConnectionsSlot = _listRelayServiceConnectionsSlot; - this._getRelayServiceConnectionSlot = _getRelayServiceConnectionSlot; - this._createOrUpdateRelayServiceConnectionSlot = _createOrUpdateRelayServiceConnectionSlot; - this._deleteRelayServiceConnectionSlot = _deleteRelayServiceConnectionSlot; - this._updateRelayServiceConnectionSlot = _updateRelayServiceConnectionSlot; - this._listInstanceIdentifiersSlot = _listInstanceIdentifiersSlot; - this._getInstanceMsDeployStatusSlot = _getInstanceMsDeployStatusSlot; - this._createInstanceMSDeployOperationSlot = _createInstanceMSDeployOperationSlot; - this._getInstanceMSDeployLogSlot = _getInstanceMSDeployLogSlot; - this._listInstanceProcessesSlot = _listInstanceProcessesSlot; - this._getInstanceProcessSlot = _getInstanceProcessSlot; - this._deleteInstanceProcessSlot = _deleteInstanceProcessSlot; - this._getInstanceProcessDumpSlot = _getInstanceProcessDumpSlot; - this._listInstanceProcessModulesSlot = _listInstanceProcessModulesSlot; - this._getInstanceProcessModuleSlot = _getInstanceProcessModuleSlot; - this._listInstanceProcessThreadsSlot = _listInstanceProcessThreadsSlot; - this._getInstanceProcessThreadSlot = _getInstanceProcessThreadSlot; - this._isCloneableSlot = _isCloneableSlot; - this._listSyncFunctionTriggersSlot = _listSyncFunctionTriggersSlot; - this._listMetricDefinitionsSlot = _listMetricDefinitionsSlot; - this._listMetricsSlot = _listMetricsSlot; - this._getMigrateMySqlStatusSlot = _getMigrateMySqlStatusSlot; - this._listNetworkFeaturesSlot = _listNetworkFeaturesSlot; - this._startWebSiteNetworkTraceSlot = _startWebSiteNetworkTraceSlot; - this._stopWebSiteNetworkTraceSlot = _stopWebSiteNetworkTraceSlot; - this._generateNewSitePublishingPasswordSlot = _generateNewSitePublishingPasswordSlot; - this._listPerfMonCountersSlot = _listPerfMonCountersSlot; - this._getSitePhpErrorLogFlagSlot = _getSitePhpErrorLogFlagSlot; - this._listPremierAddOnsSlot = _listPremierAddOnsSlot; - this._getPremierAddOnSlot = _getPremierAddOnSlot; - this._addPremierAddOnSlot = _addPremierAddOnSlot; - this._deletePremierAddOnSlot = _deletePremierAddOnSlot; - this._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._recoverSlot = _recoverSlot; - this._resetSlotConfigurationSlot = _resetSlotConfigurationSlot; - this._restartSlot = _restartSlot; - 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._beginRecover = _beginRecover; - this._beginInstallSiteExtension = _beginInstallSiteExtension; - this._beginCreateOrUpdateSlot = _beginCreateOrUpdateSlot; - this._beginRestoreSlot = _beginRestoreSlot; - this._beginListPublishingCredentialsSlot = _beginListPublishingCredentialsSlot; - this._beginCreateMSDeployOperationSlot = _beginCreateMSDeployOperationSlot; - this._beginCreateInstanceFunctionSlot = _beginCreateInstanceFunctionSlot; - this._beginCreateInstanceMSDeployOperationSlot = _beginCreateInstanceMSDeployOperationSlot; - this._beginRecoverSlot = _beginRecoverSlot; - 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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' - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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' - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * - * @param {object} [options.customHeaders] Headers 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} 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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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 Discovers an existing app backup that can be restored from a blob - * in Azure storage. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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. - */ - discoverRestoreWithHttpOperationResponse(resourceGroupName, name, request, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._discoverRestore(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. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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. - */ - discoverRestore(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._discoverRestore(resourceGroupName, name, request, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._discoverRestore(resourceGroupName, name, request, 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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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' - * - * @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' - * - * @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 {RestoreResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} for more information. - * - * {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 {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 {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 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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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 {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 {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 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 {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 {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 {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.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers 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 {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 {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 {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.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 {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 {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 {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.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers 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 {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 {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 {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.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. - */ - getWebSiteContainerLogsZipWithHttpOperationResponse(resourceGroupName, name, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getWebSiteContainerLogsZip(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. - */ - getWebSiteContainerLogsZip(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._getWebSiteContainerLogsZip(resourceGroupName, name, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getWebSiteContainerLogsZip(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 {string} [deployment.deploymentId] Identifier for deployment. - * - * @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 {string} [deployment.deploymentId] Identifier for deployment. - * - * @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 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.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.scriptRootPathHref] Script root path URI. - * - * @param {string} [functionEnvelope.scriptHref] Script URI. - * - * @param {string} [functionEnvelope.configHref] Config URI. - * - * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. - * - * @param {string} [functionEnvelope.href] Function URI. - * - * @param {object} [functionEnvelope.config] Config information. - * - * @param {object} [functionEnvelope.files] File list. - * - * @param {string} [functionEnvelope.testData] Test data used when testing via - * the Azure Portal. - * - * @param {string} [functionEnvelope.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {FunctionEnvelope} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link FunctionEnvelope} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - createFunction(resourceGroupName, name, functionName, functionEnvelope, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._createFunction(resourceGroupName, name, functionName, functionEnvelope, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createFunction(resourceGroupName, name, functionName, functionEnvelope, options, optionalCallback); - } - } - - /** - * @summary Delete a function for web site, or a deployment slot. - * - * Delete a function for web site, or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} functionName Function name. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - deleteFunctionWithHttpOperationResponse(resourceGroupName, name, functionName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteFunction(resourceGroupName, name, functionName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Delete a function for web site, or a deployment slot. - * - * Delete a function for web site, or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} functionName Function name. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteFunction(resourceGroupName, name, functionName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._deleteFunction(resourceGroupName, name, functionName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteFunction(resourceGroupName, name, functionName, options, optionalCallback); - } - } - - /** - * @summary Get function secrets for a function in a web site, or a deployment - * slot. - * - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} functionName Function name. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listFunctionSecretsWithHttpOperationResponse(resourceGroupName, name, functionName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listFunctionSecrets(resourceGroupName, name, functionName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get function secrets for a function in a web site, or a deployment - * slot. - * - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} functionName Function name. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {FunctionSecrets} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link FunctionSecrets} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listFunctionSecrets(resourceGroupName, name, functionName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listFunctionSecrets(resourceGroupName, name, functionName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listFunctionSecrets(resourceGroupName, name, functionName, options, optionalCallback); - } - } - - /** - * @summary Get hostname bindings for an app or a deployment slot. - * - * Get hostname bindings for an app or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listHostNameBindingsWithHttpOperationResponse(resourceGroupName, name, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listHostNameBindings(resourceGroupName, name, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get hostname bindings for an app or a deployment slot. - * - * Get hostname bindings for an app or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {HostNameBindingCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link HostNameBindingCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listHostNameBindings(resourceGroupName, name, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listHostNameBindings(resourceGroupName, name, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listHostNameBindings(resourceGroupName, name, options, optionalCallback); - } - } - - /** - * @summary Get the named hostname binding for an app (or deployment slot, if - * specified). - * - * Get the named hostname binding for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} hostName Hostname in the hostname binding. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getHostNameBindingWithHttpOperationResponse(resourceGroupName, name, hostName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getHostNameBinding(resourceGroupName, name, hostName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get the named hostname binding for an app (or deployment slot, if - * specified). - * - * Get the named hostname binding for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} hostName Hostname in the hostname binding. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {HostNameBinding} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link HostNameBinding} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getHostNameBinding(resourceGroupName, name, hostName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getHostNameBinding(resourceGroupName, name, hostName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getHostNameBinding(resourceGroupName, name, hostName, options, optionalCallback); - } - } - - /** - * @summary Creates a hostname binding for an app. - * - * Creates a hostname binding for an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} hostName Hostname in the hostname binding. - * - * @param {object} hostNameBinding Binding details. This is the JSON - * representation of a HostNameBinding object. - * - * @param {string} [hostNameBinding.siteName] App Service app name. - * - * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain - * resource URI. - * - * @param {string} [hostNameBinding.azureResourceName] Azure resource name. - * - * @param {string} [hostNameBinding.azureResourceType] Azure resource type. - * Possible values include: 'Website', 'TrafficManager' - * - * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS - * record type. Possible values include: 'CName', 'A' - * - * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible - * values include: 'Verified', 'Managed' - * - * @param {string} [hostNameBinding.sslState] SSL type. Possible values - * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' - * - * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint - * - * @param {string} [hostNameBinding.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - createOrUpdateHostNameBindingWithHttpOperationResponse(resourceGroupName, name, hostName, hostNameBinding, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostNameBinding, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Creates a hostname binding for an app. - * - * Creates a hostname binding for an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} hostName Hostname in the hostname binding. - * - * @param {object} hostNameBinding Binding details. This is the JSON - * representation of a HostNameBinding object. - * - * @param {string} [hostNameBinding.siteName] App Service app name. - * - * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain - * resource URI. - * - * @param {string} [hostNameBinding.azureResourceName] Azure resource name. - * - * @param {string} [hostNameBinding.azureResourceType] Azure resource type. - * Possible values include: 'Website', 'TrafficManager' - * - * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS - * record type. Possible values include: 'CName', 'A' - * - * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible - * values include: 'Verified', 'Managed' - * - * @param {string} [hostNameBinding.sslState] SSL type. Possible values - * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' - * - * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint - * - * @param {string} [hostNameBinding.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {HostNameBinding} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link HostNameBinding} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostNameBinding, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostNameBinding, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostNameBinding, options, optionalCallback); - } - } - - /** - * @summary Deletes a hostname binding for an app. - * - * Deletes a hostname binding for an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} hostName Hostname in the hostname binding. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - deleteHostNameBindingWithHttpOperationResponse(resourceGroupName, name, hostName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteHostNameBinding(resourceGroupName, name, hostName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Deletes a hostname binding for an app. - * - * Deletes a hostname binding for an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} hostName Hostname in the hostname binding. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteHostNameBinding(resourceGroupName, name, hostName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._deleteHostNameBinding(resourceGroupName, name, hostName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteHostNameBinding(resourceGroupName, name, hostName, options, optionalCallback); - } - } - - /** - * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web - * App. - * - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getHybridConnectionWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web - * App. - * - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {HybridConnection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link HybridConnection} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, optionalCallback); - } - } - - /** - * @summary Creates a new Hybrid Connection using a Service Bus relay. - * - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} connectionEnvelope The details of the hybrid connection. - * - * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the - * Service Bus namespace. - * - * @param {string} [connectionEnvelope.relayName] The name of the Service Bus - * relay. - * - * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service - * Bus relay. - * - * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. - * - * @param {number} [connectionEnvelope.port] The port of the endpoint. - * - * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus - * key which has Send permissions. This is used to authenticate to Service Bus. - * - * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service - * Bus key. This is used to authenticate to Service Bus. In ARM this key will - * not be returned - * normally, use the POST /listKeys API instead. - * - * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the - * service bus endpoint. By default this is .servicebus.windows.net - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - createOrUpdateHybridConnectionWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Creates a new Hybrid Connection using a Service Bus relay. - * - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} connectionEnvelope The details of the hybrid connection. - * - * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the - * Service Bus namespace. - * - * @param {string} [connectionEnvelope.relayName] The name of the Service Bus - * relay. - * - * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service - * Bus relay. - * - * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. - * - * @param {number} [connectionEnvelope.port] The port of the endpoint. - * - * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus - * key which has Send permissions. This is used to authenticate to Service Bus. - * - * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service - * Bus key. This is used to authenticate to Service Bus. In ARM this key will - * not be returned - * normally, use the POST /listKeys API instead. - * - * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the - * service bus endpoint. By default this is .servicebus.windows.net - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {HybridConnection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link HybridConnection} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, optionalCallback); - } - } - - /** - * @summary Removes a Hybrid Connection from this site. - * - * Removes a Hybrid Connection from this site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - deleteHybridConnectionWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Removes a Hybrid Connection from this site. - * - * Removes a Hybrid Connection from this site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, optionalCallback); - } - } - - /** - * @summary Creates a new Hybrid Connection using a Service Bus relay. - * - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} connectionEnvelope The details of the hybrid connection. - * - * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the - * Service Bus namespace. - * - * @param {string} [connectionEnvelope.relayName] The name of the Service Bus - * relay. - * - * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service - * Bus relay. - * - * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. - * - * @param {number} [connectionEnvelope.port] The port of the endpoint. - * - * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus - * key which has Send permissions. This is used to authenticate to Service Bus. - * - * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service - * Bus key. This is used to authenticate to Service Bus. In ARM this key will - * not be returned - * normally, use the POST /listKeys API instead. - * - * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the - * service bus endpoint. By default this is .servicebus.windows.net - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - updateHybridConnectionWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Creates a new Hybrid Connection using a Service Bus relay. - * - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} connectionEnvelope The details of the hybrid connection. - * - * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the - * Service Bus namespace. - * - * @param {string} [connectionEnvelope.relayName] The name of the Service Bus - * relay. - * - * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service - * Bus relay. - * - * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. - * - * @param {number} [connectionEnvelope.port] The port of the endpoint. - * - * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus - * key which has Send permissions. This is used to authenticate to Service Bus. - * - * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service - * Bus key. This is used to authenticate to Service Bus. In ARM this key will - * not be returned - * normally, use the POST /listKeys API instead. - * - * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the - * service bus endpoint. By default this is .servicebus.windows.net - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {HybridConnection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link HybridConnection} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - updateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._updateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, optionalCallback); - } - } - - /** - * @summary Gets the send key name and value for a Hybrid Connection. - * - * Gets the send key name and value for a Hybrid Connection. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listHybridConnectionKeysWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets the send key name and value for a Hybrid Connection. - * - * Gets the send key name and value for a Hybrid Connection. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {HybridConnectionKey} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link HybridConnectionKey} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, optionalCallback); - } - } - - /** - * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listHybridConnectionsWithHttpOperationResponse(resourceGroupName, name, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listHybridConnections(resourceGroupName, name, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {HybridConnection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link HybridConnection} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listHybridConnections(resourceGroupName, name, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listHybridConnections(resourceGroupName, name, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listHybridConnections(resourceGroupName, name, options, optionalCallback); - } - } - - /** - * @summary Gets hybrid connections configured for an app (or deployment slot, - * if specified). - * - * Gets hybrid connections configured for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listRelayServiceConnectionsWithHttpOperationResponse(resourceGroupName, name, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listRelayServiceConnections(resourceGroupName, name, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets hybrid connections configured for an app (or deployment slot, - * if specified). - * - * Gets hybrid connections configured for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {RelayServiceConnectionEntity} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RelayServiceConnectionEntity} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listRelayServiceConnections(resourceGroupName, name, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listRelayServiceConnections(resourceGroupName, name, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listRelayServiceConnections(resourceGroupName, name, options, optionalCallback); - } - } - - /** - * @summary Gets a hybrid connection configuration by its name. - * - * Gets a hybrid connection configuration by its name. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getRelayServiceConnectionWithHttpOperationResponse(resourceGroupName, name, entityName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getRelayServiceConnection(resourceGroupName, name, entityName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets a hybrid connection configuration by its name. - * - * Gets a hybrid connection configuration by its name. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {RelayServiceConnectionEntity} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RelayServiceConnectionEntity} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getRelayServiceConnection(resourceGroupName, name, entityName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getRelayServiceConnection(resourceGroupName, name, entityName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getRelayServiceConnection(resourceGroupName, name, entityName, options, optionalCallback); - } - } - - /** - * @summary Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). - * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {object} connectionEnvelope Details of the hybrid connection - * configuration. - * - * @param {string} [connectionEnvelope.entityName] - * - * @param {string} [connectionEnvelope.entityConnectionString] - * - * @param {string} [connectionEnvelope.resourceType] - * - * @param {string} [connectionEnvelope.resourceConnectionString] - * - * @param {string} [connectionEnvelope.hostname] - * - * @param {number} [connectionEnvelope.port] - * - * @param {string} [connectionEnvelope.biztalkUri] - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - createOrUpdateRelayServiceConnectionWithHttpOperationResponse(resourceGroupName, name, entityName, connectionEnvelope, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). - * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {object} connectionEnvelope Details of the hybrid connection - * configuration. - * - * @param {string} [connectionEnvelope.entityName] - * - * @param {string} [connectionEnvelope.entityConnectionString] - * - * @param {string} [connectionEnvelope.resourceType] - * - * @param {string} [connectionEnvelope.resourceConnectionString] - * - * @param {string} [connectionEnvelope.hostname] - * - * @param {number} [connectionEnvelope.port] - * - * @param {string} [connectionEnvelope.biztalkUri] - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {RelayServiceConnectionEntity} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RelayServiceConnectionEntity} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._createOrUpdateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, optionalCallback); - } - } - - /** - * @summary Deletes a relay service connection by its name. - * - * Deletes a relay service connection by its name. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - deleteRelayServiceConnectionWithHttpOperationResponse(resourceGroupName, name, entityName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteRelayServiceConnection(resourceGroupName, name, entityName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Deletes a relay service connection by its name. - * - * Deletes a relay service connection by its name. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteRelayServiceConnection(resourceGroupName, name, entityName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._deleteRelayServiceConnection(resourceGroupName, name, entityName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteRelayServiceConnection(resourceGroupName, name, entityName, options, optionalCallback); - } - } - - /** - * @summary Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). - * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {object} connectionEnvelope Details of the hybrid connection - * configuration. - * - * @param {string} [connectionEnvelope.entityName] - * - * @param {string} [connectionEnvelope.entityConnectionString] - * - * @param {string} [connectionEnvelope.resourceType] - * - * @param {string} [connectionEnvelope.resourceConnectionString] - * - * @param {string} [connectionEnvelope.hostname] - * - * @param {number} [connectionEnvelope.port] - * - * @param {string} [connectionEnvelope.biztalkUri] - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - updateRelayServiceConnectionWithHttpOperationResponse(resourceGroupName, name, entityName, connectionEnvelope, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). - * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {object} connectionEnvelope Details of the hybrid connection - * configuration. - * - * @param {string} [connectionEnvelope.entityName] - * - * @param {string} [connectionEnvelope.entityConnectionString] - * - * @param {string} [connectionEnvelope.resourceType] - * - * @param {string} [connectionEnvelope.resourceConnectionString] - * - * @param {string} [connectionEnvelope.hostname] - * - * @param {number} [connectionEnvelope.port] - * - * @param {string} [connectionEnvelope.biztalkUri] - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {RelayServiceConnectionEntity} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RelayServiceConnectionEntity} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - updateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._updateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, optionalCallback); - } - } - - /** - * @summary Gets all scale-out instances of an app. - * - * Gets all scale-out instances of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listInstanceIdentifiersWithHttpOperationResponse(resourceGroupName, name, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listInstanceIdentifiers(resourceGroupName, name, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets all scale-out instances of an app. - * - * Gets all scale-out instances of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {WebAppInstanceCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link WebAppInstanceCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listInstanceIdentifiers(resourceGroupName, name, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listInstanceIdentifiers(resourceGroupName, name, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listInstanceIdentifiers(resourceGroupName, name, options, optionalCallback); - } - } - - /** - * @summary Get the status of the last MSDeploy operation. - * - * Get the status of the last MSDeploy operation. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} instanceId ID of web app instance. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getInstanceMsDeployStatusWithHttpOperationResponse(resourceGroupName, name, instanceId, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get the status of the last MSDeploy operation. - * - * Get the status of the last MSDeploy operation. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} instanceId ID of web app instance. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {MSDeployStatus} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MSDeployStatus} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options, optionalCallback); - } - } - - /** - * @summary Invoke the MSDeploy web app extension. - * - * Invoke the MSDeploy web app extension. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} instanceId ID of web app instance. - * - * @param {object} mSDeploy Details of MSDeploy operation - * - * @param {string} [mSDeploy.packageUri] Package URI - * - * @param {string} [mSDeploy.connectionString] SQL Connection String - * - * @param {string} [mSDeploy.dbType] Database Type - * - * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy - * Parameters file. Must not be set if SetParameters is used. - * - * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be - * set if SetParametersXmlFileUri is used. - * - * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy - * operation skips the App_Data directory. - * If set to true, the existing App_Data directory on the - * destination - * will not be deleted, and any App_Data directory in the source will be - * ignored. - * Setting is false by default. - * - * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the - * MSDeploy operation executes. - * Setting is false by default. - * - * @param {string} [mSDeploy.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - createInstanceMSDeployOperationWithHttpOperationResponse(resourceGroupName, name, instanceId, mSDeploy, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Invoke the MSDeploy web app extension. - * - * Invoke the MSDeploy web app extension. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} instanceId ID of web app instance. - * - * @param {object} mSDeploy Details of MSDeploy operation - * - * @param {string} [mSDeploy.packageUri] Package URI - * - * @param {string} [mSDeploy.connectionString] SQL Connection String - * - * @param {string} [mSDeploy.dbType] Database Type - * - * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy - * Parameters file. Must not be set if SetParameters is used. - * - * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be - * set if SetParametersXmlFileUri is used. - * - * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy - * operation skips the App_Data directory. - * If set to true, the existing App_Data directory on the - * destination - * will not be deleted, and any App_Data directory in the source will be - * ignored. - * Setting is false by default. - * - * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the - * MSDeploy operation executes. - * Setting is false by default. - * - * @param {string} [mSDeploy.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {MSDeployStatus} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MSDeployStatus} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - createInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._createInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, optionalCallback); - } - } - - /** - * @summary Get the MSDeploy Log for the last MSDeploy operation. - * - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} instanceId ID of web app instance. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getInstanceMSDeployLogWithHttpOperationResponse(resourceGroupName, name, instanceId, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get the MSDeploy Log for the last MSDeploy operation. - * - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} instanceId ID of web app instance. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {MSDeployLog} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MSDeployLog} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, optionalCallback); - } - } - - /** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. - * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listInstanceProcessesWithHttpOperationResponse(resourceGroupName, name, instanceId, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listInstanceProcesses(resourceGroupName, name, instanceId, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. - * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {ProcessInfoCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessInfoCollection} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listInstanceProcesses(resourceGroupName, name, instanceId, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listInstanceProcesses(resourceGroupName, name, instanceId, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listInstanceProcesses(resourceGroupName, name, instanceId, options, optionalCallback); - } - } - - /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. - * - * Get process information by its ID for a specific scaled-out instance in a - * web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getInstanceProcessWithHttpOperationResponse(resourceGroupName, name, processId, instanceId, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getInstanceProcess(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. - * - * Get process information by its ID for a specific scaled-out instance in a - * web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {ProcessInfo} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessInfo} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getInstanceProcess(resourceGroupName, name, processId, instanceId, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getInstanceProcess(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getInstanceProcess(resourceGroupName, name, processId, instanceId, options, optionalCallback); - } - } - - /** - * @summary Terminate a process by its ID for a web site, or a deployment slot, - * or specific scaled-out instance in a web site. - * - * Terminate a process by its ID for a web site, or a deployment slot, or - * specific scaled-out instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - deleteInstanceProcessWithHttpOperationResponse(resourceGroupName, name, processId, instanceId, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteInstanceProcess(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Terminate a process by its ID for a web site, or a deployment slot, - * or specific scaled-out instance in a web site. - * - * Terminate a process by its ID for a web site, or a deployment slot, or - * specific scaled-out instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteInstanceProcess(resourceGroupName, name, processId, instanceId, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._deleteInstanceProcess(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteInstanceProcess(resourceGroupName, name, processId, instanceId, options, optionalCallback); - } - } - - /** - * @summary Get a memory dump of a process by its ID for a specific scaled-out - * instance in a web site. - * - * Get a memory dump of a process by its ID for a specific scaled-out instance - * in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getInstanceProcessDumpWithHttpOperationResponse(resourceGroupName, name, processId, instanceId, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getInstanceProcessDump(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get a memory dump of a process by its ID for a specific scaled-out - * instance in a web site. - * - * Get a memory dump of a process by its ID for a specific scaled-out instance - * in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {Object} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getInstanceProcessDump(resourceGroupName, name, processId, instanceId, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getInstanceProcessDump(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getInstanceProcessDump(resourceGroupName, name, processId, instanceId, options, optionalCallback); - } - } - - /** - * @summary List module information for a process by its ID for a specific - * scaled-out instance in a web site. - * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listInstanceProcessModulesWithHttpOperationResponse(resourceGroupName, name, processId, instanceId, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listInstanceProcessModules(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary List module information for a process by its ID for a specific - * scaled-out instance in a web site. - * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {ProcessModuleInfoCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessModuleInfoCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listInstanceProcessModules(resourceGroupName, name, processId, instanceId, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listInstanceProcessModules(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listInstanceProcessModules(resourceGroupName, name, processId, instanceId, options, optionalCallback); - } - } - - /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. - * - * Get process information by its ID for a specific scaled-out instance in a - * web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} baseAddress Module base address. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getInstanceProcessModuleWithHttpOperationResponse(resourceGroupName, name, processId, baseAddress, instanceId, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getInstanceProcessModule(resourceGroupName, name, processId, baseAddress, instanceId, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. - * - * Get process information by its ID for a specific scaled-out instance in a - * web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} baseAddress Module base address. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {ProcessModuleInfo} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessModuleInfo} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getInstanceProcessModule(resourceGroupName, name, processId, baseAddress, instanceId, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getInstanceProcessModule(resourceGroupName, name, processId, baseAddress, instanceId, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getInstanceProcessModule(resourceGroupName, name, processId, baseAddress, instanceId, options, optionalCallback); - } - } - - /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. - * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listInstanceProcessThreadsWithHttpOperationResponse(resourceGroupName, name, processId, instanceId, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listInstanceProcessThreads(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. - * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {ProcessThreadInfoCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessThreadInfoCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listInstanceProcessThreads(resourceGroupName, name, processId, instanceId, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listInstanceProcessThreads(resourceGroupName, name, processId, instanceId, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listInstanceProcessThreads(resourceGroupName, name, processId, instanceId, options, optionalCallback); - } - } - - /** - * @summary Get thread information by Thread ID for a specific process, in a - * specific scaled-out instance in a web site. - * - * Get thread information by Thread ID for a specific process, in a specific - * scaled-out instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} threadId TID. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getInstanceProcessThreadWithHttpOperationResponse(resourceGroupName, name, processId, threadId, instanceId, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getInstanceProcessThread(resourceGroupName, name, processId, threadId, instanceId, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get thread information by Thread ID for a specific process, in a - * specific scaled-out instance in a web site. - * - * Get thread information by Thread ID for a specific process, in a specific - * scaled-out instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} threadId TID. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {ProcessThreadInfo} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessThreadInfo} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getInstanceProcessThread(resourceGroupName, name, processId, threadId, instanceId, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getInstanceProcessThread(resourceGroupName, name, processId, threadId, instanceId, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getInstanceProcessThread(resourceGroupName, name, processId, threadId, instanceId, options, optionalCallback); - } - } - - /** - * @summary Shows whether an app can be cloned to another resource group or - * subscription. - * - * Shows whether an app can be cloned to another resource group or - * subscription. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - isCloneableWithHttpOperationResponse(resourceGroupName, name, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._isCloneable(resourceGroupName, name, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Shows whether an app can be cloned to another resource group or - * subscription. - * - * Shows whether an app can be cloned to another resource group or - * subscription. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {SiteCloneability} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SiteCloneability} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - isCloneable(resourceGroupName, name, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._isCloneable(resourceGroupName, name, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._isCloneable(resourceGroupName, name, options, optionalCallback); - } - } - - /** - * @summary This is to allow calling via powershell and ARM template. - * - * This is to allow calling via powershell and ARM template. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listSyncFunctionTriggersWithHttpOperationResponse(resourceGroupName, name, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listSyncFunctionTriggers(resourceGroupName, name, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary This is to allow calling via powershell and ARM template. - * - * This is to allow calling via powershell and ARM template. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {FunctionSecrets} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link FunctionSecrets} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listSyncFunctionTriggers(resourceGroupName, name, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listSyncFunctionTriggers(resourceGroupName, name, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listSyncFunctionTriggers(resourceGroupName, name, options, optionalCallback); - } - } - - /** - * @summary Gets all metric definitions of an app (or deployment slot, if - * specified). - * - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listMetricDefinitionsWithHttpOperationResponse(resourceGroupName, name, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listMetricDefinitions(resourceGroupName, name, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets all metric definitions of an app (or deployment slot, if - * specified). - * - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {ResourceMetricDefinitionCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceMetricDefinitionCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listMetricDefinitions(resourceGroupName, name, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listMetricDefinitions(resourceGroupName, name, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listMetricDefinitions(resourceGroupName, name, options, optionalCallback); - } - } - - /** - * @summary Gets performance metrics of an app (or deployment slot, if - * specified). - * - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.details] Specify "true" to include metric details - * in the response. It is "false" by default. - * - * @param {string} [options.filter] Return only metrics specified in the filter - * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or - * name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime - * eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listMetricsWithHttpOperationResponse(resourceGroupName, name, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listMetrics(resourceGroupName, name, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets performance metrics of an app (or deployment slot, if - * specified). - * - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.details] Specify "true" to include metric details - * in the response. It is "false" by default. - * - * @param {string} [options.filter] Return only metrics specified in the filter - * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or - * name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime - * eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {ResourceMetricCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceMetricCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listMetrics(resourceGroupName, name, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listMetrics(resourceGroupName, name, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listMetrics(resourceGroupName, name, options, optionalCallback); - } - } - - /** - * @summary Restores a web app. - * - * Restores a web app. - * - * @param {string} subscriptionName Azure subscription. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} migrationOptions Migration migrationOptions. - * - * @param {string} migrationOptions.azurefilesConnectionString AzureFiles - * connection string. - * - * @param {string} migrationOptions.azurefilesShare AzureFiles share. - * - * @param {boolean} [migrationOptions.switchSiteAfterMigration] - * trueif the app should be switched over; otherwise, - * false. - * - * @param {boolean} [migrationOptions.blockWriteAccessToSite] true - * if the app should be read only during copy operation; otherwise, - * false. - * - * @param {string} [migrationOptions.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - migrateStorageWithHttpOperationResponse(subscriptionName, resourceGroupName, name, migrationOptions, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._migrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Restores a web app. - * - * Restores a web app. - * - * @param {string} subscriptionName Azure subscription. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} migrationOptions Migration migrationOptions. - * - * @param {string} migrationOptions.azurefilesConnectionString AzureFiles - * connection string. - * - * @param {string} migrationOptions.azurefilesShare AzureFiles share. - * - * @param {boolean} [migrationOptions.switchSiteAfterMigration] - * trueif the app should be switched over; otherwise, - * false. - * - * @param {boolean} [migrationOptions.blockWriteAccessToSite] true - * if the app should be read only during copy operation; otherwise, - * false. - * - * @param {string} [migrationOptions.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {StorageMigrationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link StorageMigrationResponse} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - migrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._migrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._migrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, optionalCallback); - } - } - - /** - * @summary Migrates a local (in-app) MySql database to a remote MySql - * database. - * - * Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} migrationRequestEnvelope MySql migration options. - * - * @param {string} migrationRequestEnvelope.connectionString Connection string - * to the remote MySQL database. - * - * @param {string} migrationRequestEnvelope.migrationType The type of migration - * operation to be done. Possible values include: 'LocalToRemote', - * 'RemoteToLocal' - * - * @param {string} [migrationRequestEnvelope.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - migrateMySqlWithHttpOperationResponse(resourceGroupName, name, migrationRequestEnvelope, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._migrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Migrates a local (in-app) MySql database to a remote MySql - * database. - * - * Migrates a local (in-app) MySql database to a remote MySql database. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} migrationRequestEnvelope MySql migration options. - * - * @param {string} migrationRequestEnvelope.connectionString Connection string - * to the remote MySQL database. - * - * @param {string} migrationRequestEnvelope.migrationType The type of migration - * operation to be done. Possible values include: 'LocalToRemote', - * 'RemoteToLocal' - * - * @param {string} [migrationRequestEnvelope.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {Operation} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Operation} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - migrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._migrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._migrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, optionalCallback); - } - } - - /** - * @summary Returns the status of MySql in app migration, if one is active, and - * whether or not MySql in app is enabled - * - * Returns the status of MySql in app migration, if one is active, and whether - * or not MySql in app is enabled - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getMigrateMySqlStatusWithHttpOperationResponse(resourceGroupName, name, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getMigrateMySqlStatus(resourceGroupName, name, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Returns the status of MySql in app migration, if one is active, and - * whether or not MySql in app is enabled - * - * Returns the status of MySql in app migration, if one is active, and whether - * or not MySql in app is enabled - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {MigrateMySqlStatus} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MigrateMySqlStatus} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getMigrateMySqlStatus(resourceGroupName, name, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getMigrateMySqlStatus(resourceGroupName, name, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getMigrateMySqlStatus(resourceGroupName, name, options, optionalCallback); - } - } - - /** - * @summary Gets all network features used by the app (or deployment slot, if - * specified). - * - * Gets all network features used by the app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} view The type of view. This can either be "summary" or - * "detailed". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listNetworkFeaturesWithHttpOperationResponse(resourceGroupName, name, view, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listNetworkFeatures(resourceGroupName, name, view, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets all network features used by the app (or deployment slot, if - * specified). - * - * Gets all network features used by the app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} view The type of view. This can either be "summary" or - * "detailed". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {NetworkFeatures} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkFeatures} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listNetworkFeatures(resourceGroupName, name, view, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listNetworkFeatures(resourceGroupName, name, view, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listNetworkFeatures(resourceGroupName, name, view, options, optionalCallback); - } - } - - /** - * @summary Start capturing network packets for the site. - * - * Start capturing network packets for the site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.durationInSeconds] The duration to keep capturing - * in seconds. - * - * @param {number} [options.maxFrameLength] The maximum frame length in bytes - * (Optional). - * - * @param {string} [options.sasUrl] The Blob URL to store capture file. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - startWebSiteNetworkTraceWithHttpOperationResponse(resourceGroupName, name, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._startWebSiteNetworkTrace(resourceGroupName, name, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Start capturing network packets for the site. - * - * Start capturing network packets for the site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.durationInSeconds] The duration to keep capturing - * in seconds. - * - * @param {number} [options.maxFrameLength] The maximum frame length in bytes - * (Optional). - * - * @param {string} [options.sasUrl] The Blob URL to store capture file. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {String} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {string} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - startWebSiteNetworkTrace(resourceGroupName, name, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._startWebSiteNetworkTrace(resourceGroupName, name, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._startWebSiteNetworkTrace(resourceGroupName, name, options, optionalCallback); - } - } - - /** - * @summary Stop ongoing capturing network packets for the site. - * - * Stop ongoing capturing network packets for the site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - stopWebSiteNetworkTraceWithHttpOperationResponse(resourceGroupName, name, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._stopWebSiteNetworkTrace(resourceGroupName, name, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Stop ongoing capturing network packets for the site. - * - * Stop ongoing capturing network packets for the site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {String} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {string} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - stopWebSiteNetworkTrace(resourceGroupName, name, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._stopWebSiteNetworkTrace(resourceGroupName, name, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._stopWebSiteNetworkTrace(resourceGroupName, name, options, optionalCallback); - } - } - - /** - * @summary Generates a new publishing password for an app (or deployment slot, - * if specified). - * - * Generates a new publishing password for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - generateNewSitePublishingPasswordWithHttpOperationResponse(resourceGroupName, name, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._generateNewSitePublishingPassword(resourceGroupName, name, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Generates a new publishing password for an app (or deployment slot, - * if specified). - * - * Generates a new publishing password for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - generateNewSitePublishingPassword(resourceGroupName, name, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._generateNewSitePublishingPassword(resourceGroupName, name, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._generateNewSitePublishingPassword(resourceGroupName, name, options, optionalCallback); - } - } - - /** - * @summary Gets perfmon counters for web app. - * - * Gets perfmon counters for web app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] Return only usages/metrics specified in the - * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq - * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain - * eq duration'[Hour|Minute|Day]'. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listPerfMonCountersWithHttpOperationResponse(resourceGroupName, name, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listPerfMonCounters(resourceGroupName, name, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets perfmon counters for web app. - * - * Gets perfmon counters for web app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] Return only usages/metrics specified in the - * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq - * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain - * eq duration'[Hour|Minute|Day]'. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {PerfMonCounterCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PerfMonCounterCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listPerfMonCounters(resourceGroupName, name, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listPerfMonCounters(resourceGroupName, name, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listPerfMonCounters(resourceGroupName, name, options, optionalCallback); - } - } - - /** - * @summary Gets web app's event logs. - * - * Gets web app's event logs. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getSitePhpErrorLogFlagWithHttpOperationResponse(resourceGroupName, name, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getSitePhpErrorLogFlag(resourceGroupName, name, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets web app's event logs. - * - * Gets web app's event logs. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {SitePhpErrorLogFlag} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SitePhpErrorLogFlag} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getSitePhpErrorLogFlag(resourceGroupName, name, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getSitePhpErrorLogFlag(resourceGroupName, name, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getSitePhpErrorLogFlag(resourceGroupName, name, options, optionalCallback); - } - } - - /** - * @summary Gets the premier add-ons of an app. - * - * Gets the premier add-ons of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listPremierAddOnsWithHttpOperationResponse(resourceGroupName, name, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listPremierAddOns(resourceGroupName, name, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets the premier add-ons of an app. - * - * Gets the premier add-ons of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {PremierAddOn} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PremierAddOn} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listPremierAddOns(resourceGroupName, name, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listPremierAddOns(resourceGroupName, name, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listPremierAddOns(resourceGroupName, name, options, optionalCallback); - } - } - - /** - * @summary Gets a named add-on of an app. - * - * Gets a named add-on of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} premierAddOnName Add-on name. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getPremierAddOnWithHttpOperationResponse(resourceGroupName, name, premierAddOnName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getPremierAddOn(resourceGroupName, name, premierAddOnName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets a named add-on of an app. - * - * Gets a named add-on of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} premierAddOnName Add-on name. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {PremierAddOn} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PremierAddOn} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getPremierAddOn(resourceGroupName, name, premierAddOnName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getPremierAddOn(resourceGroupName, name, premierAddOnName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getPremierAddOn(resourceGroupName, name, premierAddOnName, options, optionalCallback); - } - } - - /** - * @summary Updates a named add-on of an app. - * - * Updates a named add-on of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} premierAddOnName Add-on name. - * - * @param {object} premierAddOn A JSON representation of the edited premier - * add-on. - * - * @param {string} [premierAddOn.sku] Premier add on SKU. - * - * @param {string} [premierAddOn.product] Premier add on Product. - * - * @param {string} [premierAddOn.vendor] Premier add on Vendor. - * - * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * - * @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.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * - * @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 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} [options] Optional Parameters. - * - * @param {string} [options.format] Name of the format. Valid values are: - * FileZilla3 - * WebDeploy -- default - * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' - * - * @param {object} [options.customHeaders] Headers 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, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listPublishingProfileXmlWithSecrets(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 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} [options] Optional Parameters. - * - * @param {string} [options.format] Name of the format. Valid values are: - * FileZilla3 - * WebDeploy -- default - * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} 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, options, optionalCallback) { - 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, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listPublishingProfileXmlWithSecrets(resourceGroupName, name, options, optionalCallback); - } - } - - /** - * @summary Recovers a web app to a previous snapshot. - * - * Recovers a web app to a previous snapshot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. - * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - recoverWithHttpOperationResponse(resourceGroupName, name, recoveryEntity, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._recover(resourceGroupName, name, recoveryEntity, 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 a web app to a previous snapshot. - * - * Recovers a web app to a previous snapshot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. - * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. - */ - recover(resourceGroupName, name, recoveryEntity, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._recover(resourceGroupName, name, recoveryEntity, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._recover(resourceGroupName, name, recoveryEntity, 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 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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' - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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' - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * - * @param {object} [options.customHeaders] Headers 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 {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} 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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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 Discovers an existing app backup that can be restored from a blob - * in Azure storage. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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. - */ - discoverRestoreSlotWithHttpOperationResponse(resourceGroupName, name, request, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._discoverRestoreSlot(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. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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. - */ - discoverRestoreSlot(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._discoverRestoreSlot(resourceGroupName, name, request, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._discoverRestoreSlot(resourceGroupName, name, request, 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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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' - * - * @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' - * - * @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 {RestoreResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} for more information. - * - * {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 {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 {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 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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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 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 {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 {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 {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.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 {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 {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 {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.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 {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 {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 {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.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 {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 {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 {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.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. - */ - getWebSiteContainerLogsZipSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getWebSiteContainerLogsZipSlot(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. - */ - getWebSiteContainerLogsZipSlot(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._getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getWebSiteContainerLogsZipSlot(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 {string} [deployment.deploymentId] Identifier for deployment. - * - * @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 {string} [deployment.deploymentId] Identifier for deployment. - * - * @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 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.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.scriptRootPathHref] Script root path URI. - * - * @param {string} [functionEnvelope.scriptHref] Script URI. - * - * @param {string} [functionEnvelope.configHref] Config URI. - * - * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. - * - * @param {string} [functionEnvelope.href] Function URI. - * - * @param {object} [functionEnvelope.config] Config information. - * - * @param {object} [functionEnvelope.files] File list. - * - * @param {string} [functionEnvelope.testData] Test data used when testing via - * the Azure Portal. - * - * @param {string} [functionEnvelope.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {FunctionEnvelope} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link FunctionEnvelope} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - createInstanceFunctionSlot(resourceGroupName, name, functionName, slot, functionEnvelope, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._createInstanceFunctionSlot(resourceGroupName, name, functionName, slot, functionEnvelope, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createInstanceFunctionSlot(resourceGroupName, name, functionName, slot, functionEnvelope, options, optionalCallback); - } - } - - /** - * @summary Delete a function for web site, or a deployment slot. - * - * Delete a function for web site, or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} functionName Function name. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - deleteInstanceFunctionSlotWithHttpOperationResponse(resourceGroupName, name, functionName, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Delete a function for web site, or a deployment slot. - * - * Delete a function for web site, or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} functionName Function name. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, optionalCallback); - } - } - - /** - * @summary Get function secrets for a function in a web site, or a deployment - * slot. - * - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} functionName Function name. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listFunctionSecretsSlotWithHttpOperationResponse(resourceGroupName, name, functionName, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get function secrets for a function in a web site, or a deployment - * slot. - * - * Get function secrets for a function in a web site, or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} functionName Function name. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {FunctionSecrets} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link FunctionSecrets} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, options, optionalCallback); - } - } - - /** - * @summary Get hostname bindings for an app or a deployment slot. - * - * Get hostname bindings for an app or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API gets hostname bindings for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listHostNameBindingsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listHostNameBindingsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get hostname bindings for an app or a deployment slot. - * - * Get hostname bindings for an app or a deployment slot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API gets hostname bindings for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {HostNameBindingCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link HostNameBindingCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listHostNameBindingsSlot(resourceGroupName, name, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listHostNameBindingsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listHostNameBindingsSlot(resourceGroupName, name, slot, options, optionalCallback); - } - } - - /** - * @summary Get the named hostname binding for an app (or deployment slot, if - * specified). - * - * Get the named hostname binding for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API the named binding for the production slot. - * - * @param {string} hostName Hostname in the hostname binding. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getHostNameBindingSlotWithHttpOperationResponse(resourceGroupName, name, slot, hostName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get the named hostname binding for an app (or deployment slot, if - * specified). - * - * Get the named hostname binding for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API the named binding for the production slot. - * - * @param {string} hostName Hostname in the hostname binding. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {HostNameBinding} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link HostNameBinding} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, optionalCallback); - } - } - - /** - * @summary Creates a hostname binding for an app. - * - * Creates a hostname binding for an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} hostName Hostname in the hostname binding. - * - * @param {object} hostNameBinding Binding details. This is the JSON - * representation of a HostNameBinding object. - * - * @param {string} [hostNameBinding.siteName] App Service app name. - * - * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain - * resource URI. - * - * @param {string} [hostNameBinding.azureResourceName] Azure resource name. - * - * @param {string} [hostNameBinding.azureResourceType] Azure resource type. - * Possible values include: 'Website', 'TrafficManager' - * - * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS - * record type. Possible values include: 'CName', 'A' - * - * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible - * values include: 'Verified', 'Managed' - * - * @param {string} [hostNameBinding.sslState] SSL type. Possible values - * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' - * - * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint - * - * @param {string} [hostNameBinding.kind] Kind of resource. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will create a binding for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - createOrUpdateHostNameBindingSlotWithHttpOperationResponse(resourceGroupName, name, hostName, hostNameBinding, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, hostNameBinding, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Creates a hostname binding for an app. - * - * Creates a hostname binding for an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} hostName Hostname in the hostname binding. - * - * @param {object} hostNameBinding Binding details. This is the JSON - * representation of a HostNameBinding object. - * - * @param {string} [hostNameBinding.siteName] App Service app name. - * - * @param {string} [hostNameBinding.domainId] Fully qualified ARM domain - * resource URI. - * - * @param {string} [hostNameBinding.azureResourceName] Azure resource name. - * - * @param {string} [hostNameBinding.azureResourceType] Azure resource type. - * Possible values include: 'Website', 'TrafficManager' - * - * @param {string} [hostNameBinding.customHostNameDnsRecordType] Custom DNS - * record type. Possible values include: 'CName', 'A' - * - * @param {string} [hostNameBinding.hostNameType] Hostname type. Possible - * values include: 'Verified', 'Managed' - * - * @param {string} [hostNameBinding.sslState] SSL type. Possible values - * include: 'Disabled', 'SniEnabled', 'IpBasedEnabled' - * - * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint - * - * @param {string} [hostNameBinding.kind] Kind of resource. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will create a binding for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {HostNameBinding} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link HostNameBinding} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, hostNameBinding, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, hostNameBinding, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, hostNameBinding, slot, options, optionalCallback); - } - } - - /** - * @summary Deletes a hostname binding for an app. - * - * Deletes a hostname binding for an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will delete the binding for the production slot. - * - * @param {string} hostName Hostname in the hostname binding. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - deleteHostNameBindingSlotWithHttpOperationResponse(resourceGroupName, name, slot, hostName, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Deletes a hostname binding for an app. - * - * Deletes a hostname binding for an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will delete the binding for the production slot. - * - * @param {string} hostName Hostname in the hostname binding. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, optionalCallback); - } - } - - /** - * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web - * App. - * - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {string} slot The name of the slot for the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getHybridConnectionSlotWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web - * App. - * - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {string} slot The name of the slot for the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {HybridConnection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link HybridConnection} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, optionalCallback); - } - } - - /** - * @summary Creates a new Hybrid Connection using a Service Bus relay. - * - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} connectionEnvelope The details of the hybrid connection. - * - * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the - * Service Bus namespace. - * - * @param {string} [connectionEnvelope.relayName] The name of the Service Bus - * relay. - * - * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service - * Bus relay. - * - * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. - * - * @param {number} [connectionEnvelope.port] The port of the endpoint. - * - * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus - * key which has Send permissions. This is used to authenticate to Service Bus. - * - * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service - * Bus key. This is used to authenticate to Service Bus. In ARM this key will - * not be returned - * normally, use the POST /listKeys API instead. - * - * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the - * service bus endpoint. By default this is .servicebus.windows.net - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {string} slot The name of the slot for the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - createOrUpdateHybridConnectionSlotWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Creates a new Hybrid Connection using a Service Bus relay. - * - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} connectionEnvelope The details of the hybrid connection. - * - * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the - * Service Bus namespace. - * - * @param {string} [connectionEnvelope.relayName] The name of the Service Bus - * relay. - * - * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service - * Bus relay. - * - * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. - * - * @param {number} [connectionEnvelope.port] The port of the endpoint. - * - * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus - * key which has Send permissions. This is used to authenticate to Service Bus. - * - * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service - * Bus key. This is used to authenticate to Service Bus. In ARM this key will - * not be returned - * normally, use the POST /listKeys API instead. - * - * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the - * service bus endpoint. By default this is .servicebus.windows.net - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {string} slot The name of the slot for the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {HybridConnection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link HybridConnection} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, optionalCallback); - } - } - - /** - * @summary Removes a Hybrid Connection from this site. - * - * Removes a Hybrid Connection from this site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {string} slot The name of the slot for the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - deleteHybridConnectionSlotWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Removes a Hybrid Connection from this site. - * - * Removes a Hybrid Connection from this site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {string} slot The name of the slot for the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, optionalCallback); - } - } - - /** - * @summary Creates a new Hybrid Connection using a Service Bus relay. - * - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} connectionEnvelope The details of the hybrid connection. - * - * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the - * Service Bus namespace. - * - * @param {string} [connectionEnvelope.relayName] The name of the Service Bus - * relay. - * - * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service - * Bus relay. - * - * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. - * - * @param {number} [connectionEnvelope.port] The port of the endpoint. - * - * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus - * key which has Send permissions. This is used to authenticate to Service Bus. - * - * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service - * Bus key. This is used to authenticate to Service Bus. In ARM this key will - * not be returned - * normally, use the POST /listKeys API instead. - * - * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the - * service bus endpoint. By default this is .servicebus.windows.net - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {string} slot The name of the slot for the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - updateHybridConnectionSlotWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Creates a new Hybrid Connection using a Service Bus relay. - * - * Creates a new Hybrid Connection using a Service Bus relay. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {object} connectionEnvelope The details of the hybrid connection. - * - * @param {string} [connectionEnvelope.serviceBusNamespace] The name of the - * Service Bus namespace. - * - * @param {string} [connectionEnvelope.relayName] The name of the Service Bus - * relay. - * - * @param {string} [connectionEnvelope.relayArmUri] The ARM URI to the Service - * Bus relay. - * - * @param {string} [connectionEnvelope.hostname] The hostname of the endpoint. - * - * @param {number} [connectionEnvelope.port] The port of the endpoint. - * - * @param {string} [connectionEnvelope.sendKeyName] The name of the Service Bus - * key which has Send permissions. This is used to authenticate to Service Bus. - * - * @param {string} [connectionEnvelope.sendKeyValue] The value of the Service - * Bus key. This is used to authenticate to Service Bus. In ARM this key will - * not be returned - * normally, use the POST /listKeys API instead. - * - * @param {string} [connectionEnvelope.serviceBusSuffix] The suffix for the - * service bus endpoint. By default this is .servicebus.windows.net - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {string} slot The name of the slot for the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {HybridConnection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link HybridConnection} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - updateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._updateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, optionalCallback); - } - } - - /** - * @summary Gets the send key name and value for a Hybrid Connection. - * - * Gets the send key name and value for a Hybrid Connection. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {string} slot The name of the slot for the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listHybridConnectionKeysSlotWithHttpOperationResponse(resourceGroupName, name, namespaceName, relayName, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, relayName, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets the send key name and value for a Hybrid Connection. - * - * Gets the send key name and value for a Hybrid Connection. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} namespaceName The namespace for this hybrid connection. - * - * @param {string} relayName The relay name for this hybrid connection. - * - * @param {string} slot The name of the slot for the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {HybridConnectionKey} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link HybridConnectionKey} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, relayName, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, relayName, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, relayName, slot, options, optionalCallback); - } - } - - /** - * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} slot The name of the slot for the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listHybridConnectionsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listHybridConnectionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * Retrieves all Service Bus Hybrid Connections used by this Web App. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} slot The name of the slot for the web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {HybridConnection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link HybridConnection} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listHybridConnectionsSlot(resourceGroupName, name, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listHybridConnectionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listHybridConnectionsSlot(resourceGroupName, name, slot, options, optionalCallback); - } - } - - /** - * @summary Gets hybrid connections configured for an app (or deployment slot, - * if specified). - * - * Gets hybrid connections configured for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get hybrid connections for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listRelayServiceConnectionsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets hybrid connections configured for an app (or deployment slot, - * if specified). - * - * Gets hybrid connections configured for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get hybrid connections for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {RelayServiceConnectionEntity} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RelayServiceConnectionEntity} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options, optionalCallback); - } - } - - /** - * @summary Gets a hybrid connection configuration by its name. - * - * Gets a hybrid connection configuration by its name. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get a hybrid connection for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName, name, entityName, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets a hybrid connection configuration by its name. - * - * Gets a hybrid connection configuration by its name. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get a hybrid connection for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {RelayServiceConnectionEntity} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RelayServiceConnectionEntity} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, optionalCallback); - } - } - - /** - * @summary Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). - * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {object} connectionEnvelope Details of the hybrid connection - * configuration. - * - * @param {string} [connectionEnvelope.entityName] - * - * @param {string} [connectionEnvelope.entityConnectionString] - * - * @param {string} [connectionEnvelope.resourceType] - * - * @param {string} [connectionEnvelope.resourceConnectionString] - * - * @param {string} [connectionEnvelope.hostname] - * - * @param {number} [connectionEnvelope.port] - * - * @param {string} [connectionEnvelope.biztalkUri] - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will create or update a hybrid connection for the - * production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - createOrUpdateRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName, name, entityName, connectionEnvelope, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). - * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {object} connectionEnvelope Details of the hybrid connection - * configuration. - * - * @param {string} [connectionEnvelope.entityName] - * - * @param {string} [connectionEnvelope.entityConnectionString] - * - * @param {string} [connectionEnvelope.resourceType] - * - * @param {string} [connectionEnvelope.resourceConnectionString] - * - * @param {string} [connectionEnvelope.hostname] - * - * @param {number} [connectionEnvelope.port] - * - * @param {string} [connectionEnvelope.biztalkUri] - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will create or update a hybrid connection for the - * production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {RelayServiceConnectionEntity} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RelayServiceConnectionEntity} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, optionalCallback); - } - } - - /** - * @summary Deletes a relay service connection by its name. - * - * Deletes a relay service connection by its name. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will delete a hybrid connection for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - deleteRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName, name, entityName, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Deletes a relay service connection by its name. - * - * Deletes a relay service connection by its name. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will delete a hybrid connection for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, optionalCallback); - } - } - - /** - * @summary Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). - * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {object} connectionEnvelope Details of the hybrid connection - * configuration. - * - * @param {string} [connectionEnvelope.entityName] - * - * @param {string} [connectionEnvelope.entityConnectionString] - * - * @param {string} [connectionEnvelope.resourceType] - * - * @param {string} [connectionEnvelope.resourceConnectionString] - * - * @param {string} [connectionEnvelope.hostname] - * - * @param {number} [connectionEnvelope.port] - * - * @param {string} [connectionEnvelope.biztalkUri] - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will create or update a hybrid connection for the - * production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - updateRelayServiceConnectionSlotWithHttpOperationResponse(resourceGroupName, name, entityName, connectionEnvelope, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). - * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} entityName Name of the hybrid connection configuration. - * - * @param {object} connectionEnvelope Details of the hybrid connection - * configuration. - * - * @param {string} [connectionEnvelope.entityName] - * - * @param {string} [connectionEnvelope.entityConnectionString] - * - * @param {string} [connectionEnvelope.resourceType] - * - * @param {string} [connectionEnvelope.resourceConnectionString] - * - * @param {string} [connectionEnvelope.hostname] - * - * @param {number} [connectionEnvelope.port] - * - * @param {string} [connectionEnvelope.biztalkUri] - * - * @param {string} [connectionEnvelope.kind] Kind of resource. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will create or update a hybrid connection for the - * production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {RelayServiceConnectionEntity} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RelayServiceConnectionEntity} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, optionalCallback); - } - } - - /** - * @summary Gets all scale-out instances of an app. - * - * Gets all scale-out instances of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API gets the production slot instances. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listInstanceIdentifiersSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets all scale-out instances of an app. - * - * Gets all scale-out instances of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API gets the production slot instances. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {WebAppInstanceCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link WebAppInstanceCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, optionalCallback); - } - } - - /** - * @summary Get the status of the last MSDeploy operation. - * - * Get the status of the last MSDeploy operation. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. - * - * @param {string} instanceId ID of web app instance. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getInstanceMsDeployStatusSlotWithHttpOperationResponse(resourceGroupName, name, slot, instanceId, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceId, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get the status of the last MSDeploy operation. - * - * Get the status of the last MSDeploy operation. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. - * - * @param {string} instanceId ID of web app instance. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {MSDeployStatus} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MSDeployStatus} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceId, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceId, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceId, options, optionalCallback); - } - } - - /** - * @summary Invoke the MSDeploy web app extension. - * - * Invoke the MSDeploy web app extension. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. - * - * @param {string} instanceId ID of web app instance. - * - * @param {object} mSDeploy Details of MSDeploy operation - * - * @param {string} [mSDeploy.packageUri] Package URI - * - * @param {string} [mSDeploy.connectionString] SQL Connection String - * - * @param {string} [mSDeploy.dbType] Database Type - * - * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy - * Parameters file. Must not be set if SetParameters is used. - * - * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be - * set if SetParametersXmlFileUri is used. - * - * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy - * operation skips the App_Data directory. - * If set to true, the existing App_Data directory on the - * destination - * will not be deleted, and any App_Data directory in the source will be - * ignored. - * Setting is false by default. - * - * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the - * MSDeploy operation executes. - * Setting is false by default. - * - * @param {string} [mSDeploy.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - createInstanceMSDeployOperationSlotWithHttpOperationResponse(resourceGroupName, name, slot, instanceId, mSDeploy, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._createInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Invoke the MSDeploy web app extension. - * - * Invoke the MSDeploy web app extension. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. - * - * @param {string} instanceId ID of web app instance. - * - * @param {object} mSDeploy Details of MSDeploy operation - * - * @param {string} [mSDeploy.packageUri] Package URI - * - * @param {string} [mSDeploy.connectionString] SQL Connection String - * - * @param {string} [mSDeploy.dbType] Database Type - * - * @param {string} [mSDeploy.setParametersXmlFileUri] URI of MSDeploy - * Parameters file. Must not be set if SetParameters is used. - * - * @param {object} [mSDeploy.setParameters] MSDeploy Parameters. Must not be - * set if SetParametersXmlFileUri is used. - * - * @param {boolean} [mSDeploy.skipAppData] Controls whether the MSDeploy - * operation skips the App_Data directory. - * If set to true, the existing App_Data directory on the - * destination - * will not be deleted, and any App_Data directory in the source will be - * ignored. - * Setting is false by default. - * - * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the - * MSDeploy operation executes. - * Setting is false by default. - * - * @param {string} [mSDeploy.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {MSDeployStatus} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MSDeployStatus} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - createInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._createInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._createInstanceMSDeployOperationSlot(resourceGroupName, name, slot, instanceId, mSDeploy, options, optionalCallback); - } - } - - /** - * @summary Get the MSDeploy Log for the last MSDeploy operation. - * - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. - * - * @param {string} instanceId ID of web app instance. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getInstanceMSDeployLogSlotWithHttpOperationResponse(resourceGroupName, name, slot, instanceId, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get the MSDeploy Log for the last MSDeploy operation. - * - * Get the MSDeploy Log for the last MSDeploy operation. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. - * - * @param {string} instanceId ID of web app instance. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {MSDeployLog} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MSDeployLog} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, options, optionalCallback); - } - } - - /** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. - * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listInstanceProcessesSlotWithHttpOperationResponse(resourceGroupName, name, slot, instanceId, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. - * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {ProcessInfoCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessInfoCollection} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, options, optionalCallback); - } - } - - /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. - * - * Get process information by its ID for a specific scaled-out instance in a - * web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getInstanceProcessSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, instanceId, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. - * - * Get process information by its ID for a specific scaled-out instance in a - * web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {ProcessInfo} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessInfo} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback); - } - } - - /** - * @summary Terminate a process by its ID for a web site, or a deployment slot, - * or specific scaled-out instance in a web site. - * - * Terminate a process by its ID for a web site, or a deployment slot, or - * specific scaled-out instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - deleteInstanceProcessSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, instanceId, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Terminate a process by its ID for a web site, or a deployment slot, - * or specific scaled-out instance in a web site. - * - * Terminate a process by its ID for a web site, or a deployment slot, or - * specific scaled-out instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback); - } - } - - /** - * @summary Get a memory dump of a process by its ID for a specific scaled-out - * instance in a web site. - * - * Get a memory dump of a process by its ID for a specific scaled-out instance - * in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getInstanceProcessDumpSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, instanceId, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get a memory dump of a process by its ID for a specific scaled-out - * instance in a web site. - * - * Get a memory dump of a process by its ID for a specific scaled-out instance - * in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {Object} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback); - } - } - - /** - * @summary List module information for a process by its ID for a specific - * scaled-out instance in a web site. - * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listInstanceProcessModulesSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, instanceId, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary List module information for a process by its ID for a specific - * scaled-out instance in a web site. - * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {ProcessModuleInfoCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessModuleInfoCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback); - } - } - - /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. - * - * Get process information by its ID for a specific scaled-out instance in a - * web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} baseAddress Module base address. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getInstanceProcessModuleSlotWithHttpOperationResponse(resourceGroupName, name, processId, baseAddress, slot, instanceId, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. - * - * Get process information by its ID for a specific scaled-out instance in a - * web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} baseAddress Module base address. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {ProcessModuleInfo} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessModuleInfo} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, optionalCallback); - } - } - - /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. - * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listInstanceProcessThreadsSlotWithHttpOperationResponse(resourceGroupName, name, processId, slot, instanceId, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. - * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {ProcessThreadInfoCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessThreadInfoCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, optionalCallback); - } - } - - /** - * @summary Get thread information by Thread ID for a specific process, in a - * specific scaled-out instance in a web site. - * - * Get thread information by Thread ID for a specific process, in a specific - * scaled-out instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} threadId TID. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getInstanceProcessThreadSlotWithHttpOperationResponse(resourceGroupName, name, processId, threadId, slot, instanceId, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Get thread information by Thread ID for a specific process, in a - * specific scaled-out instance in a web site. - * - * Get thread information by Thread ID for a specific process, in a specific - * scaled-out instance in a web site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Site name. - * - * @param {string} processId PID. - * - * @param {string} threadId TID. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. - * - * @param {string} instanceId ID of a specific scaled-out instance. This is the - * value of the name property in the JSON response from "GET - * api/sites/{siteName}/instances". - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {ProcessThreadInfo} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ProcessThreadInfo} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, optionalCallback); - } - } - - /** - * @summary Shows whether an app can be cloned to another resource group or - * subscription. - * - * Shows whether an app can be cloned to another resource group or - * subscription. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. By default, this API - * returns information on the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - isCloneableSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._isCloneableSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Shows whether an app can be cloned to another resource group or - * subscription. - * - * Shows whether an app can be cloned to another resource group or - * subscription. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. By default, this API - * returns information on the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {SiteCloneability} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SiteCloneability} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - isCloneableSlot(resourceGroupName, name, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._isCloneableSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._isCloneableSlot(resourceGroupName, name, slot, options, optionalCallback); - } - } - - /** - * @summary This is to allow calling via powershell and ARM template. - * - * This is to allow calling via powershell and ARM template. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will restore a backup of the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listSyncFunctionTriggersSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary This is to allow calling via powershell and ARM template. - * - * This is to allow calling via powershell and ARM template. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will restore a backup of the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {FunctionSecrets} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link FunctionSecrets} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, optionalCallback); - } - } - - /** - * @summary Gets all metric definitions of an app (or deployment slot, if - * specified). - * - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get metric definitions of the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listMetricDefinitionsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listMetricDefinitionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets all metric definitions of an app (or deployment slot, if - * specified). - * - * Gets all metric definitions of an app (or deployment slot, if specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get metric definitions of the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {ResourceMetricDefinitionCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceMetricDefinitionCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listMetricDefinitionsSlot(resourceGroupName, name, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listMetricDefinitionsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listMetricDefinitionsSlot(resourceGroupName, name, slot, options, optionalCallback); - } - } - - /** - * @summary Gets performance metrics of an app (or deployment slot, if - * specified). - * - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get metrics of the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.details] Specify "true" to include metric details - * in the response. It is "false" by default. - * - * @param {string} [options.filter] Return only metrics specified in the filter - * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or - * name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime - * eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listMetricsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listMetricsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets performance metrics of an app (or deployment slot, if - * specified). - * - * Gets performance metrics of an app (or deployment slot, if specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get metrics of the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {boolean} [options.details] Specify "true" to include metric details - * in the response. It is "false" by default. - * - * @param {string} [options.filter] Return only metrics specified in the filter - * (using OData syntax). For example: $filter=(name.value eq 'Metric1' or - * name.value eq 'Metric2') and startTime eq '2014-01-01T00:00:00Z' and endTime - * eq '2014-12-31T23:59:59Z' and timeGrain eq duration'[Hour|Minute|Day]'. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {ResourceMetricCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link ResourceMetricCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listMetricsSlot(resourceGroupName, name, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listMetricsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listMetricsSlot(resourceGroupName, name, slot, options, optionalCallback); - } - } - - /** - * @summary Returns the status of MySql in app migration, if one is active, and - * whether or not MySql in app is enabled - * - * Returns the status of MySql in app migration, if one is active, and whether - * or not MySql in app is enabled - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} slot Name of the deployment slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getMigrateMySqlStatusSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Returns the status of MySql in app migration, if one is active, and - * whether or not MySql in app is enabled - * - * Returns the status of MySql in app migration, if one is active, and whether - * or not MySql in app is enabled - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} slot Name of the deployment slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {MigrateMySqlStatus} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link MigrateMySqlStatus} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, optionalCallback); - } - } - - /** - * @summary Gets all network features used by the app (or deployment slot, if - * specified). - * - * Gets all network features used by the app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} view The type of view. This can either be "summary" or - * "detailed". - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get network features for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listNetworkFeaturesSlotWithHttpOperationResponse(resourceGroupName, name, view, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets all network features used by the app (or deployment slot, if - * specified). - * - * Gets all network features used by the app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} view The type of view. This can either be "summary" or - * "detailed". - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get network features for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {NetworkFeatures} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link NetworkFeatures} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, optionalCallback); - } - } - - /** - * @summary Start capturing network packets for the site. - * - * Start capturing network packets for the site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} slot The name of the slot for this web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.durationInSeconds] The duration to keep capturing - * in seconds. - * - * @param {number} [options.maxFrameLength] The maximum frame length in bytes - * (Optional). - * - * @param {string} [options.sasUrl] The Blob URL to store capture file. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - startWebSiteNetworkTraceSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Start capturing network packets for the site. - * - * Start capturing network packets for the site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} slot The name of the slot for this web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {number} [options.durationInSeconds] The duration to keep capturing - * in seconds. - * - * @param {number} [options.maxFrameLength] The maximum frame length in bytes - * (Optional). - * - * @param {string} [options.sasUrl] The Blob URL to store capture file. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {String} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {string} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, optionalCallback); - } - } - - /** - * @summary Stop ongoing capturing network packets for the site. - * - * Stop ongoing capturing network packets for the site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} slot The name of the slot for this web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - stopWebSiteNetworkTraceSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Stop ongoing capturing network packets for the site. - * - * Stop ongoing capturing network packets for the site. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name The name of the web app. - * - * @param {string} slot The name of the slot for this web app. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {String} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {string} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, optionalCallback); - } - } - - /** - * @summary Generates a new publishing password for an app (or deployment slot, - * if specified). - * - * Generates a new publishing password for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API generate a new publishing password for the production - * slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - generateNewSitePublishingPasswordSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Generates a new publishing password for an app (or deployment slot, - * if specified). - * - * Generates a new publishing password for an app (or deployment slot, if - * specified). - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API generate a new publishing password for the production - * slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {null} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, optionalCallback); - } - } - - /** - * @summary Gets perfmon counters for web app. - * - * Gets perfmon counters for web app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] Return only usages/metrics specified in the - * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq - * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain - * eq duration'[Hour|Minute|Day]'. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listPerfMonCountersSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listPerfMonCountersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets perfmon counters for web app. - * - * Gets perfmon counters for web app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.filter] Return only usages/metrics specified in the - * filter. Filter conforms to odata syntax. Example: $filter=(startTime eq - * '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' and timeGrain - * eq duration'[Hour|Minute|Day]'. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {PerfMonCounterCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PerfMonCounterCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listPerfMonCountersSlot(resourceGroupName, name, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listPerfMonCountersSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listPerfMonCountersSlot(resourceGroupName, name, slot, options, optionalCallback); - } - } - - /** - * @summary Gets web app's event logs. - * - * Gets web app's event logs. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getSitePhpErrorLogFlagSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets web app's event logs. - * - * Gets web app's event logs. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {SitePhpErrorLogFlag} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link SitePhpErrorLogFlag} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, optionalCallback); - } - } - - /** - * @summary Gets the premier add-ons of an app. - * - * Gets the premier add-ons of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get the premier add-ons for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listPremierAddOnsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listPremierAddOnsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets the premier add-ons of an app. - * - * Gets the premier add-ons of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get the premier add-ons for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {PremierAddOn} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PremierAddOn} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listPremierAddOnsSlot(resourceGroupName, name, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listPremierAddOnsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listPremierAddOnsSlot(resourceGroupName, name, slot, options, optionalCallback); - } - } - - /** - * @summary Gets a named add-on of an app. - * - * Gets a named add-on of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} premierAddOnName Add-on name. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get the named add-on for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getPremierAddOnSlotWithHttpOperationResponse(resourceGroupName, name, premierAddOnName, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets a named add-on of an app. - * - * Gets a named add-on of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} premierAddOnName Add-on name. - * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will get the named add-on for the production slot. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {PremierAddOn} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link PremierAddOn} for more information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, optionalCallback); - } - } - - /** - * @summary Updates a named add-on of an app. - * - * Updates a named add-on of an app. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of the app. - * - * @param {string} premierAddOnName Add-on name. - * - * @param {object} premierAddOn A JSON representation of the edited premier - * add-on. - * - * @param {string} [premierAddOn.sku] Premier add on SKU. - * - * @param {string} [premierAddOn.product] Premier add on Product. - * - * @param {string} [premierAddOn.vendor] Premier add on Vendor. - * - * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * - * @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.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * - * @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 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 {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 {string} [options.format] Name of the format. Valid values are: - * FileZilla3 - * WebDeploy -- default - * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' - * - * @param {object} [options.customHeaders] Headers 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, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listPublishingProfileXmlWithSecretsSlot(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 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 {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 {string} [options.format] Name of the format. Valid values are: - * FileZilla3 - * WebDeploy -- default - * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} 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, slot, options, optionalCallback) { - 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, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, options, optionalCallback); - } - } - - /** - * @summary Recovers a web app to a previous snapshot. - * - * Recovers a web app to a previous snapshot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. - * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. - */ - recoverSlotWithHttpOperationResponse(resourceGroupName, name, recoveryEntity, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._recoverSlot(resourceGroupName, name, recoveryEntity, slot, 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 a web app to a previous snapshot. - * - * Recovers a web app to a previous snapshot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. - * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. - */ - recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._recoverSlot(resourceGroupName, name, recoveryEntity, 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 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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' - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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' - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} 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' - * - * @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' - * - * @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 {RestoreResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} for more information. - * - * {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.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.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 Recovers a web app to a previous snapshot. - * - * Recovers a web app to a previous snapshot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. - * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - beginRecoverWithHttpOperationResponse(resourceGroupName, name, recoveryEntity, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginRecover(resourceGroupName, name, recoveryEntity, 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 a web app to a previous snapshot. - * - * Recovers a web app to a previous snapshot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. - * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. - */ - beginRecover(resourceGroupName, name, recoveryEntity, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._beginRecover(resourceGroupName, name, recoveryEntity, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginRecover(resourceGroupName, name, recoveryEntity, 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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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' - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @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 {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 {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 {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 {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 {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.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * - * @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' - * - * @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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} 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' - * - * @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' - * - * @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 {RestoreResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} for more information. - * - * {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.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.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 Recovers a web app to a previous snapshot. - * - * Recovers a web app to a previous snapshot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. - * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. - */ - beginRecoverSlotWithHttpOperationResponse(resourceGroupName, name, recoveryEntity, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, 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 a web app to a previous snapshot. - * - * Recovers a web app to a previous snapshot. - * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @param {string} name Name of web app. - * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. - * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.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. - */ - beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._beginRecoverSlot(resourceGroupName, name, recoveryEntity, 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/lib/webSiteManagementClient.d.ts b/lib/services/websiteManagement2/lib/lib/webSiteManagementClient.d.ts deleted file mode 100644 index 0016cb7d6d..0000000000 --- a/lib/services/websiteManagement2/lib/lib/webSiteManagementClient.d.ts +++ /dev/null @@ -1,1381 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -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] - 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. - * - */ - constructor(credentials: ServiceClientCredentials, subscriptionId: string, baseUri?: string, options?: AzureServiceClientOptions); - - credentials: ServiceClientCredentials; - - subscriptionId: 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; - resourceHealthMetadataOperations: operations.ResourceHealthMetadataOperations; - billingMeters: operations.BillingMeters; - webApps: operations.WebApps; - appServiceEnvironments: operations.AppServiceEnvironments; - appServicePlans: operations.AppServicePlans; - - - /** - * @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.userName] Username - * - * @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.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that 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.userName] Username - * - * @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.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.sourceControlName] Name or source control - * type. - * - * @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.sourceControlName] Name or source control - * type. - * - * @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 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', - * 'PremiumV2', 'Dynamic', 'Isolated' - * - * @param {boolean} [options.linuxWorkersEnabled] Specify true if - * you want to filter to only regions that support Linux 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, 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', - * 'PremiumV2', 'Dynamic', 'Isolated' - * - * @param {boolean} [options.linuxWorkersEnabled] Specify true if - * you want to filter to only regions that support Linux 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, customHeaders? : { [headerName: string]: string; } }): Promise; - listGeoRegions(callback: ServiceCallback): void; - listGeoRegions(options: { sku? : string, linuxWorkersEnabled? : 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 {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that 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 {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {ServiceCallback} [optionalCallback] - The optional callback. - * - * @returns {ServiceCallback|Promise} 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 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/lib/webSiteManagementClient.js b/lib/services/websiteManagement2/lib/lib/webSiteManagementClient.js deleted file mode 100644 index beb4798477..0000000000 --- a/lib/services/websiteManagement2/lib/lib/webSiteManagementClient.js +++ /dev/null @@ -1,4748 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -/* 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.'); - } - let apiVersion = '2016-03-01'; - // Validate - try { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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.userName] Username - * - * @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.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.'); - } - let apiVersion = '2016-03-01'; - // Validate - try { - if (userDetails === null || userDetails === undefined) { - throw new Error('userDetails 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.Web/publishingUsers/web'; - 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.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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-01'; - // Validate - try { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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.'); - } - let apiVersion = '2016-03-01'; - // 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.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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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.sourceControlName] Name or source control - * type. - * - * @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.'); - } - let apiVersion = '2016-03-01'; - // 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.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(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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 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; - let apiVersion = '2016-03-01'; - // 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 (name === 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-01'; - // 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.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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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', - * 'PremiumV2', 'Dynamic', 'Isolated' - * - * @param {boolean} [options.linuxWorkersEnabled] Specify true if - * you want to filter to only regions that support Linux 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 apiVersion = '2016-03-01'; - // 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 (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.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())); - } - 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.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['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; - let apiVersion = '2016-03-01'; - // 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 (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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-01'; - // 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.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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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.'); - } - let apiVersion = '2016-03-01'; - // 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.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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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['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.'); - } - let apiVersion = '2016-03-01'; - // 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.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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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 {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} 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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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] - 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. - */ - 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.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.resourceHealthMetadataOperations = new operations.ResourceHealthMetadataOperations(this); - this.billingMeters = new operations.BillingMeters(this); - this.webApps = new operations.WebApps(this); - this.appServiceEnvironments = new operations.AppServiceEnvironments(this); - this.appServicePlans = new operations.AppServicePlans(this); - this.models = models; - this._getPublishingUser = _getPublishingUser; - this._updatePublishingUser = _updatePublishingUser; - this._listSourceControls = _listSourceControls; - this._getSourceControl = _getSourceControl; - this._updateSourceControl = _updateSourceControl; - 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._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.userName] Username - * - * @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.kind] Kind of resource. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers 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.userName] Username - * - * @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.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.sourceControlName] Name or source control - * type. - * - * @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.sourceControlName] Name or source control - * type. - * - * @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 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', - * 'PremiumV2', 'Dynamic', 'Isolated' - * - * @param {boolean} [options.linuxWorkersEnabled] Specify true if - * you want to filter to only regions that support Linux 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', - * 'PremiumV2', 'Dynamic', 'Isolated' - * - * @param {boolean} [options.linuxWorkersEnabled] Specify true if - * you want to filter to only regions that support Linux 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 {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers 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 {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} 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 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/lib/package.json b/lib/services/websiteManagement2/lib/package.json deleted file mode 100644 index 7cc436fe61..0000000000 --- a/lib/services/websiteManagement2/lib/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "azure-arm-website", - "author": "Microsoft Corporation", - "description": "WebSiteManagementClient Library with typescript type definitions for node", - "version": "", - "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": "http://github.com/azure/azure-sdk-for-node", - "repository": { - "type": "git", - "url": "https://github.com/azure/azure-sdk-for-node.git" - }, - "bugs": { - "url": "http://github.com/Azure/azure-sdk-for-node/issues" - } -} diff --git a/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts b/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts index 981bca0184..6227b53ace 100644 --- a/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts +++ b/lib/services/websiteManagement2/lib/webSiteManagementClient.d.ts @@ -34,11 +34,11 @@ export default class WebSiteManagementClient 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/websiteManagement2/lib/webSiteManagementClient.js b/lib/services/websiteManagement2/lib/webSiteManagementClient.js index 50a4849d43..b02aa8611e 100644 --- a/lib/services/websiteManagement2/lib/webSiteManagementClient.js +++ b/lib/services/websiteManagement2/lib/webSiteManagementClient.js @@ -3189,9 +3189,9 @@ class WebSiteManagementClient extends ServiceClient { * @param {object} [options.requestOptions] - Options for the underlying request object * {@link https://github.com/request/request#requestoptions-callback Options doc} * @param {boolean} [options.noRetryPolicy] - If set to true, turn off default retry policy - * @param {string} [options.acceptLanguage] - Gets or sets the preferred language for the response. - * @param {number} [options.longRunningOperationRetryTimeout] - Gets or sets the retry timeout in seconds for Long Running Operations. Default value is 30. - * @param {boolean} [options.generateClientRequestId] - When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. + * @param {string} [options.acceptLanguage] - The preferred language for the response. + * @param {number} [options.longRunningOperationRetryTimeout] - The retry timeout in seconds for Long Running Operations. Default value is 30. + * @param {boolean} [options.generateClientRequestId] - Whether a unique x-ms-client-request-id should be generated. When set to true a unique x-ms-client-request-id value is generated and included in each request. Default is true. */ constructor(credentials, subscriptionId, baseUri, options) { if (credentials === null || credentials === undefined) { diff --git a/lib/services/websiteManagement2/package.json b/lib/services/websiteManagement2/package.json index 3f43208d97..1334d7fee4 100644 --- a/lib/services/websiteManagement2/package.json +++ b/lib/services/websiteManagement2/package.json @@ -2,7 +2,7 @@ "name": "azure-arm-website", "author": "Microsoft Corporation", "description": "WebSiteManagementClient Library with typescript type definitions for node", - "version": "3.0.0-preview", + "version": "4.0.0", "dependencies": { "ms-rest": "^2.3.3", "ms-rest-azure": "^2.5.5" @@ -14,12 +14,12 @@ "license": "MIT", "main": "./lib/webSiteManagementClient.js", "types": "./lib/webSiteManagementClient.d.ts", - "homepage": "http://github.com/azure/azure-sdk-for-node", + "homepage": "https://github.com/azure/azure-sdk-for-node/lib/services/websiteManagement2", "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" } } From 2c2e3e61bf57ac91dd42810605ba17d0d5eb3259 Mon Sep 17 00:00:00 2001 From: Dan Schulte Date: Wed, 25 Jul 2018 08:08:17 -0700 Subject: [PATCH 9/9] Regenerate azure-arm-website --- lib/services/webSiteManagement2/LICENSE.txt | 4 +- lib/services/webSiteManagement2/README.md | 48 +- .../lib/models/appServiceEnvironment.js | 27 + .../appServiceEnvironmentPatchResource.js | 27 + .../models/appServiceEnvironmentResource.js | 27 + .../lib/models/appServicePlan.js | 27 +- .../lib/models/appServicePlanCollection.js | 1 + .../lib/models/appServicePlanPatchResource.js | 28 +- .../lib/models/applicationStack.js | 103 + .../lib/models/applicationStackCollection.js} | 20 +- .../lib/models/backupRequest.js | 18 - .../lib/models/billingMeter.js | 129 + .../lib/models/billingMeterCollection.js | 68 + .../lib/models/certificate.js | 9 - .../lib/models/certificateOrderAction.js | 10 +- .../lib/models/certificatePatchResource.js | 9 - .../lib/models/cloningInfo.js | 9 - .../lib/models/continuousWebJob.js | 26 +- .../lib/models/continuousWebJobCollection.js | 1 + .../lib/models/csmOperationDescription.js | 1 + .../csmOperationDescriptionProperties.js | 1 + .../lib/models/dataTableResponseColumn.js | 69 + .../lib/models/dataTableResponseObject.js | 92 + .../lib/models/defaultErrorResponse.js | 64 + .../lib/models/defaultErrorResponseError.js | 101 + .../defaultErrorResponseErrorDetailsItem.js | 74 + .../lib/models/deletedAppRestoreRequest.js | 108 + .../lib/models/deletedSite.js | 13 +- .../lib/models/deployment.js | 14 +- .../lib/models/detectorInfo.js} | 50 +- .../lib/models/detectorResponse.js | 109 + .../lib/models/detectorResponseCollection.js | 68 + .../lib/models/diagnosticData.js | 73 + .../lib/models/functionEnvelope.js | 22 +- .../lib/models/functionSecrets.js | 2 +- .../lib/models/geoRegion.js | 9 - .../lib/models/handlerMapping.js | 6 +- .../webSiteManagement2/lib/models/index.d.ts | 1072 +- .../webSiteManagement2/lib/models/index.js | 35 +- .../lib/models/ipSecurityRestriction.js | 46 + .../lib/models/logSpecification.js | 68 + .../lib/models/managedServiceIdentity.js | 21 +- .../lib/models/metricDefinition.js | 9 - .../lib/models/perfMonSample.js | 8 - .../lib/models/premierAddOn.js | 31 - .../lib/models/premierAddOnOffer.js | 8 - .../lib/models/premierAddOnPatchResource.js | 120 + .../{restoreResponse.js => privateAccess.js} | 43 +- .../lib/models/privateAccessSubnet.js} | 32 +- .../lib/models/privateAccessVirtualNetwork.js | 88 + .../lib/models/processInfo.js | 125 +- .../lib/models/processModuleInfo.js | 16 +- .../lib/models/processThreadInfo.js | 25 +- .../lib/models/recommendation.js | 111 +- .../lib/models/recommendationCollection.js | 68 + .../lib/models/recommendationRule.js | 69 +- .../lib/models/rendering.js | 71 + .../lib/models/resourceMetricDefinition.js | 22 - .../lib/models/restoreRequest.js | 5 +- .../lib/models/serviceSpecification.js | 16 + .../webSiteManagement2/lib/models/site.js | 63 +- .../lib/models/siteAuthSettings.js | 9 + .../lib/models/siteConfig.js | 67 + .../lib/models/siteConfigResource.js | 67 + .../models/siteConfigurationSnapshotInfo.js | 6 +- .../lib/models/siteExtensionInfo.js | 43 +- .../lib/models/siteInstance.js | 2 +- .../lib/models/sitePatchResource.js | 58 +- .../lib/models/slotDifference.js | 8 +- .../lib/models/snapshotRecoveryRequest.js | 133 - .../lib/models/snapshotRecoverySource.js} | 20 +- .../lib/models/snapshotRecoveryTarget.js | 65 - .../lib/models/snapshotRestoreRequest.js} | 39 +- .../lib/models/sourceControl.js | 8 - .../lib/models/stackMajorVersion.js | 90 + .../lib/models/stackMinorVersion.js | 71 + .../lib/models/stampCapacity.js | 12 +- .../lib/models/swiftVirtualNetwork.js} | 34 +- .../lib/models/topLevelDomain.js | 9 - .../lib/models/triggeredJobHistory.js | 6 +- .../lib/models/triggeredJobRun.js | 23 +- .../lib/models/triggeredWebJob.js | 32 +- .../webSiteManagement2/lib/models/usage.js | 9 - .../webSiteManagement2/lib/models/user.js | 16 +- .../lib/models/validateRequest.js | 9 + .../lib/models/vnetRoute.js | 9 - .../webSiteManagement2/lib/models/webJob.js | 22 +- .../operations/appServiceCertificateOrders.js | 255 +- .../lib/operations/appServiceEnvironments.js | 1837 +- .../lib/operations/appServicePlans.js | 516 +- .../certificateRegistrationProvider.js | 24 +- .../lib/operations/certificates.js | 99 +- .../lib/operations/deletedWebApps.js | 24 +- .../lib/operations/diagnostics.js | 3720 +- .../operations/domainRegistrationProvider.js | 24 +- .../lib/operations/domains.js | 464 +- .../lib/operations/index.d.ts | 7427 +++- .../lib/operations/provider.js | 560 +- .../lib/operations/recommendations.js | 1705 +- .../lib/operations/topLevelDomains.js | 63 +- .../lib/operations/webApps.js | 36814 +++++++++------- .../lib/webSiteManagementClient.d.ts | 176 +- .../lib/webSiteManagementClient.js | 776 +- .../webSiteManagement2/package-lock.json | 233 +- lib/services/webSiteManagement2/package.json | 32 +- .../lib/operations/billingMeters.js | 483 - .../lib/operations/global.js | 257 - .../resourceHealthMetadataOperations.js | 2470 -- lib/services/websiteManagement2/package.json | 2 +- 109 files changed, 39145 insertions(+), 23322 deletions(-) create mode 100644 lib/services/webSiteManagement2/lib/models/applicationStack.js rename lib/services/{websiteManagement2/lib/models/resourceHealthMetadataCollection.js => webSiteManagement2/lib/models/applicationStackCollection.js} (66%) 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/dataTableResponseColumn.js create mode 100644 lib/services/webSiteManagement2/lib/models/dataTableResponseObject.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 rename lib/services/{websiteManagement2/lib/models/restoreResponse.js => webSiteManagement2/lib/models/detectorInfo.js} (52%) 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/diagnosticData.js create mode 100644 lib/services/webSiteManagement2/lib/models/logSpecification.js create mode 100644 lib/services/webSiteManagement2/lib/models/premierAddOnPatchResource.js rename lib/services/webSiteManagement2/lib/models/{restoreResponse.js => privateAccess.js} (55%) rename lib/services/{websiteManagement2/lib/models/errorResponse.js => webSiteManagement2/lib/models/privateAccessSubnet.js} (53%) create mode 100644 lib/services/webSiteManagement2/lib/models/privateAccessVirtualNetwork.js create mode 100644 lib/services/webSiteManagement2/lib/models/recommendationCollection.js create mode 100644 lib/services/webSiteManagement2/lib/models/rendering.js delete mode 100644 lib/services/webSiteManagement2/lib/models/snapshotRecoveryRequest.js rename lib/services/{websiteManagement2/lib/models/snapshotRecoveryTarget.js => webSiteManagement2/lib/models/snapshotRecoverySource.js} (69%) delete mode 100644 lib/services/webSiteManagement2/lib/models/snapshotRecoveryTarget.js rename lib/services/{websiteManagement2/lib/models/snapshotRecoveryRequest.js => webSiteManagement2/lib/models/snapshotRestoreRequest.js} (73%) create mode 100644 lib/services/webSiteManagement2/lib/models/stackMajorVersion.js create mode 100644 lib/services/webSiteManagement2/lib/models/stackMinorVersion.js rename lib/services/{websiteManagement2/lib/models/resourceHealthMetadata.js => webSiteManagement2/lib/models/swiftVirtualNetwork.js} (61%) delete mode 100644 lib/services/websiteManagement2/lib/operations/billingMeters.js delete mode 100644 lib/services/websiteManagement2/lib/operations/global.js delete mode 100644 lib/services/websiteManagement2/lib/operations/resourceHealthMetadataOperations.js diff --git a/lib/services/webSiteManagement2/LICENSE.txt b/lib/services/webSiteManagement2/LICENSE.txt index 0313a903d7..a70e8cf660 100644 --- a/lib/services/webSiteManagement2/LICENSE.txt +++ b/lib/services/webSiteManagement2/LICENSE.txt @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2017 Microsoft +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 @@ -18,4 +18,4 @@ 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 +SOFTWARE. diff --git a/lib/services/webSiteManagement2/README.md b/lib/services/webSiteManagement2/README.md index da57137292..dd95909622 100644 --- a/lib/services/webSiteManagement2/README.md +++ b/lib/services/webSiteManagement2/README.md @@ -1,11 +1,14 @@ -# Microsoft Azure SDK for Node.js - Web Site Management +--- +uid: azure-arm-website +summary: *content -This project provides a Node.js package that makes it easy to manage Microsoft Azure Web Site. Right now it supports: -- **Node.js version: 6.x.x or higher** +--- +# 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 - - TODO ## How to Install @@ -13,24 +16,25 @@ This project provides a Node.js package that makes it easy to manage Microsoft A npm install azure-arm-website ``` -## How to Use - -### Authentication, client creation and listing serverFarms in a resource group as an example - - ```javascript - const msRestAzure = require('ms-rest-azure'); - const webSiteManagementClient = require('azure-arm-website'); - - // Interactive Login - msRestAzure.interactiveLogin(function(err, credentials) { - let client = new webSiteManagementClient(credentials, 'your-subscription-id'); - client.webApps.list(function(err, result) { - if (err) return console.log(err); - return console.log(result); - }); - }); - ``` +## 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 - All-up](https://github.com/WindowsAzure/azure-sdk-for-node) +- [Microsoft Azure SDK for Node.js](https://github.com/Azure/azure-sdk-for-node) diff --git a/lib/services/webSiteManagement2/lib/models/appServiceEnvironment.js b/lib/services/webSiteManagement2/lib/models/appServiceEnvironment.js index af47066e3f..f700716e96 100644 --- a/lib/services/webSiteManagement2/lib/models/appServiceEnvironment.js +++ b/lib/services/webSiteManagement2/lib/models/appServiceEnvironment.js @@ -97,6 +97,12 @@ class AppServiceEnvironment { * 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() { } @@ -434,6 +440,27 @@ class AppServiceEnvironment { } } } + }, + hasLinuxWorkers: { + required: false, + serializedName: 'hasLinuxWorkers', + type: { + name: 'Boolean' + } + }, + sslCertKeyVaultId: { + required: false, + serializedName: 'sslCertKeyVaultId', + type: { + name: 'String' + } + }, + sslCertKeyVaultSecretName: { + required: false, + serializedName: 'sslCertKeyVaultSecretName', + type: { + name: 'String' + } } } } diff --git a/lib/services/webSiteManagement2/lib/models/appServiceEnvironmentPatchResource.js b/lib/services/webSiteManagement2/lib/models/appServiceEnvironmentPatchResource.js index 990549c0b2..ab454a36fc 100644 --- a/lib/services/webSiteManagement2/lib/models/appServiceEnvironmentPatchResource.js +++ b/lib/services/webSiteManagement2/lib/models/appServiceEnvironmentPatchResource.js @@ -99,6 +99,12 @@ class AppServiceEnvironmentPatchResource extends models['ProxyOnlyResource'] { * 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(); @@ -468,6 +474,27 @@ class AppServiceEnvironmentPatchResource extends models['ProxyOnlyResource'] { } } } + }, + 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' + } } } } diff --git a/lib/services/webSiteManagement2/lib/models/appServiceEnvironmentResource.js b/lib/services/webSiteManagement2/lib/models/appServiceEnvironmentResource.js index 458a7a0309..462a7c2f8b 100644 --- a/lib/services/webSiteManagement2/lib/models/appServiceEnvironmentResource.js +++ b/lib/services/webSiteManagement2/lib/models/appServiceEnvironmentResource.js @@ -99,6 +99,12 @@ class AppServiceEnvironmentResource extends models['Resource'] { * 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(); @@ -489,6 +495,27 @@ class AppServiceEnvironmentResource extends models['Resource'] { } } } + }, + 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' + } } } } diff --git a/lib/services/webSiteManagement2/lib/models/appServicePlan.js b/lib/services/webSiteManagement2/lib/models/appServicePlan.js index b8ecc0f0b9..79f4b30d7d 100644 --- a/lib/services/webSiteManagement2/lib/models/appServicePlan.js +++ b/lib/services/webSiteManagement2/lib/models/appServicePlan.js @@ -20,7 +20,6 @@ const models = require('./index'); class AppServicePlan extends models['Resource'] { /** * Create a AppServicePlan. - * @member {string} appServicePlanName Name for the App Service plan. * @member {string} [workerTierName] Target worker tier assigned to the App * Service plan. * @member {string} [status] App Service plan status. Possible values @@ -49,9 +48,13 @@ class AppServicePlan extends models['Resource'] { * 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] 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 @@ -148,13 +151,6 @@ class AppServicePlan extends models['Resource'] { } } }, - appServicePlanName: { - required: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, workerTierName: { required: false, serializedName: 'properties.workerTierName', @@ -240,6 +236,13 @@ class AppServicePlan extends models['Resource'] { name: 'DateTime' } }, + freeOfferExpirationTime: { + required: false, + serializedName: 'properties.freeOfferExpirationTime', + type: { + name: 'DateTime' + } + }, resourceGroup: { required: false, readOnly: true, @@ -256,6 +259,14 @@ class AppServicePlan extends models['Resource'] { name: 'Boolean' } }, + isXenon: { + required: false, + serializedName: 'properties.isXenon', + defaultValue: false, + type: { + name: 'Boolean' + } + }, targetWorkerCount: { required: false, serializedName: 'properties.targetWorkerCount', diff --git a/lib/services/webSiteManagement2/lib/models/appServicePlanCollection.js b/lib/services/webSiteManagement2/lib/models/appServicePlanCollection.js index 620bda3ea5..74827eafd6 100644 --- a/lib/services/webSiteManagement2/lib/models/appServicePlanCollection.js +++ b/lib/services/webSiteManagement2/lib/models/appServicePlanCollection.js @@ -53,6 +53,7 @@ class AppServicePlanCollection extends Array { }, nextLink: { required: false, + readOnly: true, serializedName: 'nextLink', type: { name: 'String' diff --git a/lib/services/webSiteManagement2/lib/models/appServicePlanPatchResource.js b/lib/services/webSiteManagement2/lib/models/appServicePlanPatchResource.js index e08905aeec..bbeaed4a8f 100644 --- a/lib/services/webSiteManagement2/lib/models/appServicePlanPatchResource.js +++ b/lib/services/webSiteManagement2/lib/models/appServicePlanPatchResource.js @@ -20,8 +20,6 @@ const models = require('./index'); class AppServicePlanPatchResource extends models['ProxyOnlyResource'] { /** * Create a AppServicePlanPatchResource. - * @member {string} appServicePlanPatchResourceName Name for the App Service - * plan. * @member {string} [workerTierName] Target worker tier assigned to the App * Service plan. * @member {string} [status] App Service plan status. Possible values @@ -50,9 +48,13 @@ class AppServicePlanPatchResource extends models['ProxyOnlyResource'] { * 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] 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 @@ -108,13 +110,6 @@ class AppServicePlanPatchResource extends models['ProxyOnlyResource'] { name: 'String' } }, - appServicePlanPatchResourceName: { - required: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, workerTierName: { required: false, serializedName: 'properties.workerTierName', @@ -200,6 +195,13 @@ class AppServicePlanPatchResource extends models['ProxyOnlyResource'] { name: 'DateTime' } }, + freeOfferExpirationTime: { + required: false, + serializedName: 'properties.freeOfferExpirationTime', + type: { + name: 'DateTime' + } + }, resourceGroup: { required: false, readOnly: true, @@ -216,6 +218,14 @@ class AppServicePlanPatchResource extends models['ProxyOnlyResource'] { name: 'Boolean' } }, + isXenon: { + required: false, + serializedName: 'properties.isXenon', + defaultValue: false, + type: { + name: 'Boolean' + } + }, targetWorkerCount: { required: false, serializedName: 'properties.targetWorkerCount', diff --git a/lib/services/webSiteManagement2/lib/models/applicationStack.js b/lib/services/webSiteManagement2/lib/models/applicationStack.js new file mode 100644 index 0000000000..0a52694422 --- /dev/null +++ b/lib/services/webSiteManagement2/lib/models/applicationStack.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'; + +const models = require('./index'); + +/** + * 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/resourceHealthMetadataCollection.js b/lib/services/webSiteManagement2/lib/models/applicationStackCollection.js similarity index 66% rename from lib/services/websiteManagement2/lib/models/resourceHealthMetadataCollection.js rename to lib/services/webSiteManagement2/lib/models/applicationStackCollection.js index b4be12e889..03e5ff0ee5 100644 --- a/lib/services/websiteManagement2/lib/models/resourceHealthMetadataCollection.js +++ b/lib/services/webSiteManagement2/lib/models/applicationStackCollection.js @@ -11,11 +11,11 @@ 'use strict'; /** - * Collection of resource health metadata. + * Collection of Application Stacks */ -class ResourceHealthMetadataCollection extends Array { +class ApplicationStackCollection extends Array { /** - * Create a ResourceHealthMetadataCollection. + * Create a ApplicationStackCollection. * @member {string} [nextLink] Link to next page of resources. */ constructor() { @@ -23,18 +23,18 @@ class ResourceHealthMetadataCollection extends Array { } /** - * Defines the metadata of ResourceHealthMetadataCollection + * Defines the metadata of ApplicationStackCollection * - * @returns {object} metadata of ResourceHealthMetadataCollection + * @returns {object} metadata of ApplicationStackCollection * */ mapper() { return { required: false, - serializedName: 'ResourceHealthMetadataCollection', + serializedName: 'ApplicationStackCollection', type: { name: 'Composite', - className: 'ResourceHealthMetadataCollection', + className: 'ApplicationStackCollection', modelProperties: { value: { required: true, @@ -43,10 +43,10 @@ class ResourceHealthMetadataCollection extends Array { name: 'Sequence', element: { required: false, - serializedName: 'ResourceHealthMetadataElementType', + serializedName: 'ApplicationStackElementType', type: { name: 'Composite', - className: 'ResourceHealthMetadata' + className: 'ApplicationStack' } } } @@ -65,4 +65,4 @@ class ResourceHealthMetadataCollection extends Array { } } -module.exports = ResourceHealthMetadataCollection; +module.exports = ApplicationStackCollection; diff --git a/lib/services/webSiteManagement2/lib/models/backupRequest.js b/lib/services/webSiteManagement2/lib/models/backupRequest.js index dba65bf110..c7b5da3f97 100644 --- a/lib/services/webSiteManagement2/lib/models/backupRequest.js +++ b/lib/services/webSiteManagement2/lib/models/backupRequest.js @@ -20,7 +20,6 @@ const models = require('./index'); class BackupRequest extends models['ProxyOnlyResource'] { /** * Create a BackupRequest. - * @member {string} backupRequestName 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. @@ -44,8 +43,6 @@ class BackupRequest extends models['ProxyOnlyResource'] { * @member {date} [backupSchedule.lastExecutionTime] Last time when this * schedule was triggered. * @member {array} [databases] Databases included in the backup. - * @member {string} [backupRequestType] Type of the backup. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' */ constructor() { super(); @@ -96,13 +93,6 @@ class BackupRequest extends models['ProxyOnlyResource'] { name: 'String' } }, - backupRequestName: { - required: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, enabled: { required: false, serializedName: 'properties.enabled', @@ -139,14 +129,6 @@ class BackupRequest extends models['ProxyOnlyResource'] { } } } - }, - backupRequestType: { - required: false, - serializedName: 'properties.type', - type: { - name: 'Enum', - allowedValues: [ 'Default', 'Clone', 'Relocation', 'Snapshot' ] - } } } } 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/certificate.js b/lib/services/webSiteManagement2/lib/models/certificate.js index 200bd1eaf4..f7b9f4da55 100644 --- a/lib/services/webSiteManagement2/lib/models/certificate.js +++ b/lib/services/webSiteManagement2/lib/models/certificate.js @@ -50,7 +50,6 @@ class Certificate extends models['Resource'] { * 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', * 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', * 'Unknown' - * @member {string} [geoRegion] Region of the certificate. * @member {string} [serverFarmId] Resource ID of the associated App Service * plan, formatted as: * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". @@ -273,14 +272,6 @@ class Certificate extends models['Resource'] { allowedValues: [ 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', 'Unknown' ] } }, - geoRegion: { - required: false, - readOnly: true, - serializedName: 'properties.geoRegion', - type: { - name: 'String' - } - }, serverFarmId: { required: false, serializedName: 'properties.serverFarmId', diff --git a/lib/services/webSiteManagement2/lib/models/certificateOrderAction.js b/lib/services/webSiteManagement2/lib/models/certificateOrderAction.js index fc3635e0c7..123fb2ad46 100644 --- a/lib/services/webSiteManagement2/lib/models/certificateOrderAction.js +++ b/lib/services/webSiteManagement2/lib/models/certificateOrderAction.js @@ -20,8 +20,8 @@ const models = require('./index'); class CertificateOrderAction extends models['ProxyOnlyResource'] { /** * Create a CertificateOrderAction. - * @member {string} [certificateOrderActionType] Action type. Possible values - * include: 'CertificateIssued', 'CertificateOrderCanceled', + * @member {string} [actionType] Action type. Possible values include: + * 'CertificateIssued', 'CertificateOrderCanceled', * 'CertificateOrderCreated', 'CertificateRevoked', * 'DomainValidationComplete', 'FraudDetected', 'OrgNameChange', * 'OrgValidationComplete', 'SanDrop', 'FraudCleared', 'CertificateExpired', @@ -78,9 +78,10 @@ class CertificateOrderAction extends models['ProxyOnlyResource'] { name: 'String' } }, - certificateOrderActionType: { + actionType: { required: false, - serializedName: 'properties.type', + readOnly: true, + serializedName: 'properties.actionType', type: { name: 'Enum', allowedValues: [ 'CertificateIssued', 'CertificateOrderCanceled', 'CertificateOrderCreated', 'CertificateRevoked', 'DomainValidationComplete', 'FraudDetected', 'OrgNameChange', 'OrgValidationComplete', 'SanDrop', 'FraudCleared', 'CertificateExpired', 'CertificateExpirationWarning', 'FraudDocumentationRequired', 'Unknown' ] @@ -88,6 +89,7 @@ class CertificateOrderAction extends models['ProxyOnlyResource'] { }, createdAt: { required: false, + readOnly: true, serializedName: 'properties.createdAt', type: { name: 'DateTime' diff --git a/lib/services/webSiteManagement2/lib/models/certificatePatchResource.js b/lib/services/webSiteManagement2/lib/models/certificatePatchResource.js index e68d49ee1a..708ccf5cf0 100644 --- a/lib/services/webSiteManagement2/lib/models/certificatePatchResource.js +++ b/lib/services/webSiteManagement2/lib/models/certificatePatchResource.js @@ -50,7 +50,6 @@ class CertificatePatchResource extends models['ProxyOnlyResource'] { * 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', * 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', * 'Unknown' - * @member {string} [geoRegion] Region of the certificate. * @member {string} [serverFarmId] Resource ID of the associated App Service * plan, formatted as: * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". @@ -252,14 +251,6 @@ class CertificatePatchResource extends models['ProxyOnlyResource'] { allowedValues: [ 'Initialized', 'WaitingOnCertificateOrder', 'Succeeded', 'CertificateOrderFailed', 'OperationNotPermittedOnKeyVault', 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', 'Unknown' ] } }, - geoRegion: { - required: false, - readOnly: true, - serializedName: 'properties.geoRegion', - type: { - name: 'String' - } - }, serverFarmId: { required: false, serializedName: 'properties.serverFarmId', diff --git a/lib/services/webSiteManagement2/lib/models/cloningInfo.js b/lib/services/webSiteManagement2/lib/models/cloningInfo.js index 868a356c16..971b705122 100644 --- a/lib/services/webSiteManagement2/lib/models/cloningInfo.js +++ b/lib/services/webSiteManagement2/lib/models/cloningInfo.js @@ -46,8 +46,6 @@ class CloningInfo { * @member {string} [trafficManagerProfileName] Name of Traffic Manager * profile to create. This is only needed if Traffic Manager profile does not * already exist. - * @member {boolean} [ignoreQuotas] true if quotas should be - * ignored; otherwise, false. */ constructor() { } @@ -142,13 +140,6 @@ class CloningInfo { type: { name: 'String' } - }, - ignoreQuotas: { - required: false, - serializedName: 'ignoreQuotas', - type: { - name: 'Boolean' - } } } } diff --git a/lib/services/webSiteManagement2/lib/models/continuousWebJob.js b/lib/services/webSiteManagement2/lib/models/continuousWebJob.js index ffba08bca7..7ae4000f49 100644 --- a/lib/services/webSiteManagement2/lib/models/continuousWebJob.js +++ b/lib/services/webSiteManagement2/lib/models/continuousWebJob.js @@ -24,12 +24,10 @@ class ContinuousWebJob extends models['ProxyOnlyResource'] { * 'Initializing', 'Starting', 'Running', 'PendingRestart', 'Stopped' * @member {string} [detailedStatus] Detailed status. * @member {string} [logUrl] Log URL. - * @member {string} [continuousWebJobName] Job name. Used as job identifier - * in ARM resource URI. * @member {string} [runCommand] Run command. * @member {string} [url] Job URL. * @member {string} [extraInfoUrl] Extra Info URL. - * @member {string} [jobType] Job type. Possible values include: + * @member {string} [webJobType] Job type. Possible values include: * 'Continuous', 'Triggered' * @member {string} [error] Error information. * @member {boolean} [usingSdk] Using SDK? @@ -94,29 +92,21 @@ class ContinuousWebJob extends models['ProxyOnlyResource'] { }, detailedStatus: { required: false, - serializedName: 'properties.detailedStatus', + serializedName: 'properties.detailed_status', type: { name: 'String' } }, logUrl: { required: false, - serializedName: 'properties.logUrl', - type: { - name: 'String' - } - }, - continuousWebJobName: { - required: false, - readOnly: true, - serializedName: 'properties.name', + serializedName: 'properties.log_url', type: { name: 'String' } }, runCommand: { required: false, - serializedName: 'properties.runCommand', + serializedName: 'properties.run_command', type: { name: 'String' } @@ -130,14 +120,14 @@ class ContinuousWebJob extends models['ProxyOnlyResource'] { }, extraInfoUrl: { required: false, - serializedName: 'properties.extraInfoUrl', + serializedName: 'properties.extra_info_url', type: { name: 'String' } }, - jobType: { + webJobType: { required: false, - serializedName: 'properties.jobType', + serializedName: 'properties.web_job_type', type: { name: 'Enum', allowedValues: [ 'Continuous', 'Triggered' ] @@ -152,7 +142,7 @@ class ContinuousWebJob extends models['ProxyOnlyResource'] { }, usingSdk: { required: false, - serializedName: 'properties.usingSdk', + serializedName: 'properties.using_sdk', type: { name: 'Boolean' } diff --git a/lib/services/webSiteManagement2/lib/models/continuousWebJobCollection.js b/lib/services/webSiteManagement2/lib/models/continuousWebJobCollection.js index 99a440181a..5d82a581b7 100644 --- a/lib/services/webSiteManagement2/lib/models/continuousWebJobCollection.js +++ b/lib/services/webSiteManagement2/lib/models/continuousWebJobCollection.js @@ -53,6 +53,7 @@ class ContinuousWebJobCollection extends Array { }, nextLink: { required: false, + readOnly: true, serializedName: 'nextLink', type: { name: 'String' diff --git a/lib/services/webSiteManagement2/lib/models/csmOperationDescription.js b/lib/services/webSiteManagement2/lib/models/csmOperationDescription.js index 9375a0b953..a1d904e61f 100644 --- a/lib/services/webSiteManagement2/lib/models/csmOperationDescription.js +++ b/lib/services/webSiteManagement2/lib/models/csmOperationDescription.js @@ -29,6 +29,7 @@ class CsmOperationDescription { * @member {object} [properties] * @member {object} [properties.serviceSpecification] * @member {array} [properties.serviceSpecification.metricSpecifications] + * @member {array} [properties.serviceSpecification.logSpecifications] */ constructor() { } diff --git a/lib/services/webSiteManagement2/lib/models/csmOperationDescriptionProperties.js b/lib/services/webSiteManagement2/lib/models/csmOperationDescriptionProperties.js index 77631076bc..bf869cb952 100644 --- a/lib/services/webSiteManagement2/lib/models/csmOperationDescriptionProperties.js +++ b/lib/services/webSiteManagement2/lib/models/csmOperationDescriptionProperties.js @@ -21,6 +21,7 @@ class CsmOperationDescriptionProperties { * Create a CsmOperationDescriptionProperties. * @member {object} [serviceSpecification] * @member {array} [serviceSpecification.metricSpecifications] + * @member {array} [serviceSpecification.logSpecifications] */ constructor() { } 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..9b1b335eb2 --- /dev/null +++ b/lib/services/webSiteManagement2/lib/models/dataTableResponseObject.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'); + +/** + * 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/defaultErrorResponse.js b/lib/services/webSiteManagement2/lib/models/defaultErrorResponse.js new file mode 100644 index 0000000000..7626a48a16 --- /dev/null +++ b/lib/services/webSiteManagement2/lib/models/defaultErrorResponse.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'; + +const models = require('./index'); + +/** + * 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..db22658770 --- /dev/null +++ b/lib/services/webSiteManagement2/lib/models/defaultErrorResponseError.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'); + +/** + * 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 index 265245476b..e076b9bc7a 100644 --- a/lib/services/webSiteManagement2/lib/models/deletedSite.js +++ b/lib/services/webSiteManagement2/lib/models/deletedSite.js @@ -17,12 +17,12 @@ class DeletedSite { /** * Create a DeletedSite. - * @member {number} [id] Numeric id for the deleted site + * @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} [name] Name of the deleted site + * @member {string} [deletedSiteName] Name of the deleted site * @member {string} [slot] Slot of the deleted site */ constructor() { @@ -42,9 +42,10 @@ class DeletedSite { name: 'Composite', className: 'DeletedSite', modelProperties: { - id: { + deletedSiteId: { required: false, - serializedName: 'id', + readOnly: true, + serializedName: 'deletedSiteId', type: { name: 'Number' } @@ -73,10 +74,10 @@ class DeletedSite { name: 'String' } }, - name: { + deletedSiteName: { required: false, readOnly: true, - serializedName: 'name', + serializedName: 'deletedSiteName', type: { name: 'String' } diff --git a/lib/services/webSiteManagement2/lib/models/deployment.js b/lib/services/webSiteManagement2/lib/models/deployment.js index 052aab349d..f8fdc08349 100644 --- a/lib/services/webSiteManagement2/lib/models/deployment.js +++ b/lib/services/webSiteManagement2/lib/models/deployment.js @@ -20,7 +20,6 @@ const models = require('./index'); class Deployment extends models['ProxyOnlyResource'] { /** * Create a Deployment. - * @member {string} [deploymentId] Identifier for deployment. * @member {number} [status] Deployment status. * @member {string} [message] Details about deployment status. * @member {string} [author] Who authored the deployment. @@ -81,13 +80,6 @@ class Deployment extends models['ProxyOnlyResource'] { name: 'String' } }, - deploymentId: { - required: false, - serializedName: 'properties.id', - type: { - name: 'String' - } - }, status: { required: false, serializedName: 'properties.status', @@ -118,21 +110,21 @@ class Deployment extends models['ProxyOnlyResource'] { }, authorEmail: { required: false, - serializedName: 'properties.authorEmail', + serializedName: 'properties.author_email', type: { name: 'String' } }, startTime: { required: false, - serializedName: 'properties.startTime', + serializedName: 'properties.start_time', type: { name: 'DateTime' } }, endTime: { required: false, - serializedName: 'properties.endTime', + serializedName: 'properties.end_time', type: { name: 'DateTime' } diff --git a/lib/services/websiteManagement2/lib/models/restoreResponse.js b/lib/services/webSiteManagement2/lib/models/detectorInfo.js similarity index 52% rename from lib/services/websiteManagement2/lib/models/restoreResponse.js rename to lib/services/webSiteManagement2/lib/models/detectorInfo.js index a3f06ae56a..7dc038b07c 100644 --- a/lib/services/websiteManagement2/lib/models/restoreResponse.js +++ b/lib/services/webSiteManagement2/lib/models/detectorInfo.js @@ -10,72 +10,64 @@ 'use strict'; -const models = require('./index'); - /** - * Response for an app restore request. + * Definition of Detector * - * @extends models['ProxyOnlyResource'] */ -class RestoreResponse extends models['ProxyOnlyResource'] { +class DetectorInfo { /** - * Create a RestoreResponse. - * @member {string} [operationId] When server starts the restore process, it - * will return an operation ID identifying that particular restore operation. + * 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() { - super(); } /** - * Defines the metadata of RestoreResponse + * Defines the metadata of DetectorInfo * - * @returns {object} metadata of RestoreResponse + * @returns {object} metadata of DetectorInfo * */ mapper() { return { required: false, - serializedName: 'RestoreResponse', + serializedName: 'DetectorInfo', type: { name: 'Composite', - className: 'RestoreResponse', + className: 'DetectorInfo', modelProperties: { - id: { + description: { required: false, readOnly: true, - serializedName: 'id', + serializedName: 'description', type: { name: 'String' } }, - name: { + category: { required: false, readOnly: true, - serializedName: 'name', - type: { - name: 'String' - } - }, - kind: { - required: false, - serializedName: 'kind', + serializedName: 'category', type: { name: 'String' } }, - type: { + subCategory: { required: false, readOnly: true, - serializedName: 'type', + serializedName: 'subCategory', type: { name: 'String' } }, - operationId: { + supportTopicId: { required: false, readOnly: true, - serializedName: 'properties.operationId', + serializedName: 'supportTopicId', type: { name: 'String' } @@ -86,4 +78,4 @@ class RestoreResponse extends models['ProxyOnlyResource'] { } } -module.exports = RestoreResponse; +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/diagnosticData.js b/lib/services/webSiteManagement2/lib/models/diagnosticData.js new file mode 100644 index 0000000000..f3b0662a2e --- /dev/null +++ b/lib/services/webSiteManagement2/lib/models/diagnosticData.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'; + +const models = require('./index'); + +/** + * 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/functionEnvelope.js b/lib/services/webSiteManagement2/lib/models/functionEnvelope.js index d7389e080d..de01948153 100644 --- a/lib/services/webSiteManagement2/lib/models/functionEnvelope.js +++ b/lib/services/webSiteManagement2/lib/models/functionEnvelope.js @@ -20,7 +20,6 @@ const models = require('./index'); class FunctionEnvelope extends models['ProxyOnlyResource'] { /** * Create a FunctionEnvelope. - * @member {string} [functionEnvelopeName] Function name. * @member {string} [functionAppId] Function App ID. * @member {string} [scriptRootPathHref] Script root path URI. * @member {string} [scriptHref] Script URI. @@ -81,46 +80,37 @@ class FunctionEnvelope extends models['ProxyOnlyResource'] { name: 'String' } }, - functionEnvelopeName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, functionAppId: { required: false, - readOnly: true, - serializedName: 'properties.functionAppId', + serializedName: 'properties.function_app_id', type: { name: 'String' } }, scriptRootPathHref: { required: false, - serializedName: 'properties.scriptRootPathHref', + serializedName: 'properties.script_root_path_href', type: { name: 'String' } }, scriptHref: { required: false, - serializedName: 'properties.scriptHref', + serializedName: 'properties.script_href', type: { name: 'String' } }, configHref: { required: false, - serializedName: 'properties.configHref', + serializedName: 'properties.config_href', type: { name: 'String' } }, secretsFileHref: { required: false, - serializedName: 'properties.secretsFileHref', + serializedName: 'properties.secrets_file_href', type: { name: 'String' } @@ -155,7 +145,7 @@ class FunctionEnvelope extends models['ProxyOnlyResource'] { }, testData: { required: false, - serializedName: 'properties.testData', + serializedName: 'properties.test_data', type: { name: 'String' } diff --git a/lib/services/webSiteManagement2/lib/models/functionSecrets.js b/lib/services/webSiteManagement2/lib/models/functionSecrets.js index 6c33bce188..89769cbd49 100644 --- a/lib/services/webSiteManagement2/lib/models/functionSecrets.js +++ b/lib/services/webSiteManagement2/lib/models/functionSecrets.js @@ -81,7 +81,7 @@ class FunctionSecrets extends models['ProxyOnlyResource'] { }, triggerUrl: { required: false, - serializedName: 'properties.triggerUrl', + serializedName: 'properties.trigger_url', type: { name: 'String' } diff --git a/lib/services/webSiteManagement2/lib/models/geoRegion.js b/lib/services/webSiteManagement2/lib/models/geoRegion.js index bf004ffc2e..6488f76da4 100644 --- a/lib/services/webSiteManagement2/lib/models/geoRegion.js +++ b/lib/services/webSiteManagement2/lib/models/geoRegion.js @@ -20,7 +20,6 @@ const models = require('./index'); class GeoRegion extends models['ProxyOnlyResource'] { /** * Create a GeoRegion. - * @member {string} [geoRegionName] Region name. * @member {string} [description] Region description. * @member {string} [displayName] Display name for region. */ @@ -73,14 +72,6 @@ class GeoRegion extends models['ProxyOnlyResource'] { name: 'String' } }, - geoRegionName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, description: { required: false, readOnly: true, diff --git a/lib/services/webSiteManagement2/lib/models/handlerMapping.js b/lib/services/webSiteManagement2/lib/models/handlerMapping.js index b517c55838..ee5dc87e3b 100644 --- a/lib/services/webSiteManagement2/lib/models/handlerMapping.js +++ b/lib/services/webSiteManagement2/lib/models/handlerMapping.js @@ -24,8 +24,8 @@ class HandlerMapping { * using the specified FastCGI application. * @member {string} [scriptProcessor] The absolute path to the FastCGI * application. - * @member {string} [arguments] Command-line arguments to be passed to the - * script processor. + * @member {string} [argumentsProperty] Command-line arguments to be passed + * to the script processor. */ constructor() { } @@ -58,7 +58,7 @@ class HandlerMapping { name: 'String' } }, - arguments: { + argumentsProperty: { required: false, serializedName: 'arguments', type: { diff --git a/lib/services/webSiteManagement2/lib/models/index.d.ts b/lib/services/webSiteManagement2/lib/models/index.d.ts index b4146905b1..9687aabe5c 100644 --- a/lib/services/webSiteManagement2/lib/models/index.d.ts +++ b/lib/services/webSiteManagement2/lib/models/index.d.ts @@ -344,18 +344,18 @@ export interface CertificateEmail extends ProxyOnlyResource { * @constructor * Certificate order action. * - * @member {string} [certificateOrderActionType] Action type. Possible values - * include: 'CertificateIssued', 'CertificateOrderCanceled', - * 'CertificateOrderCreated', 'CertificateRevoked', 'DomainValidationComplete', - * 'FraudDetected', 'OrgNameChange', 'OrgValidationComplete', 'SanDrop', - * 'FraudCleared', 'CertificateExpired', 'CertificateExpirationWarning', + * @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 { - certificateOrderActionType?: string; - createdAt?: Date; + readonly actionType?: string; + readonly createdAt?: Date; } /** @@ -429,8 +429,6 @@ export interface SiteSealRequest { * Virtual Network route contract used to pass routing information for a * Virtual Network. * - * @member {string} [vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. * @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. @@ -446,7 +444,6 @@ export interface SiteSealRequest { * Virtual Network. Possible values include: 'DEFAULT', 'INHERITED', 'STATIC' */ export interface VnetRoute extends ProxyOnlyResource { - vnetRouteName?: string; startAddress?: string; endAddress?: string; routeType?: string; @@ -501,71 +498,31 @@ export interface VnetGateway extends ProxyOnlyResource { * @constructor * User crendentials used for publishing activity. * - * @member {string} [userName] Username * @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 { - userName?: string; publishingUserName: string; publishingPassword?: string; publishingPasswordHash?: string; publishingPasswordHashSalt?: string; + scmUri?: string; } /** * @class - * Initializes a new instance of the SnapshotRecoveryTarget class. - * @constructor - * Specifies the web app that snapshot contents will be written to. - * - * @member {string} [location] Geographical location of the target web app, - * e.g. SouthEastAsia, SouthCentralUS - * @member {string} [id] ARM resource ID of the target 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 SnapshotRecoveryTarget { - location?: string; - id?: string; -} - -/** - * @class - * Initializes a new instance of the SnapshotRecoveryRequest class. + * Initializes a new instance of the Snapshot class. * @constructor - * Details about app recovery operation. + * A snapshot of an app. * - * @member {string} [snapshotTime] Point in time in which the app recovery - * should be attempted, formatted as a DateTime string. - * @member {object} [recoveryTarget] Specifies the web app that snapshot - * contents will be written to. - * @member {string} [recoveryTarget.location] Geographical location of the - * target web app, e.g. SouthEastAsia, SouthCentralUS - * @member {string} [recoveryTarget.id] ARM resource ID of the target 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 recovery 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. + * @member {string} [time] The time the snapshot was taken. */ -export interface SnapshotRecoveryRequest extends ProxyOnlyResource { - snapshotTime?: string; - recoveryTarget?: SnapshotRecoveryTarget; - overwrite: boolean; - recoverConfiguration?: boolean; - ignoreConflictingHostNames?: boolean; +export interface Snapshot extends ProxyOnlyResource { + readonly time?: string; } /** @@ -582,45 +539,24 @@ export interface ResourceMetricAvailability { readonly retention?: 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 ResourceMetricDefinition class. * @constructor * Metadata for the metrics. * - * @member {object} [resourceMetricDefinitionName] Name of the metric. - * @member {string} [resourceMetricDefinitionName.value] metric name value. - * @member {string} [resourceMetricDefinitionName.localizedValue] Localized - * metric name value. * @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 {string} [resourceMetricDefinitionId] Resource ID. * @member {object} [properties] Resource metric definition properties. */ export interface ResourceMetricDefinition extends ProxyOnlyResource { - readonly resourceMetricDefinitionName?: ResourceMetricName; readonly unit?: string; readonly primaryAggregationType?: string; readonly metricAvailabilities?: ResourceMetricAvailability[]; readonly resourceUri?: string; - readonly resourceMetricDefinitionId?: string; readonly properties?: { [propertyName: string]: string }; } @@ -715,14 +651,18 @@ export interface HybridConnection extends ProxyOnlyResource { * @constructor * Managed service identity. * - * @member {object} [type] Type of 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?: any; + type?: string; readonly tenantId?: string; readonly principalId?: string; + identityIds?: string[]; } /** @@ -779,8 +719,6 @@ export interface SlotSwapStatus { * @member {string} [trafficManagerProfileName] Name of Traffic Manager profile * to create. This is only needed if Traffic Manager profile does not already * exist. - * @member {boolean} [ignoreQuotas] true if quotas should be - * ignored; otherwise, false. */ export interface CloningInfo { correlationId?: string; @@ -793,7 +731,6 @@ export interface CloningInfo { configureLoadBalancing?: boolean; trafficManagerProfileId?: string; trafficManagerProfileName?: string; - ignoreQuotas?: boolean; } /** @@ -819,12 +756,27 @@ export interface HostingEnvironmentProfile { * 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; } /** @@ -1113,13 +1065,13 @@ export interface VirtualApplication { * using the specified FastCGI application. * @member {string} [scriptProcessor] The absolute path to the FastCGI * application. - * @member {string} [arguments] Command-line arguments to be passed to the - * script processor. + * @member {string} [argumentsProperty] Command-line arguments to be passed to + * the script processor. */ export interface HandlerMapping { extension?: string; scriptProcessor?: string; - arguments?: string; + argumentsProperty?: string; } /** @@ -1186,6 +1138,7 @@ export interface NameValuePair { * @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 @@ -1296,7 +1249,19 @@ export interface NameValuePair { * @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; @@ -1306,6 +1271,7 @@ export interface SiteConfig { pythonVersion?: string; nodeVersion?: string; linuxFxVersion?: string; + windowsFxVersion?: string; requestTracingEnabled?: boolean; requestTracingExpirationTime?: Date; remoteDebuggingEnabled?: boolean; @@ -1341,7 +1307,13 @@ export interface SiteConfig { apiDefinition?: ApiDefinitionInfo; autoSwapSlotName?: string; localMySqlEnabled?: boolean; + managedServiceIdentityId?: number; + xManagedServiceIdentityId?: number; ipSecurityRestrictions?: IpSecurityRestriction[]; + http20Enabled?: boolean; + minTlsVersion?: string; + ftpsState?: string; + reservedInstanceCount?: number; } /** @@ -1397,6 +1369,7 @@ export interface HostNameSslState { * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". * @member {boolean} [reserved] true if reserved; otherwise, * false. Default value: false . + * @member {boolean} [isXenon] 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. @@ -1407,6 +1380,8 @@ export interface HostNameSslState { * @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 @@ -1528,8 +1503,22 @@ export interface HostNameSslState { * @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) @@ -1600,29 +1589,6 @@ export interface HostNameSslState { * @member {string} [cloningInfo.trafficManagerProfileName] Name of Traffic * Manager profile to create. This is only needed if Traffic Manager profile * does not already exist. - * @member {boolean} [cloningInfo.ignoreQuotas] true if quotas - * should be ignored; otherwise, false. - * @member {object} [snapshotInfo] If specified during app creation, the app is - * created from a previous snapshot. - * @member {string} [snapshotInfo.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * @member {object} [snapshotInfo.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * @member {string} [snapshotInfo.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * @member {string} [snapshotInfo.recoveryTarget.id] ARM resource ID of the - * target 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} [snapshotInfo.overwrite] If true the recovery - * operation can overwrite source app; otherwise, false. - * @member {boolean} [snapshotInfo.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * @member {boolean} [snapshotInfo.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. * @member {string} [resourceGroup] Name of the resource group the app belongs * to. Read-only. * @member {boolean} [isDefaultContainer] true if the app is a @@ -1640,10 +1606,13 @@ export interface HostNameSslState { * only https requests. Issues redirect for * http requests * @member {object} [identity] - * @member {object} [identity.type] Type of managed service 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; @@ -1656,6 +1625,7 @@ export interface Site extends Resource { hostNameSslStates?: HostNameSslState[]; serverFarmId?: string; reserved?: boolean; + isXenon?: boolean; readonly lastModifiedTimeUtc?: Date; siteConfig?: SiteConfig; readonly trafficManagerHostNames?: string[]; @@ -1672,7 +1642,6 @@ export interface Site extends Resource { readonly suspendedTill?: Date; readonly maxNumberOfWorkers?: number; cloningInfo?: CloningInfo; - snapshotInfo?: SnapshotRecoveryRequest; readonly resourceGroup?: string; readonly isDefaultContainer?: boolean; readonly defaultHostName?: string; @@ -1762,7 +1731,6 @@ export interface SkuDescription { * @constructor * App Service plan. * - * @member {string} appServicePlanName Name for the 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: @@ -1790,9 +1758,13 @@ export interface SkuDescription { * 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] 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 @@ -1820,7 +1792,6 @@ export interface SkuDescription { * manager enabled? */ export interface AppServicePlan extends Resource { - appServicePlanName: string; workerTierName?: string; readonly status?: string; readonly subscription?: string; @@ -1832,14 +1803,78 @@ export interface AppServicePlan extends Resource { readonly numberOfSites?: number; isSpot?: boolean; spotExpirationTime?: Date; + freeOfferExpirationTime?: Date; readonly resourceGroup?: string; reserved?: boolean; + isXenon?: 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. @@ -1852,6 +1887,22 @@ 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. @@ -1933,9 +1984,11 @@ export interface MetricSpecification { * Resource metrics service provided by Microsoft.Insights resource provider. * * @member {array} [metricSpecifications] + * @member {array} [logSpecifications] */ export interface ServiceSpecification { metricSpecifications?: MetricSpecification[]; + logSpecifications?: LogSpecification[]; } /** @@ -1946,6 +1999,7 @@ export interface ServiceSpecification { * * @member {object} [serviceSpecification] * @member {array} [serviceSpecification.metricSpecifications] + * @member {array} [serviceSpecification.logSpecifications] */ export interface CsmOperationDescriptionProperties { serviceSpecification?: ServiceSpecification; @@ -1985,6 +2039,7 @@ export interface CsmOperationDisplay { * @member {object} [properties] * @member {object} [properties.serviceSpecification] * @member {array} [properties.serviceSpecification.metricSpecifications] + * @member {array} [properties.serviceSpecification.logSpecifications] */ export interface CsmOperationDescription { name?: string; @@ -2508,12 +2563,10 @@ export interface TldLegalAgreement { * @constructor * A top level domain object. * - * @member {string} [domainName] Name of the top level domain. * @member {boolean} [privacy] If true, then the top level domain * supports domain privacy; otherwise, false. */ export interface TopLevelDomain extends ProxyOnlyResource { - readonly domainName?: string; privacy?: boolean; } @@ -2571,7 +2624,6 @@ export interface TopLevelDomainAgreementOption { * 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', * 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', * 'Unknown' - * @member {string} [geoRegion] Region of the certificate. * @member {string} [serverFarmId] Resource ID of the associated App Service * plan, formatted as: * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". @@ -2595,7 +2647,6 @@ export interface Certificate extends Resource { keyVaultId?: string; keyVaultSecretName?: string; readonly keyVaultSecretStatus?: string; - readonly geoRegion?: string; serverFarmId?: string; } @@ -2635,7 +2686,6 @@ export interface Certificate extends Resource { * 'AzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultDoesNotExist', * 'KeyVaultSecretDoesNotExist', 'UnknownError', 'ExternalPrivateKey', * 'Unknown' - * @member {string} [geoRegion] Region of the certificate. * @member {string} [serverFarmId] Resource ID of the associated App Service * plan, formatted as: * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". @@ -2659,7 +2709,6 @@ export interface CertificatePatchResource extends ProxyOnlyResource { keyVaultId?: string; keyVaultSecretName?: string; readonly keyVaultSecretStatus?: string; - readonly geoRegion?: string; serverFarmId?: string; } @@ -2737,7 +2786,7 @@ export interface VirtualIPMapping { * @member {string} [computeMode] Shared/dedicated workers. Possible values * include: 'Shared', 'Dedicated', 'Dynamic' * @member {string} [workerSize] Size of the machines. Possible values include: - * 'Default', 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3' + * 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', 'Default' * @member {number} [workerSizeId] Size ID of machines: * 0 - Small * 1 - Medium @@ -2748,6 +2797,7 @@ export interface VirtualIPMapping { * @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; @@ -2760,6 +2810,7 @@ export interface StampCapacity { excludeFromCapacityAllocation?: boolean; isApplicableForAllComputeModes?: boolean; siteMode?: string; + isLinux?: boolean; } /** @@ -2864,6 +2915,12 @@ export interface NetworkAccessControlEntry { * 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; @@ -2902,6 +2959,9 @@ export interface AppServiceEnvironment { dynamicCacheEnabled?: boolean; clusterSettings?: NameValuePair[]; userWhitelistedIpRanges?: string[]; + hasLinuxWorkers?: boolean; + sslCertKeyVaultId?: string; + sslCertKeyVaultSecretName?: string; } /** @@ -2940,6 +3000,29 @@ export interface CsmUsageQuota { name?: LocalizableString; } +/** + * @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 + */ +export interface DeletedSite { + readonly deletedSiteId?: number; + readonly deletedTimestamp?: string; + readonly subscription?: string; + readonly resourceGroup?: string; + readonly deletedSiteName?: string; + readonly slot?: string; +} + /** * @class * Initializes a new instance of the ErrorEntity class. @@ -2990,6 +3073,20 @@ export interface Operation { 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. @@ -3058,29 +3155,6 @@ export interface ResourceMetric { readonly properties?: ResourceMetricProperty[]; } -/** - * @class - * Initializes a new instance of the DeletedSite class. - * @constructor - * A deleted app. - * - * @member {number} [id] 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} [name] Name of the deleted site - * @member {string} [slot] Slot of the deleted site - */ -export interface DeletedSite { - id?: number; - readonly deletedTimestamp?: string; - readonly subscription?: string; - readonly resourceGroup?: string; - readonly name?: string; - readonly slot?: string; -} - /** * @class * Initializes a new instance of the Solution class. @@ -3300,6 +3374,117 @@ 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. @@ -3372,6 +3557,68 @@ export interface DiagnosticDetectorResponse extends ProxyOnlyResource { 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. @@ -3396,9 +3643,13 @@ export interface DiagnosticDetectorResponse extends ProxyOnlyResource { * @member {string} [channels] List of channels that this recommendation can * apply. Possible values include: 'Notification', 'Api', 'Email', 'Webhook', * 'All' - * @member {array} [tags] The list of category tags that this recommendation - * belongs to. + * @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 @@ -3418,7 +3669,7 @@ export interface DiagnosticDetectorResponse extends ProxyOnlyResource { * @member {string} [forwardLink] Forward link to an external document * associated with the rule. */ -export interface Recommendation { +export interface Recommendation extends ProxyOnlyResource { creationTime?: Date; recommendationId?: string; resourceId?: string; @@ -3428,8 +3679,10 @@ export interface Recommendation { message?: string; level?: string; channels?: string; - tags?: string[]; + readonly categoryTags?: string[]; actionName?: string; + enabled?: number; + states?: string[]; startTime?: Date; endTime?: Date; nextNotificationTime?: Date; @@ -3448,7 +3701,7 @@ export interface Recommendation { * @constructor * Represents a recommendation rule that the recommendation engine can perform. * - * @member {string} [name] Unique name of the rule. + * @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 @@ -3463,7 +3716,8 @@ export interface Recommendation { * @member {string} [channels] List of available channels that this rule * applies. Possible values include: 'Notification', 'Api', 'Email', 'Webhook', * 'All' - * @member {array} [tags] An array of category tags that the rule contains. + * @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. @@ -3473,8 +3727,8 @@ export interface Recommendation { * @member {string} [forwardLink] Forward link to an external document * associated with the rule. Applicable to dynamic rule only. */ -export interface RecommendationRule { - name?: string; +export interface RecommendationRule extends ProxyOnlyResource { + recommendationName?: string; displayName?: string; message?: string; recommendationId?: string; @@ -3482,13 +3736,36 @@ export interface RecommendationRule { actionName?: string; level?: string; channels?: string; - tags?: 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. @@ -3510,12 +3787,10 @@ export interface CsmMoveResourceEnvelope { * @constructor * Geographical region. * - * @member {string} [geoRegionName] Region name. * @member {string} [description] Region description. * @member {string} [displayName] Display name for region. */ export interface GeoRegion extends ProxyOnlyResource { - readonly geoRegionName?: string; readonly description?: string; readonly displayName?: string; } @@ -3595,7 +3870,6 @@ export interface GlobalCsmSkuDescription { * @member {string} [sku] Premier add on SKU. * @member {string} [product] Premier add on offer Product. * @member {string} [vendor] Premier add on offer Vendor. - * @member {string} [premierAddOnOfferName] Premier add on offer Name. * @member {boolean} [promoCodeRequired] true if promotion code is * required; otherwise, false. * @member {number} [quota] Premier add on offer Quota. @@ -3611,7 +3885,6 @@ export interface PremierAddOnOffer extends ProxyOnlyResource { sku?: string; product?: string; vendor?: string; - premierAddOnOfferName?: string; promoCodeRequired?: boolean; quota?: number; webHostingPlanRestrictions?: string; @@ -3685,14 +3958,12 @@ export interface SkuInfos { * @constructor * The source control OAuth token. * - * @member {string} [sourceControlName] Name or source control type. * @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 { - sourceControlName?: string; token?: string; tokenSecret?: string; refreshToken?: string; @@ -3720,6 +3991,8 @@ export interface SourceControl extends ProxyOnlyResource { * 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; @@ -3731,6 +4004,7 @@ export interface ValidateRequest { isSpot?: boolean; capacity?: number; hostingEnvironment?: string; + isXenon?: boolean; } /** @@ -4018,7 +4292,6 @@ export interface BackupSchedule { * @constructor * Description of a backup which will be performed. * - * @member {string} backupRequestName 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. @@ -4041,16 +4314,12 @@ export interface BackupSchedule { * @member {date} [backupSchedule.lastExecutionTime] Last time when this * schedule was triggered. * @member {array} [databases] Databases included in the backup. - * @member {string} [backupRequestType] Type of the backup. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' */ export interface BackupRequest extends ProxyOnlyResource { - backupRequestName: string; enabled?: boolean; storageAccountUrl: string; backupSchedule?: BackupSchedule; databases?: DatabaseBackupSetting[]; - backupRequestType?: string; } /** @@ -4091,13 +4360,11 @@ export interface ConnectionStringDictionary extends ProxyOnlyResource { * 'Initializing', 'Starting', 'Running', 'PendingRestart', 'Stopped' * @member {string} [detailedStatus] Detailed status. * @member {string} [logUrl] Log URL. - * @member {string} [continuousWebJobName] Job name. Used as job identifier in - * ARM resource URI. * @member {string} [runCommand] Run command. * @member {string} [url] Job URL. * @member {string} [extraInfoUrl] Extra Info URL. - * @member {string} [jobType] Job type. Possible values include: 'Continuous', - * 'Triggered' + * @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. @@ -4106,11 +4373,10 @@ export interface ContinuousWebJob extends ProxyOnlyResource { status?: string; detailedStatus?: string; logUrl?: string; - readonly continuousWebJobName?: string; runCommand?: string; url?: string; extraInfoUrl?: string; - jobType?: string; + webJobType?: string; error?: string; usingSdk?: boolean; settings?: { [propertyName: string]: any }; @@ -4201,13 +4467,33 @@ export interface CustomHostnameAnalysisResult extends ProxyOnlyResource { 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 {string} [deploymentId] Identifier for deployment. * @member {number} [status] Deployment status. * @member {string} [message] Details about deployment status. * @member {string} [author] Who authored the deployment. @@ -4220,7 +4506,6 @@ export interface CustomHostnameAnalysisResult extends ProxyOnlyResource { * @member {string} [details] Details on deployment. */ export interface Deployment extends ProxyOnlyResource { - deploymentId?: string; status?: number; message?: string; author?: string; @@ -4273,7 +4558,6 @@ export interface FileSystemHttpLogsConfig { * @constructor * Web Job Information. * - * @member {string} [functionEnvelopeName] Function name. * @member {string} [functionAppId] Function App ID. * @member {string} [scriptRootPathHref] Script root path URI. * @member {string} [scriptHref] Script URI. @@ -4286,8 +4570,7 @@ export interface FileSystemHttpLogsConfig { * Portal. */ export interface FunctionEnvelope extends ProxyOnlyResource { - readonly functionEnvelopeName?: string; - readonly functionAppId?: string; + functionAppId?: string; scriptRootPathHref?: string; scriptHref?: string; configHref?: string; @@ -4565,13 +4848,11 @@ export interface NetworkFeatures extends ProxyOnlyResource { * @member {string} [instanceName] Name of the server on which the measurement * is made. * @member {number} [value] Value of counter at a certain time. - * @member {number} [coreCount] Core Count of worker. Not a data member */ export interface PerfMonSample { time?: Date; instanceName?: string; value?: number; - coreCount?: number; } /** @@ -4626,9 +4907,6 @@ export interface PerfMonResponse { * @member {string} [sku] Premier add on SKU. * @member {string} [product] Premier add on Product. * @member {string} [vendor] Premier add on Vendor. - * @member {string} [premierAddOnName] Premier add on Name. - * @member {string} [premierAddOnLocation] Premier add on Location. - * @member {object} [premierAddOnTags] Premier add on Tags. * @member {string} [marketplacePublisher] Premier add on Marketplace * publisher. * @member {string} [marketplaceOffer] Premier add on Marketplace offer. @@ -4637,20 +4915,88 @@ export interface PremierAddOn extends Resource { sku?: string; product?: string; vendor?: string; - premierAddOnName?: string; - premierAddOnLocation?: string; - premierAddOnTags?: { [propertyName: string]: 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} [processThreadInfoId] ARM Identifier for deployment. + * @member {number} [identifier] Site extension ID. * @member {string} [href] HRef URI. * @member {string} [process] Process URI. * @member {string} [startAddress] Start address. @@ -4665,7 +5011,7 @@ export interface PremierAddOn extends Resource { * @member {string} [waitReason] Wait reason. */ export interface ProcessThreadInfo extends ProxyOnlyResource { - processThreadInfoId?: number; + readonly identifier?: number; href?: string; process?: string; startAddress?: string; @@ -4719,10 +5065,10 @@ export interface ProcessModuleInfo extends ProxyOnlyResource { * @constructor * Process Information. * - * @member {number} [processInfoId] ARM Identifier for deployment. - * @member {string} [processInfoName] Deployment name. + * @member {number} [identifier] ARM Identifier for deployment. + * @member {string} [deploymentName] Deployment name. * @member {string} [href] HRef URI. - * @member {string} [miniDump] Minidump 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). @@ -4738,29 +5084,29 @@ export interface ProcessModuleInfo extends ProxyOnlyResource { * @member {number} [moduleCount] Module count. * @member {number} [threadCount] Thread count. * @member {date} [startTime] Start time. - * @member {string} [totalProcessorTime] Total CPU time. - * @member {string} [userProcessorTime] User CPU time. - * @member {string} [privilegedProcessorTime] Privileged CPU time. - * @member {number} [workingSet64] Working set. - * @member {number} [peakWorkingSet64] Peak working set. - * @member {number} [privateMemorySize64] Private memory size. - * @member {number} [virtualMemorySize64] Virtual memory size. - * @member {number} [peakVirtualMemorySize64] Peak virtual memory usage. - * @member {number} [pagedSystemMemorySize64] Paged system memory. - * @member {number} [nonpagedSystemMemorySize64] Non-paged system memory. - * @member {number} [pagedMemorySize64] Paged memory. - * @member {number} [peakPagedMemorySize64] Peak paged memory. + * @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 {boolean} [isWebjob] Is this a Web Job? * @member {string} [description] Description of process. */ export interface ProcessInfo extends ProxyOnlyResource { - processInfoId?: number; - processInfoName?: string; + readonly identifier?: number; + deploymentName?: string; href?: string; - miniDump?: string; + minidump?: string; isProfileRunning?: boolean; isIisProfileRunning?: boolean; iisProfileTimeoutInSeconds?: number; @@ -4776,22 +5122,22 @@ export interface ProcessInfo extends ProxyOnlyResource { moduleCount?: number; threadCount?: number; startTime?: Date; - totalProcessorTime?: string; - userProcessorTime?: string; - privilegedProcessorTime?: string; - workingSet64?: number; - peakWorkingSet64?: number; - privateMemorySize64?: number; - virtualMemorySize64?: number; - peakVirtualMemorySize64?: number; - pagedSystemMemorySize64?: number; - nonpagedSystemMemorySize64?: number; - pagedMemorySize64?: number; - peakPagedMemorySize64?: number; + 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; + isWebjob?: boolean; description?: string; } @@ -4837,7 +5183,8 @@ export interface PublicCertificate extends ProxyOnlyResource { * @member {string} [appServicePlan] Specify app service plan that will own * restored site. * @member {string} [operationType] Operation type. Possible values include: - * 'Default', 'Clone', 'Relocation', 'Snapshot'. Default value: 'Default' . + * 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS'. Default value: + * 'Default' . * @member {boolean} [adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, * false. @@ -4858,19 +5205,6 @@ export interface RestoreRequest extends ProxyOnlyResource { hostingEnvironment?: string; } -/** - * @class - * Initializes a new instance of the RestoreResponse class. - * @constructor - * Response for an app restore request. - * - * @member {string} [operationId] When server starts the restore process, it - * will return an operation ID identifying that particular restore operation. - */ -export interface RestoreResponse extends ProxyOnlyResource { - readonly operationId?: string; -} - /** * @class * Initializes a new instance of the SiteAuthSettings class. @@ -4930,6 +5264,8 @@ export interface RestoreResponse extends ProxyOnlyResource { * 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 @@ -5005,6 +5341,7 @@ export interface SiteAuthSettings extends ProxyOnlyResource { clientId?: string; clientSecret?: string; issuer?: string; + validateIssuer?: boolean; allowedAudiences?: string[]; additionalLoginParams?: string[]; googleClientId?: string; @@ -5071,6 +5408,7 @@ export interface SiteCloneability { * @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 @@ -5181,7 +5519,19 @@ export interface SiteCloneability { * @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; @@ -5191,6 +5541,7 @@ export interface SiteConfigResource extends ProxyOnlyResource { pythonVersion?: string; nodeVersion?: string; linuxFxVersion?: string; + windowsFxVersion?: string; requestTracingEnabled?: boolean; requestTracingExpirationTime?: Date; remoteDebuggingEnabled?: boolean; @@ -5226,7 +5577,13 @@ export interface SiteConfigResource extends ProxyOnlyResource { apiDefinition?: ApiDefinitionInfo; autoSwapSlotName?: string; localMySqlEnabled?: boolean; + managedServiceIdentityId?: number; + xManagedServiceIdentityId?: number; ipSecurityRestrictions?: IpSecurityRestriction[]; + http20Enabled?: boolean; + minTlsVersion?: string; + ftpsState?: string; + reservedInstanceCount?: number; } /** @@ -5236,11 +5593,11 @@ export interface SiteConfigResource extends ProxyOnlyResource { * A snapshot of a web app configuration. * * @member {date} [time] The time the snapshot was taken. - * @member {number} [siteConfigurationSnapshotInfoId] The id of the snapshot + * @member {number} [snapshotId] The id of the snapshot */ export interface SiteConfigurationSnapshotInfo extends ProxyOnlyResource { readonly time?: Date; - readonly siteConfigurationSnapshotInfoId?: number; + readonly snapshotId?: number; } /** @@ -5249,10 +5606,10 @@ export interface SiteConfigurationSnapshotInfo extends ProxyOnlyResource { * @constructor * Site Extension Information. * - * @member {string} [siteExtensionInfoId] Site extension ID. - * @member {string} [title] Site extension title. - * @member {string} [siteExtensionInfoType] Site extension type. Possible - * values include: 'Gallery', 'WebRoot' + * @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. @@ -5262,7 +5619,8 @@ export interface SiteConfigurationSnapshotInfo extends ProxyOnlyResource { * @member {string} [licenseUrl] License URL. * @member {string} [feedUrl] Feed URL. * @member {array} [authors] List of authors. - * @member {string} [installationArgs] Installer command line parameters. + * @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 @@ -5273,9 +5631,9 @@ export interface SiteConfigurationSnapshotInfo extends ProxyOnlyResource { * @member {string} [comment] Site Extension comment. */ export interface SiteExtensionInfo extends ProxyOnlyResource { - siteExtensionInfoId?: string; + extensionId?: string; title?: string; - siteExtensionInfoType?: string; + extensionType?: string; summary?: string; description?: string; version?: string; @@ -5285,7 +5643,7 @@ export interface SiteExtensionInfo extends ProxyOnlyResource { licenseUrl?: string; feedUrl?: string; authors?: string[]; - installationArgs?: string; + installerCommandLineParams?: string; publishedDateTime?: Date; downloadCount?: number; localIsLatestVersion?: boolean; @@ -5399,6 +5757,7 @@ export interface SiteLogsConfig extends ProxyOnlyResource { * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". * @member {boolean} [reserved] true if reserved; otherwise, * false. Default value: false . + * @member {boolean} [isXenon] 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. @@ -5409,6 +5768,8 @@ export interface SiteLogsConfig extends ProxyOnlyResource { * @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 @@ -5530,8 +5891,22 @@ export interface SiteLogsConfig extends ProxyOnlyResource { * @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) @@ -5602,29 +5977,6 @@ export interface SiteLogsConfig extends ProxyOnlyResource { * @member {string} [cloningInfo.trafficManagerProfileName] Name of Traffic * Manager profile to create. This is only needed if Traffic Manager profile * does not already exist. - * @member {boolean} [cloningInfo.ignoreQuotas] true if quotas - * should be ignored; otherwise, false. - * @member {object} [snapshotInfo] If specified during app creation, the app is - * created from a previous snapshot. - * @member {string} [snapshotInfo.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * @member {object} [snapshotInfo.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * @member {string} [snapshotInfo.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * @member {string} [snapshotInfo.recoveryTarget.id] ARM resource ID of the - * target 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} [snapshotInfo.overwrite] If true the recovery - * operation can overwrite source app; otherwise, false. - * @member {boolean} [snapshotInfo.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * @member {boolean} [snapshotInfo.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. * @member {string} [resourceGroup] Name of the resource group the app belongs * to. Read-only. * @member {boolean} [isDefaultContainer] true if the app is a @@ -5653,6 +6005,7 @@ export interface SitePatchResource extends ProxyOnlyResource { hostNameSslStates?: HostNameSslState[]; serverFarmId?: string; reserved?: boolean; + isXenon?: boolean; readonly lastModifiedTimeUtc?: Date; siteConfig?: SiteConfig; readonly trafficManagerHostNames?: string[]; @@ -5669,7 +6022,6 @@ export interface SitePatchResource extends ProxyOnlyResource { readonly suspendedTill?: Date; readonly maxNumberOfWorkers?: number; cloningInfo?: CloningInfo; - snapshotInfo?: SnapshotRecoveryRequest; readonly resourceGroup?: string; readonly isDefaultContainer?: boolean; readonly defaultHostName?: string; @@ -5740,8 +6092,8 @@ export interface SlotConfigNamesResource extends ProxyOnlyResource { * @constructor * A setting difference between two deployment slots of an app. * - * @member {string} [slotDifferenceType] Type of the difference: Information, - * Warning or Error. + * @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 @@ -5754,7 +6106,7 @@ export interface SlotConfigNamesResource extends ProxyOnlyResource { * @member {string} [description] Description of the setting difference. */ export interface SlotDifference extends ProxyOnlyResource { - readonly slotDifferenceType?: string; + readonly level?: string; readonly settingType?: string; readonly diffRule?: string; readonly settingName?: string; @@ -5765,14 +6117,55 @@ export interface SlotDifference extends ProxyOnlyResource { /** * @class - * Initializes a new instance of the Snapshot class. + * Initializes a new instance of the SnapshotRecoverySource class. * @constructor - * A snapshot of an app. + * Specifies the web app that snapshot contents will be retrieved from. * - * @member {string} [time] The time the snapshot was taken. + * @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 Snapshot extends ProxyOnlyResource { - readonly time?: string; +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; } /** @@ -5822,14 +6215,32 @@ 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} [triggeredJobRunId] Job ID. - * @member {string} [triggeredJobRunName] Job name. + * @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. @@ -5842,8 +6253,8 @@ export interface StringDictionary extends ProxyOnlyResource { * @member {string} [trigger] Job trigger. */ export interface TriggeredJobRun extends ProxyOnlyResource { - triggeredJobRunId?: string; - readonly triggeredJobRunName?: string; + webJobId?: string; + webJobName?: string; status?: string; startTime?: Date; endTime?: Date; @@ -5862,10 +6273,10 @@ export interface TriggeredJobRun extends ProxyOnlyResource { * Triggered Web Job History. List of Triggered Web Job Run Information * elements. * - * @member {array} [triggeredJobRuns] List of triggered web job runs. + * @member {array} [runs] List of triggered web job runs. */ export interface TriggeredJobHistory extends ProxyOnlyResource { - triggeredJobRuns?: TriggeredJobRun[]; + runs?: TriggeredJobRun[]; } /** @@ -5875,8 +6286,8 @@ export interface TriggeredJobHistory extends ProxyOnlyResource { * Triggered Web Job Information. * * @member {object} [latestRun] Latest job run information. - * @member {string} [latestRun.triggeredJobRunId] Job ID. - * @member {string} [latestRun.triggeredJobRunName] Job name. + * @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. @@ -5889,13 +6300,11 @@ export interface TriggeredJobHistory extends ProxyOnlyResource { * @member {string} [latestRun.trigger] Job trigger. * @member {string} [historyUrl] History URL. * @member {string} [schedulerLogsUrl] Scheduler Logs URL. - * @member {string} [triggeredWebJobName] Job name. Used as job identifier in - * ARM resource URI. * @member {string} [runCommand] Run command. * @member {string} [url] Job URL. * @member {string} [extraInfoUrl] Extra Info URL. - * @member {string} [jobType] Job type. Possible values include: 'Continuous', - * 'Triggered' + * @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. @@ -5904,11 +6313,10 @@ export interface TriggeredWebJob extends ProxyOnlyResource { latestRun?: TriggeredJobRun; historyUrl?: string; schedulerLogsUrl?: string; - readonly triggeredWebJobName?: string; runCommand?: string; url?: string; extraInfoUrl?: string; - jobType?: string; + webJobType?: string; error?: string; usingSdk?: boolean; settings?: { [propertyName: string]: any }; @@ -5920,23 +6328,20 @@ export interface TriggeredWebJob extends ProxyOnlyResource { * @constructor * Web Job Information. * - * @member {string} [webJobName] Job name. Used as job identifier in ARM - * resource URI. * @member {string} [runCommand] Run command. * @member {string} [url] Job URL. * @member {string} [extraInfoUrl] Extra Info URL. - * @member {string} [jobType] Job type. Possible values include: 'Continuous', - * 'Triggered' + * @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 { - readonly webJobName?: string; runCommand?: string; url?: string; extraInfoUrl?: string; - jobType?: string; + webJobType?: string; error?: string; usingSdk?: boolean; settings?: { [propertyName: string]: any }; @@ -6046,6 +6451,12 @@ export interface AddressResponse { * 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; @@ -6084,6 +6495,9 @@ export interface AppServiceEnvironmentResource extends Resource { dynamicCacheEnabled?: boolean; clusterSettings?: NameValuePair[]; userWhitelistedIpRanges?: string[]; + hasLinuxWorkers?: boolean; + sslCertKeyVaultId?: string; + sslCertKeyVaultSecretName?: string; } /** @@ -6170,6 +6584,12 @@ export interface AppServiceEnvironmentResource extends Resource { * 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; @@ -6208,6 +6628,9 @@ export interface AppServiceEnvironmentPatchResource extends ProxyOnlyResource { dynamicCacheEnabled?: boolean; clusterSettings?: NameValuePair[]; userWhitelistedIpRanges?: string[]; + hasLinuxWorkers?: boolean; + sslCertKeyVaultId?: string; + sslCertKeyVaultSecretName?: string; } /** @@ -6244,7 +6667,6 @@ export interface MetricAvailabilily { * @constructor * Metadata for a metric. * - * @member {string} [metricDefinitionName] Name of the metric. * @member {string} [unit] Unit of the metric. * @member {string} [primaryAggregationType] Primary aggregation type. * @member {array} [metricAvailabilities] List of time grains supported for the @@ -6252,7 +6674,6 @@ export interface MetricAvailabilily { * @member {string} [displayName] Friendly name shown in the UI. */ export interface MetricDefinition extends ProxyOnlyResource { - readonly metricDefinitionName?: string; readonly unit?: string; readonly primaryAggregationType?: string; readonly metricAvailabilities?: MetricAvailabilily[]; @@ -6309,7 +6730,6 @@ export interface SkuInfo { * Usage of the quota resource. * * @member {string} [displayName] Friendly name shown in the UI. - * @member {string} [usageName] Name of the quota. * @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. @@ -6321,7 +6741,6 @@ export interface SkuInfo { */ export interface Usage extends ProxyOnlyResource { readonly displayName?: string; - readonly usageName?: string; readonly resourceName?: string; readonly unit?: string; readonly currentValue?: number; @@ -6381,8 +6800,6 @@ export interface WorkerPoolResource extends ProxyOnlyResource { * @constructor * ARM resource for a app service plan. * - * @member {string} appServicePlanPatchResourceName Name for the 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: @@ -6410,9 +6827,13 @@ export interface WorkerPoolResource extends ProxyOnlyResource { * 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] 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 @@ -6420,7 +6841,6 @@ export interface WorkerPoolResource extends ProxyOnlyResource { * 'InProgress', 'Deleting' */ export interface AppServicePlanPatchResource extends ProxyOnlyResource { - appServicePlanPatchResourceName: string; workerTierName?: string; readonly status?: string; readonly subscription?: string; @@ -6432,8 +6852,10 @@ export interface AppServicePlanPatchResource extends ProxyOnlyResource { readonly numberOfSites?: number; isSpot?: boolean; spotExpirationTime?: Date; + freeOfferExpirationTime?: Date; readonly resourceGroup?: string; reserved?: boolean; + isXenon?: boolean; targetWorkerCount?: number; targetWorkerSizeId?: number; readonly provisioningState?: string; @@ -6575,6 +6997,18 @@ 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. @@ -6611,6 +7045,30 @@ 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. @@ -6623,6 +7081,18 @@ 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. @@ -6717,7 +7187,7 @@ export interface SiteConfigurationSnapshotInfoCollection extends Array { - nextLink?: string; + readonly nextLink?: string; } /** @@ -7006,7 +7476,7 @@ export interface UsageCollection extends Array { * @member {string} [nextLink] Link to next page of resources. */ export interface AppServicePlanCollection extends Array { - nextLink?: string; + readonly nextLink?: string; } /** diff --git a/lib/services/webSiteManagement2/lib/models/index.js b/lib/services/webSiteManagement2/lib/models/index.js index 8064929b84..af3e9c3c98 100644 --- a/lib/services/webSiteManagement2/lib/models/index.js +++ b/lib/services/webSiteManagement2/lib/models/index.js @@ -36,10 +36,8 @@ exports.VnetRoute = require('./vnetRoute'); exports.VnetInfo = require('./vnetInfo'); exports.VnetGateway = require('./vnetGateway'); exports.User = require('./user'); -exports.SnapshotRecoveryTarget = require('./snapshotRecoveryTarget'); -exports.SnapshotRecoveryRequest = require('./snapshotRecoveryRequest'); +exports.Snapshot = require('./snapshot'); exports.ResourceMetricAvailability = require('./resourceMetricAvailability'); -exports.ResourceMetricName = require('./resourceMetricName'); exports.ResourceMetricDefinition = require('./resourceMetricDefinition'); exports.PushSettings = require('./pushSettings'); exports.Identifier = require('./identifier'); @@ -75,7 +73,11 @@ 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'); @@ -106,12 +108,13 @@ exports.NetworkAccessControlEntry = require('./networkAccessControlEntry'); exports.AppServiceEnvironment = require('./appServiceEnvironment'); exports.LocalizableString = require('./localizableString'); exports.CsmUsageQuota = require('./csmUsageQuota'); +exports.DeletedSite = require('./deletedSite'); 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.DeletedSite = require('./deletedSite'); exports.Solution = require('./solution'); exports.DetectorAbnormalTimePeriod = require('./detectorAbnormalTimePeriod'); exports.AbnormalTimePeriod = require('./abnormalTimePeriod'); @@ -122,11 +125,21 @@ 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'); @@ -158,6 +171,7 @@ 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'); @@ -177,12 +191,15 @@ 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.RestoreResponse = require('./restoreResponse'); exports.SiteAuthSettings = require('./siteAuthSettings'); exports.SiteCloneabilityCriterion = require('./siteCloneabilityCriterion'); exports.SiteCloneability = require('./siteCloneability'); @@ -196,10 +213,12 @@ exports.SitePhpErrorLogFlag = require('./sitePhpErrorLogFlag'); exports.SiteSourceControl = require('./siteSourceControl'); exports.SlotConfigNamesResource = require('./slotConfigNamesResource'); exports.SlotDifference = require('./slotDifference'); -exports.Snapshot = require('./snapshot'); +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'); @@ -225,10 +244,14 @@ 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'); diff --git a/lib/services/webSiteManagement2/lib/models/ipSecurityRestriction.js b/lib/services/webSiteManagement2/lib/models/ipSecurityRestriction.js index c9589edfc8..7442dc0ebd 100644 --- a/lib/services/webSiteManagement2/lib/models/ipSecurityRestriction.js +++ b/lib/services/webSiteManagement2/lib/models/ipSecurityRestriction.js @@ -19,8 +19,18 @@ 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() { } @@ -52,6 +62,42 @@ class IpSecurityRestriction { 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' + } } } } 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/managedServiceIdentity.js b/lib/services/webSiteManagement2/lib/models/managedServiceIdentity.js index 4bb8498080..1729031497 100644 --- a/lib/services/webSiteManagement2/lib/models/managedServiceIdentity.js +++ b/lib/services/webSiteManagement2/lib/models/managedServiceIdentity.js @@ -17,9 +17,12 @@ class ManagedServiceIdentity { /** * Create a ManagedServiceIdentity. - * @member {object} [type] Type of 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. */ constructor() { } @@ -42,7 +45,7 @@ class ManagedServiceIdentity { required: false, serializedName: 'type', type: { - name: 'Object' + name: 'String' } }, tenantId: { @@ -60,6 +63,20 @@ class ManagedServiceIdentity { type: { name: 'String' } + }, + identityIds: { + required: false, + serializedName: 'identityIds', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'StringElementType', + type: { + name: 'String' + } + } + } } } } diff --git a/lib/services/webSiteManagement2/lib/models/metricDefinition.js b/lib/services/webSiteManagement2/lib/models/metricDefinition.js index 7ef23aa4c1..e42fa83b2a 100644 --- a/lib/services/webSiteManagement2/lib/models/metricDefinition.js +++ b/lib/services/webSiteManagement2/lib/models/metricDefinition.js @@ -20,7 +20,6 @@ const models = require('./index'); class MetricDefinition extends models['ProxyOnlyResource'] { /** * Create a MetricDefinition. - * @member {string} [metricDefinitionName] Name of the metric. * @member {string} [unit] Unit of the metric. * @member {string} [primaryAggregationType] Primary aggregation type. * @member {array} [metricAvailabilities] List of time grains supported for @@ -76,14 +75,6 @@ class MetricDefinition extends models['ProxyOnlyResource'] { name: 'String' } }, - metricDefinitionName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, unit: { required: false, readOnly: true, diff --git a/lib/services/webSiteManagement2/lib/models/perfMonSample.js b/lib/services/webSiteManagement2/lib/models/perfMonSample.js index f7882a7d2e..e88148d9b9 100644 --- a/lib/services/webSiteManagement2/lib/models/perfMonSample.js +++ b/lib/services/webSiteManagement2/lib/models/perfMonSample.js @@ -21,7 +21,6 @@ class PerfMonSample { * @member {string} [instanceName] Name of the server on which the * measurement is made. * @member {number} [value] Value of counter at a certain time. - * @member {number} [coreCount] Core Count of worker. Not a data member */ constructor() { } @@ -60,13 +59,6 @@ class PerfMonSample { type: { name: 'Number' } - }, - coreCount: { - required: false, - serializedName: 'coreCount', - type: { - name: 'Number' - } } } } diff --git a/lib/services/webSiteManagement2/lib/models/premierAddOn.js b/lib/services/webSiteManagement2/lib/models/premierAddOn.js index ac3d6c9e2f..c0db87d43b 100644 --- a/lib/services/webSiteManagement2/lib/models/premierAddOn.js +++ b/lib/services/webSiteManagement2/lib/models/premierAddOn.js @@ -23,9 +23,6 @@ class PremierAddOn extends models['Resource'] { * @member {string} [sku] Premier add on SKU. * @member {string} [product] Premier add on Product. * @member {string} [vendor] Premier add on Vendor. - * @member {string} [premierAddOnName] Premier add on Name. - * @member {string} [premierAddOnLocation] Premier add on Location. - * @member {object} [premierAddOnTags] Premier add on Tags. * @member {string} [marketplacePublisher] Premier add on Marketplace * publisher. * @member {string} [marketplaceOffer] Premier add on Marketplace offer. @@ -121,34 +118,6 @@ class PremierAddOn extends models['Resource'] { name: 'String' } }, - premierAddOnName: { - required: false, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, - premierAddOnLocation: { - required: false, - serializedName: 'properties.location', - type: { - name: 'String' - } - }, - premierAddOnTags: { - required: false, - serializedName: 'properties.tags', - type: { - name: 'Dictionary', - value: { - required: false, - serializedName: 'StringElementType', - type: { - name: 'String' - } - } - } - }, marketplacePublisher: { required: false, serializedName: 'properties.marketplacePublisher', diff --git a/lib/services/webSiteManagement2/lib/models/premierAddOnOffer.js b/lib/services/webSiteManagement2/lib/models/premierAddOnOffer.js index 2252e8969a..919328a6d8 100644 --- a/lib/services/webSiteManagement2/lib/models/premierAddOnOffer.js +++ b/lib/services/webSiteManagement2/lib/models/premierAddOnOffer.js @@ -23,7 +23,6 @@ class PremierAddOnOffer extends models['ProxyOnlyResource'] { * @member {string} [sku] Premier add on SKU. * @member {string} [product] Premier add on offer Product. * @member {string} [vendor] Premier add on offer Vendor. - * @member {string} [premierAddOnOfferName] Premier add on offer Name. * @member {boolean} [promoCodeRequired] true if promotion code * is required; otherwise, false. * @member {number} [quota] Premier add on offer Quota. @@ -105,13 +104,6 @@ class PremierAddOnOffer extends models['ProxyOnlyResource'] { name: 'String' } }, - premierAddOnOfferName: { - required: false, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, promoCodeRequired: { required: false, serializedName: 'properties.promoCodeRequired', 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/restoreResponse.js b/lib/services/webSiteManagement2/lib/models/privateAccess.js similarity index 55% rename from lib/services/webSiteManagement2/lib/models/restoreResponse.js rename to lib/services/webSiteManagement2/lib/models/privateAccess.js index a3f06ae56a..b85b137319 100644 --- a/lib/services/webSiteManagement2/lib/models/restoreResponse.js +++ b/lib/services/webSiteManagement2/lib/models/privateAccess.js @@ -13,33 +13,34 @@ const models = require('./index'); /** - * Response for an app restore request. + * Description of the parameters of Private Access for a Web Site. * * @extends models['ProxyOnlyResource'] */ -class RestoreResponse extends models['ProxyOnlyResource'] { +class PrivateAccess extends models['ProxyOnlyResource'] { /** - * Create a RestoreResponse. - * @member {string} [operationId] When server starts the restore process, it - * will return an operation ID identifying that particular restore operation. + * 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 RestoreResponse + * Defines the metadata of PrivateAccess * - * @returns {object} metadata of RestoreResponse + * @returns {object} metadata of PrivateAccess * */ mapper() { return { required: false, - serializedName: 'RestoreResponse', + serializedName: 'PrivateAccess', type: { name: 'Composite', - className: 'RestoreResponse', + className: 'PrivateAccess', modelProperties: { id: { required: false, @@ -72,12 +73,26 @@ class RestoreResponse extends models['ProxyOnlyResource'] { name: 'String' } }, - operationId: { + enabled: { required: false, - readOnly: true, - serializedName: 'properties.operationId', + serializedName: 'properties.enabled', type: { - name: 'String' + name: 'Boolean' + } + }, + virtualNetworks: { + required: false, + serializedName: 'properties.virtualNetworks', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'PrivateAccessVirtualNetworkElementType', + type: { + name: 'Composite', + className: 'PrivateAccessVirtualNetwork' + } + } } } } @@ -86,4 +101,4 @@ class RestoreResponse extends models['ProxyOnlyResource'] { } } -module.exports = RestoreResponse; +module.exports = PrivateAccess; diff --git a/lib/services/websiteManagement2/lib/models/errorResponse.js b/lib/services/webSiteManagement2/lib/models/privateAccessSubnet.js similarity index 53% rename from lib/services/websiteManagement2/lib/models/errorResponse.js rename to lib/services/webSiteManagement2/lib/models/privateAccessSubnet.js index 32e994231a..8390dc0093 100644 --- a/lib/services/websiteManagement2/lib/models/errorResponse.js +++ b/lib/services/webSiteManagement2/lib/models/privateAccessSubnet.js @@ -11,45 +11,45 @@ 'use strict'; /** - * Error Response. + * Description of a Virtual Network subnet that is useable for private site + * access. * */ -class ErrorResponse { +class PrivateAccessSubnet { /** - * Create a ErrorResponse. - * @member {string} [code] Error code. - * @member {string} [message] Error message indicating why the operation - * failed. + * 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 ErrorResponse + * Defines the metadata of PrivateAccessSubnet * - * @returns {object} metadata of ErrorResponse + * @returns {object} metadata of PrivateAccessSubnet * */ mapper() { return { required: false, - serializedName: 'ErrorResponse', + serializedName: 'PrivateAccessSubnet', type: { name: 'Composite', - className: 'ErrorResponse', + className: 'PrivateAccessSubnet', modelProperties: { - code: { + name: { required: false, - serializedName: 'code', + serializedName: 'name', type: { name: 'String' } }, - message: { + key: { required: false, - serializedName: 'message', + serializedName: 'key', type: { - name: 'String' + name: 'Number' } } } @@ -58,4 +58,4 @@ class ErrorResponse { } } -module.exports = ErrorResponse; +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..635dd40054 --- /dev/null +++ b/lib/services/webSiteManagement2/lib/models/privateAccessVirtualNetwork.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'); + +/** + * 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 index 094583fabf..1fc4d90c98 100644 --- a/lib/services/webSiteManagement2/lib/models/processInfo.js +++ b/lib/services/webSiteManagement2/lib/models/processInfo.js @@ -20,10 +20,10 @@ const models = require('./index'); class ProcessInfo extends models['ProxyOnlyResource'] { /** * Create a ProcessInfo. - * @member {number} [processInfoId] ARM Identifier for deployment. - * @member {string} [processInfoName] Deployment name. + * @member {number} [identifier] ARM Identifier for deployment. + * @member {string} [deploymentName] Deployment name. * @member {string} [href] HRef URI. - * @member {string} [miniDump] Minidump 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 @@ -40,22 +40,22 @@ class ProcessInfo extends models['ProxyOnlyResource'] { * @member {number} [moduleCount] Module count. * @member {number} [threadCount] Thread count. * @member {date} [startTime] Start time. - * @member {string} [totalProcessorTime] Total CPU time. - * @member {string} [userProcessorTime] User CPU time. - * @member {string} [privilegedProcessorTime] Privileged CPU time. - * @member {number} [workingSet64] Working set. - * @member {number} [peakWorkingSet64] Peak working set. - * @member {number} [privateMemorySize64] Private memory size. - * @member {number} [virtualMemorySize64] Virtual memory size. - * @member {number} [peakVirtualMemorySize64] Peak virtual memory usage. - * @member {number} [pagedSystemMemorySize64] Paged system memory. - * @member {number} [nonpagedSystemMemorySize64] Non-paged system memory. - * @member {number} [pagedMemorySize64] Paged memory. - * @member {number} [peakPagedMemorySize64] Peak paged memory. + * @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 {boolean} [isWebjob] Is this a Web Job? * @member {string} [description] Description of process. */ constructor() { @@ -107,16 +107,17 @@ class ProcessInfo extends models['ProxyOnlyResource'] { name: 'String' } }, - processInfoId: { + identifier: { required: false, - serializedName: 'properties.id', + readOnly: true, + serializedName: 'properties.identifier', type: { name: 'Number' } }, - processInfoName: { + deploymentName: { required: false, - serializedName: 'properties.name', + serializedName: 'properties.deployment_name', type: { name: 'String' } @@ -128,30 +129,30 @@ class ProcessInfo extends models['ProxyOnlyResource'] { name: 'String' } }, - miniDump: { + minidump: { required: false, - serializedName: 'properties.miniDump', + serializedName: 'properties.minidump', type: { name: 'String' } }, isProfileRunning: { required: false, - serializedName: 'properties.isProfileRunning', + serializedName: 'properties.is_profile_running', type: { name: 'Boolean' } }, isIisProfileRunning: { required: false, - serializedName: 'properties.isIisProfileRunning', + serializedName: 'properties.is_iis_profile_running', type: { name: 'Boolean' } }, iisProfileTimeoutInSeconds: { required: false, - serializedName: 'properties.iisProfileTimeoutInSeconds', + serializedName: 'properties.iis_profile_timeout_in_seconds', type: { name: 'Number' } @@ -194,7 +195,7 @@ class ProcessInfo extends models['ProxyOnlyResource'] { }, openFileHandles: { required: false, - serializedName: 'properties.openFileHandles', + serializedName: 'properties.open_file_handles', type: { name: 'Sequence', element: { @@ -223,147 +224,147 @@ class ProcessInfo extends models['ProxyOnlyResource'] { }, fileName: { required: false, - serializedName: 'properties.fileName', + serializedName: 'properties.file_name', type: { name: 'String' } }, commandLine: { required: false, - serializedName: 'properties.commandLine', + serializedName: 'properties.command_line', type: { name: 'String' } }, userName: { required: false, - serializedName: 'properties.userName', + serializedName: 'properties.user_name', type: { name: 'String' } }, handleCount: { required: false, - serializedName: 'properties.handleCount', + serializedName: 'properties.handle_count', type: { name: 'Number' } }, moduleCount: { required: false, - serializedName: 'properties.moduleCount', + serializedName: 'properties.module_count', type: { name: 'Number' } }, threadCount: { required: false, - serializedName: 'properties.threadCount', + serializedName: 'properties.thread_count', type: { name: 'Number' } }, startTime: { required: false, - serializedName: 'properties.startTime', + serializedName: 'properties.start_time', type: { name: 'DateTime' } }, - totalProcessorTime: { + totalCpuTime: { required: false, - serializedName: 'properties.totalProcessorTime', + serializedName: 'properties.total_cpu_time', type: { name: 'String' } }, - userProcessorTime: { + userCpuTime: { required: false, - serializedName: 'properties.userProcessorTime', + serializedName: 'properties.user_cpu_time', type: { name: 'String' } }, - privilegedProcessorTime: { + privilegedCpuTime: { required: false, - serializedName: 'properties.privilegedProcessorTime', + serializedName: 'properties.privileged_cpu_time', type: { name: 'String' } }, - workingSet64: { + workingSet: { required: false, - serializedName: 'properties.workingSet64', + serializedName: 'properties.working_set', type: { name: 'Number' } }, - peakWorkingSet64: { + peakWorkingSet: { required: false, - serializedName: 'properties.peakWorkingSet64', + serializedName: 'properties.peak_working_set', type: { name: 'Number' } }, - privateMemorySize64: { + privateMemory: { required: false, - serializedName: 'properties.privateMemorySize64', + serializedName: 'properties.private_memory', type: { name: 'Number' } }, - virtualMemorySize64: { + virtualMemory: { required: false, - serializedName: 'properties.virtualMemorySize64', + serializedName: 'properties.virtual_memory', type: { name: 'Number' } }, - peakVirtualMemorySize64: { + peakVirtualMemory: { required: false, - serializedName: 'properties.peakVirtualMemorySize64', + serializedName: 'properties.peak_virtual_memory', type: { name: 'Number' } }, - pagedSystemMemorySize64: { + pagedSystemMemory: { required: false, - serializedName: 'properties.pagedSystemMemorySize64', + serializedName: 'properties.paged_system_memory', type: { name: 'Number' } }, - nonpagedSystemMemorySize64: { + nonPagedSystemMemory: { required: false, - serializedName: 'properties.nonpagedSystemMemorySize64', + serializedName: 'properties.non_paged_system_memory', type: { name: 'Number' } }, - pagedMemorySize64: { + pagedMemory: { required: false, - serializedName: 'properties.pagedMemorySize64', + serializedName: 'properties.paged_memory', type: { name: 'Number' } }, - peakPagedMemorySize64: { + peakPagedMemory: { required: false, - serializedName: 'properties.peakPagedMemorySize64', + serializedName: 'properties.peak_paged_memory', type: { name: 'Number' } }, timeStamp: { required: false, - serializedName: 'properties.timeStamp', + serializedName: 'properties.time_stamp', type: { name: 'DateTime' } }, environmentVariables: { required: false, - serializedName: 'properties.environmentVariables', + serializedName: 'properties.environment_variables', type: { name: 'Dictionary', value: { @@ -377,14 +378,14 @@ class ProcessInfo extends models['ProxyOnlyResource'] { }, isScmSite: { required: false, - serializedName: 'properties.isScmSite', + serializedName: 'properties.is_scm_site', type: { name: 'Boolean' } }, - isWebJob: { + isWebjob: { required: false, - serializedName: 'properties.isWebJob', + serializedName: 'properties.is_webjob', type: { name: 'Boolean' } diff --git a/lib/services/webSiteManagement2/lib/models/processModuleInfo.js b/lib/services/webSiteManagement2/lib/models/processModuleInfo.js index 54334a64cf..610d4bf843 100644 --- a/lib/services/webSiteManagement2/lib/models/processModuleInfo.js +++ b/lib/services/webSiteManagement2/lib/models/processModuleInfo.js @@ -84,14 +84,14 @@ class ProcessModuleInfo extends models['ProxyOnlyResource'] { }, baseAddress: { required: false, - serializedName: 'properties.baseAddress', + serializedName: 'properties.base_address', type: { name: 'String' } }, fileName: { required: false, - serializedName: 'properties.fileName', + serializedName: 'properties.file_name', type: { name: 'String' } @@ -105,28 +105,28 @@ class ProcessModuleInfo extends models['ProxyOnlyResource'] { }, filePath: { required: false, - serializedName: 'properties.filePath', + serializedName: 'properties.file_path', type: { name: 'String' } }, moduleMemorySize: { required: false, - serializedName: 'properties.moduleMemorySize', + serializedName: 'properties.module_memory_size', type: { name: 'Number' } }, fileVersion: { required: false, - serializedName: 'properties.fileVersion', + serializedName: 'properties.file_version', type: { name: 'String' } }, fileDescription: { required: false, - serializedName: 'properties.fileDescription', + serializedName: 'properties.file_description', type: { name: 'String' } @@ -140,14 +140,14 @@ class ProcessModuleInfo extends models['ProxyOnlyResource'] { }, productVersion: { required: false, - serializedName: 'properties.productVersion', + serializedName: 'properties.product_version', type: { name: 'String' } }, isDebug: { required: false, - serializedName: 'properties.isDebug', + serializedName: 'properties.is_debug', type: { name: 'Boolean' } diff --git a/lib/services/webSiteManagement2/lib/models/processThreadInfo.js b/lib/services/webSiteManagement2/lib/models/processThreadInfo.js index ec227556b0..3594604e66 100644 --- a/lib/services/webSiteManagement2/lib/models/processThreadInfo.js +++ b/lib/services/webSiteManagement2/lib/models/processThreadInfo.js @@ -20,7 +20,7 @@ const models = require('./index'); class ProcessThreadInfo extends models['ProxyOnlyResource'] { /** * Create a ProcessThreadInfo. - * @member {number} [processThreadInfoId] ARM Identifier for deployment. + * @member {number} [identifier] Site extension ID. * @member {string} [href] HRef URI. * @member {string} [process] Process URI. * @member {string} [startAddress] Start address. @@ -83,9 +83,10 @@ class ProcessThreadInfo extends models['ProxyOnlyResource'] { name: 'String' } }, - processThreadInfoId: { + identifier: { required: false, - serializedName: 'properties.id', + readOnly: true, + serializedName: 'properties.identifier', type: { name: 'Number' } @@ -106,56 +107,56 @@ class ProcessThreadInfo extends models['ProxyOnlyResource'] { }, startAddress: { required: false, - serializedName: 'properties.startAddress', + serializedName: 'properties.start_address', type: { name: 'String' } }, currentPriority: { required: false, - serializedName: 'properties.currentPriority', + serializedName: 'properties.current_priority', type: { name: 'Number' } }, priorityLevel: { required: false, - serializedName: 'properties.priorityLevel', + serializedName: 'properties.priority_level', type: { name: 'String' } }, basePriority: { required: false, - serializedName: 'properties.basePriority', + serializedName: 'properties.base_priority', type: { name: 'Number' } }, startTime: { required: false, - serializedName: 'properties.startTime', + serializedName: 'properties.start_time', type: { name: 'DateTime' } }, totalProcessorTime: { required: false, - serializedName: 'properties.totalProcessorTime', + serializedName: 'properties.total_processor_time', type: { name: 'String' } }, userProcessorTime: { required: false, - serializedName: 'properties.userProcessorTime', + serializedName: 'properties.user_processor_time', type: { name: 'String' } }, priviledgedProcessorTime: { required: false, - serializedName: 'properties.priviledgedProcessorTime', + serializedName: 'properties.priviledged_processor_time', type: { name: 'String' } @@ -169,7 +170,7 @@ class ProcessThreadInfo extends models['ProxyOnlyResource'] { }, waitReason: { required: false, - serializedName: 'properties.waitReason', + serializedName: 'properties.wait_reason', type: { name: 'String' } diff --git a/lib/services/webSiteManagement2/lib/models/recommendation.js b/lib/services/webSiteManagement2/lib/models/recommendation.js index d680912cb1..8f61433673 100644 --- a/lib/services/webSiteManagement2/lib/models/recommendation.js +++ b/lib/services/webSiteManagement2/lib/models/recommendation.js @@ -10,11 +10,14 @@ 'use strict'; +const models = require('./index'); + /** * Represents a recommendation result generated by the recommendation engine. * + * @extends models['ProxyOnlyResource'] */ -class Recommendation { +class Recommendation extends models['ProxyOnlyResource'] { /** * Create a Recommendation. * @member {date} [creationTime] Timestamp when this instance was created. @@ -35,9 +38,13 @@ class Recommendation { * @member {string} [channels] List of channels that this recommendation can * apply. Possible values include: 'Notification', 'Api', 'Email', 'Webhook', * 'All' - * @member {array} [tags] The list of category tags that this recommendation - * belongs to. + * @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 @@ -58,6 +65,7 @@ class Recommendation { * associated with the rule. */ constructor() { + super(); } /** @@ -74,58 +82,89 @@ class Recommendation { 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: 'creationTime', + serializedName: 'properties.creationTime', type: { name: 'DateTime' } }, recommendationId: { required: false, - serializedName: 'recommendationId', + serializedName: 'properties.recommendationId', type: { name: 'String' } }, resourceId: { required: false, - serializedName: 'resourceId', + serializedName: 'properties.resourceId', type: { name: 'String' } }, resourceScope: { required: false, - serializedName: 'resourceScope', + serializedName: 'properties.resourceScope', type: { name: 'String' } }, ruleName: { required: false, - serializedName: 'ruleName', + serializedName: 'properties.ruleName', type: { name: 'String' } }, displayName: { required: false, - serializedName: 'displayName', + serializedName: 'properties.displayName', type: { name: 'String' } }, message: { required: false, - serializedName: 'message', + serializedName: 'properties.message', type: { name: 'String' } }, level: { required: false, - serializedName: 'level', + serializedName: 'properties.level', type: { name: 'Enum', allowedValues: [ 'Critical', 'Warning', 'Information', 'NonUrgentSuggestion' ] @@ -133,15 +172,16 @@ class Recommendation { }, channels: { required: false, - serializedName: 'channels', + serializedName: 'properties.channels', type: { name: 'Enum', allowedValues: [ 'Notification', 'Api', 'Email', 'Webhook', 'All' ] } }, - tags: { + categoryTags: { required: false, - serializedName: 'tags', + readOnly: true, + serializedName: 'properties.categoryTags', type: { name: 'Sequence', element: { @@ -155,77 +195,98 @@ class Recommendation { }, actionName: { required: false, - serializedName: 'actionName', + 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: 'startTime', + serializedName: 'properties.startTime', type: { name: 'DateTime' } }, endTime: { required: false, - serializedName: 'endTime', + serializedName: 'properties.endTime', type: { name: 'DateTime' } }, nextNotificationTime: { required: false, - serializedName: 'nextNotificationTime', + serializedName: 'properties.nextNotificationTime', type: { name: 'DateTime' } }, notificationExpirationTime: { required: false, - serializedName: 'notificationExpirationTime', + serializedName: 'properties.notificationExpirationTime', type: { name: 'DateTime' } }, notifiedTime: { required: false, - serializedName: 'notifiedTime', + serializedName: 'properties.notifiedTime', type: { name: 'DateTime' } }, score: { required: false, - serializedName: 'score', + serializedName: 'properties.score', type: { name: 'Number' } }, isDynamic: { required: false, - serializedName: 'isDynamic', + serializedName: 'properties.isDynamic', type: { name: 'Boolean' } }, extensionName: { required: false, - serializedName: 'extensionName', + serializedName: 'properties.extensionName', type: { name: 'String' } }, bladeName: { required: false, - serializedName: 'bladeName', + serializedName: 'properties.bladeName', type: { name: 'String' } }, forwardLink: { required: false, - serializedName: 'forwardLink', + serializedName: 'properties.forwardLink', type: { name: 'String' } 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 index 2916f13456..98fedcaa74 100644 --- a/lib/services/webSiteManagement2/lib/models/recommendationRule.js +++ b/lib/services/webSiteManagement2/lib/models/recommendationRule.js @@ -10,14 +10,17 @@ 'use strict'; +const models = require('./index'); + /** * Represents a recommendation rule that the recommendation engine can perform. * + * @extends models['ProxyOnlyResource'] */ -class RecommendationRule { +class RecommendationRule extends models['ProxyOnlyResource'] { /** * Create a RecommendationRule. - * @member {string} [name] Unique name of the rule. + * @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 @@ -32,7 +35,8 @@ class RecommendationRule { * @member {string} [channels] List of available channels that this rule * applies. Possible values include: 'Notification', 'Api', 'Email', * 'Webhook', 'All' - * @member {array} [tags] An array of category tags that the rule contains. + * @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. @@ -43,6 +47,7 @@ class RecommendationRule { * associated with the rule. Applicable to dynamic rule only. */ constructor() { + super(); } /** @@ -59,51 +64,82 @@ class RecommendationRule { 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: 'displayName', + serializedName: 'properties.displayName', type: { name: 'String' } }, message: { required: false, - serializedName: 'message', + serializedName: 'properties.message', type: { name: 'String' } }, recommendationId: { required: false, - serializedName: 'recommendationId', + serializedName: 'properties.recommendationId', type: { name: 'String' } }, description: { required: false, - serializedName: 'description', + serializedName: 'properties.description', type: { name: 'String' } }, actionName: { required: false, - serializedName: 'actionName', + serializedName: 'properties.actionName', type: { name: 'String' } }, level: { required: false, - serializedName: 'level', + serializedName: 'properties.level', type: { name: 'Enum', allowedValues: [ 'Critical', 'Warning', 'Information', 'NonUrgentSuggestion' ] @@ -111,15 +147,16 @@ class RecommendationRule { }, channels: { required: false, - serializedName: 'channels', + serializedName: 'properties.channels', type: { name: 'Enum', allowedValues: [ 'Notification', 'Api', 'Email', 'Webhook', 'All' ] } }, - tags: { + categoryTags: { required: false, - serializedName: 'tags', + readOnly: true, + serializedName: 'properties.categoryTags', type: { name: 'Sequence', element: { @@ -133,28 +170,28 @@ class RecommendationRule { }, isDynamic: { required: false, - serializedName: 'isDynamic', + serializedName: 'properties.isDynamic', type: { name: 'Boolean' } }, extensionName: { required: false, - serializedName: 'extensionName', + serializedName: 'properties.extensionName', type: { name: 'String' } }, bladeName: { required: false, - serializedName: 'bladeName', + serializedName: 'properties.bladeName', type: { name: 'String' } }, forwardLink: { required: false, - serializedName: 'forwardLink', + serializedName: 'properties.forwardLink', type: { name: 'String' } 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/resourceMetricDefinition.js b/lib/services/webSiteManagement2/lib/models/resourceMetricDefinition.js index 86464c5423..8dbe89e1bf 100644 --- a/lib/services/webSiteManagement2/lib/models/resourceMetricDefinition.js +++ b/lib/services/webSiteManagement2/lib/models/resourceMetricDefinition.js @@ -20,16 +20,11 @@ const models = require('./index'); class ResourceMetricDefinition extends models['ProxyOnlyResource'] { /** * Create a ResourceMetricDefinition. - * @member {object} [resourceMetricDefinitionName] Name of the metric. - * @member {string} [resourceMetricDefinitionName.value] metric name value. - * @member {string} [resourceMetricDefinitionName.localizedValue] Localized - * metric name value. * @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 {string} [resourceMetricDefinitionId] Resource ID. * @member {object} [properties] Resource metric definition properties. */ constructor() { @@ -81,15 +76,6 @@ class ResourceMetricDefinition extends models['ProxyOnlyResource'] { name: 'String' } }, - resourceMetricDefinitionName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'Composite', - className: 'ResourceMetricName' - } - }, unit: { required: false, readOnly: true, @@ -130,14 +116,6 @@ class ResourceMetricDefinition extends models['ProxyOnlyResource'] { name: 'String' } }, - resourceMetricDefinitionId: { - required: false, - readOnly: true, - serializedName: 'properties.id', - type: { - name: 'String' - } - }, properties: { required: false, readOnly: true, diff --git a/lib/services/webSiteManagement2/lib/models/restoreRequest.js b/lib/services/webSiteManagement2/lib/models/restoreRequest.js index ed24bafc6a..7ae8aa728c 100644 --- a/lib/services/webSiteManagement2/lib/models/restoreRequest.js +++ b/lib/services/webSiteManagement2/lib/models/restoreRequest.js @@ -39,7 +39,8 @@ class RestoreRequest extends models['ProxyOnlyResource'] { * @member {string} [appServicePlan] Specify app service plan that will own * restored site. * @member {string} [operationType] Operation type. Possible values include: - * 'Default', 'Clone', 'Relocation', 'Snapshot'. Default value: 'Default' . + * 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS'. Default value: + * 'Default' . * @member {boolean} [adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, * false. @@ -167,7 +168,7 @@ class RestoreRequest extends models['ProxyOnlyResource'] { defaultValue: 'Default', type: { name: 'Enum', - allowedValues: [ 'Default', 'Clone', 'Relocation', 'Snapshot' ] + allowedValues: [ 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' ] } }, adjustConnectionStrings: { diff --git a/lib/services/webSiteManagement2/lib/models/serviceSpecification.js b/lib/services/webSiteManagement2/lib/models/serviceSpecification.js index ebb2a7b9a3..77a9cb816e 100644 --- a/lib/services/webSiteManagement2/lib/models/serviceSpecification.js +++ b/lib/services/webSiteManagement2/lib/models/serviceSpecification.js @@ -20,6 +20,7 @@ class ServiceSpecification { /** * Create a ServiceSpecification. * @member {array} [metricSpecifications] + * @member {array} [logSpecifications] */ constructor() { } @@ -52,6 +53,21 @@ class ServiceSpecification { } } } + }, + logSpecifications: { + required: false, + serializedName: 'logSpecifications', + type: { + name: 'Sequence', + element: { + required: false, + serializedName: 'LogSpecificationElementType', + type: { + name: 'Composite', + className: 'LogSpecification' + } + } + } } } } diff --git a/lib/services/webSiteManagement2/lib/models/site.js b/lib/services/webSiteManagement2/lib/models/site.js index 9cbf54cdbf..154c30bf71 100644 --- a/lib/services/webSiteManagement2/lib/models/site.js +++ b/lib/services/webSiteManagement2/lib/models/site.js @@ -42,6 +42,7 @@ class Site extends models['Resource'] { * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". * @member {boolean} [reserved] true if reserved; otherwise, * false. Default value: false . + * @member {boolean} [isXenon] 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. @@ -53,6 +54,8 @@ class Site extends models['Resource'] { * @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 @@ -179,8 +182,22 @@ class Site extends models['Resource'] { * @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 @@ -252,31 +269,6 @@ class Site extends models['Resource'] { * @member {string} [cloningInfo.trafficManagerProfileName] Name of Traffic * Manager profile to create. This is only needed if Traffic Manager profile * does not already exist. - * @member {boolean} [cloningInfo.ignoreQuotas] true if quotas - * should be ignored; otherwise, false. - * @member {object} [snapshotInfo] If specified during app creation, the app - * is created from a previous snapshot. - * @member {string} [snapshotInfo.snapshotTime] Point in time in which the - * app recovery should be attempted, formatted as a DateTime string. - * @member {object} [snapshotInfo.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * @member {string} [snapshotInfo.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * @member {string} [snapshotInfo.recoveryTarget.id] ARM resource ID of the - * target 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} [snapshotInfo.overwrite] If true the - * recovery operation can overwrite source app; otherwise, - * false. - * @member {boolean} [snapshotInfo.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * @member {boolean} [snapshotInfo.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. * @member {string} [resourceGroup] Name of the resource group the app * belongs to. Read-only. * @member {boolean} [isDefaultContainer] true if the app is a @@ -294,10 +286,13 @@ class Site extends models['Resource'] { * only https requests. Issues redirect for * http requests * @member {object} [identity] - * @member {object} [identity.type] Type of managed service 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(); @@ -470,6 +465,14 @@ class Site extends models['Resource'] { name: 'Boolean' } }, + isXenon: { + required: false, + serializedName: 'properties.isXenon', + defaultValue: false, + type: { + name: 'Boolean' + } + }, lastModifiedTimeUtc: { required: false, readOnly: true, @@ -600,14 +603,6 @@ class Site extends models['Resource'] { className: 'CloningInfo' } }, - snapshotInfo: { - required: false, - serializedName: 'properties.snapshotInfo', - type: { - name: 'Composite', - className: 'SnapshotRecoveryRequest' - } - }, resourceGroup: { required: false, readOnly: true, diff --git a/lib/services/webSiteManagement2/lib/models/siteAuthSettings.js b/lib/services/webSiteManagement2/lib/models/siteAuthSettings.js index 977f86f4dc..f35b25393d 100644 --- a/lib/services/webSiteManagement2/lib/models/siteAuthSettings.js +++ b/lib/services/webSiteManagement2/lib/models/siteAuthSettings.js @@ -74,6 +74,8 @@ class SiteAuthSettings extends models['ProxyOnlyResource'] { * 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 @@ -266,6 +268,13 @@ class SiteAuthSettings extends models['ProxyOnlyResource'] { name: 'String' } }, + validateIssuer: { + required: false, + serializedName: 'properties.validateIssuer', + type: { + name: 'Boolean' + } + }, allowedAudiences: { required: false, serializedName: 'properties.allowedAudiences', diff --git a/lib/services/webSiteManagement2/lib/models/siteConfig.js b/lib/services/webSiteManagement2/lib/models/siteConfig.js index 75c1ceff0f..9d2438791d 100644 --- a/lib/services/webSiteManagement2/lib/models/siteConfig.js +++ b/lib/services/webSiteManagement2/lib/models/siteConfig.js @@ -27,6 +27,7 @@ class SiteConfig { * @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 @@ -140,7 +141,19 @@ class SiteConfig { * @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() { } @@ -216,6 +229,13 @@ class SiteConfig { name: 'String' } }, + windowsFxVersion: { + required: false, + serializedName: 'windowsFxVersion', + type: { + name: 'String' + } + }, requestTracingEnabled: { required: false, serializedName: 'requestTracingEnabled', @@ -504,6 +524,20 @@ class SiteConfig { name: 'Boolean' } }, + managedServiceIdentityId: { + required: false, + serializedName: 'managedServiceIdentityId', + type: { + name: 'Number' + } + }, + xManagedServiceIdentityId: { + required: false, + serializedName: 'xManagedServiceIdentityId', + type: { + name: 'Number' + } + }, ipSecurityRestrictions: { required: false, serializedName: 'ipSecurityRestrictions', @@ -518,6 +552,39 @@ class SiteConfig { } } } + }, + 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' + } } } } diff --git a/lib/services/webSiteManagement2/lib/models/siteConfigResource.js b/lib/services/webSiteManagement2/lib/models/siteConfigResource.js index c9a46ad06b..c4f86d257f 100644 --- a/lib/services/webSiteManagement2/lib/models/siteConfigResource.js +++ b/lib/services/webSiteManagement2/lib/models/siteConfigResource.js @@ -28,6 +28,7 @@ class SiteConfigResource extends models['ProxyOnlyResource'] { * @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 @@ -141,7 +142,19 @@ class SiteConfigResource extends models['ProxyOnlyResource'] { * @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(); @@ -249,6 +262,13 @@ class SiteConfigResource extends models['ProxyOnlyResource'] { name: 'String' } }, + windowsFxVersion: { + required: false, + serializedName: 'properties.windowsFxVersion', + type: { + name: 'String' + } + }, requestTracingEnabled: { required: false, serializedName: 'properties.requestTracingEnabled', @@ -537,6 +557,20 @@ class SiteConfigResource extends models['ProxyOnlyResource'] { 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', @@ -551,6 +585,39 @@ class SiteConfigResource extends models['ProxyOnlyResource'] { } } } + }, + 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' + } } } } diff --git a/lib/services/webSiteManagement2/lib/models/siteConfigurationSnapshotInfo.js b/lib/services/webSiteManagement2/lib/models/siteConfigurationSnapshotInfo.js index ab201777eb..1317cb4e81 100644 --- a/lib/services/webSiteManagement2/lib/models/siteConfigurationSnapshotInfo.js +++ b/lib/services/webSiteManagement2/lib/models/siteConfigurationSnapshotInfo.js @@ -21,7 +21,7 @@ class SiteConfigurationSnapshotInfo extends models['ProxyOnlyResource'] { /** * Create a SiteConfigurationSnapshotInfo. * @member {date} [time] The time the snapshot was taken. - * @member {number} [siteConfigurationSnapshotInfoId] The id of the snapshot + * @member {number} [snapshotId] The id of the snapshot */ constructor() { super(); @@ -80,10 +80,10 @@ class SiteConfigurationSnapshotInfo extends models['ProxyOnlyResource'] { name: 'DateTime' } }, - siteConfigurationSnapshotInfoId: { + snapshotId: { required: false, readOnly: true, - serializedName: 'properties.id', + serializedName: 'properties.snapshotId', type: { name: 'Number' } diff --git a/lib/services/webSiteManagement2/lib/models/siteExtensionInfo.js b/lib/services/webSiteManagement2/lib/models/siteExtensionInfo.js index 8cd1cf009f..a0293ee225 100644 --- a/lib/services/webSiteManagement2/lib/models/siteExtensionInfo.js +++ b/lib/services/webSiteManagement2/lib/models/siteExtensionInfo.js @@ -20,10 +20,10 @@ const models = require('./index'); class SiteExtensionInfo extends models['ProxyOnlyResource'] { /** * Create a SiteExtensionInfo. - * @member {string} [siteExtensionInfoId] Site extension ID. - * @member {string} [title] Site extension title. - * @member {string} [siteExtensionInfoType] Site extension type. Possible - * values include: 'Gallery', 'WebRoot' + * @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. @@ -33,7 +33,8 @@ class SiteExtensionInfo extends models['ProxyOnlyResource'] { * @member {string} [licenseUrl] License URL. * @member {string} [feedUrl] Feed URL. * @member {array} [authors] List of authors. - * @member {string} [installationArgs] Installer command line parameters. + * @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 @@ -92,9 +93,9 @@ class SiteExtensionInfo extends models['ProxyOnlyResource'] { name: 'String' } }, - siteExtensionInfoId: { + extensionId: { required: false, - serializedName: 'properties.id', + serializedName: 'properties.extension_id', type: { name: 'String' } @@ -106,9 +107,9 @@ class SiteExtensionInfo extends models['ProxyOnlyResource'] { name: 'String' } }, - siteExtensionInfoType: { + extensionType: { required: false, - serializedName: 'properties.type', + serializedName: 'properties.extension_type', type: { name: 'Enum', allowedValues: [ 'Gallery', 'WebRoot' ] @@ -137,35 +138,35 @@ class SiteExtensionInfo extends models['ProxyOnlyResource'] { }, extensionUrl: { required: false, - serializedName: 'properties.extensionUrl', + serializedName: 'properties.extension_url', type: { name: 'String' } }, projectUrl: { required: false, - serializedName: 'properties.projectUrl', + serializedName: 'properties.project_url', type: { name: 'String' } }, iconUrl: { required: false, - serializedName: 'properties.iconUrl', + serializedName: 'properties.icon_url', type: { name: 'String' } }, licenseUrl: { required: false, - serializedName: 'properties.licenseUrl', + serializedName: 'properties.license_url', type: { name: 'String' } }, feedUrl: { required: false, - serializedName: 'properties.feedUrl', + serializedName: 'properties.feed_url', type: { name: 'String' } @@ -184,44 +185,44 @@ class SiteExtensionInfo extends models['ProxyOnlyResource'] { } } }, - installationArgs: { + installerCommandLineParams: { required: false, - serializedName: 'properties.installationArgs', + serializedName: 'properties.installer_command_line_params', type: { name: 'String' } }, publishedDateTime: { required: false, - serializedName: 'properties.publishedDateTime', + serializedName: 'properties.published_date_time', type: { name: 'DateTime' } }, downloadCount: { required: false, - serializedName: 'properties.downloadCount', + serializedName: 'properties.download_count', type: { name: 'Number' } }, localIsLatestVersion: { required: false, - serializedName: 'properties.localIsLatestVersion', + serializedName: 'properties.local_is_latest_version', type: { name: 'Boolean' } }, localPath: { required: false, - serializedName: 'properties.localPath', + serializedName: 'properties.local_path', type: { name: 'String' } }, installedDateTime: { required: false, - serializedName: 'properties.installedDateTime', + serializedName: 'properties.installed_date_time', type: { name: 'DateTime' } diff --git a/lib/services/webSiteManagement2/lib/models/siteInstance.js b/lib/services/webSiteManagement2/lib/models/siteInstance.js index 850f9772ca..72635c8844 100644 --- a/lib/services/webSiteManagement2/lib/models/siteInstance.js +++ b/lib/services/webSiteManagement2/lib/models/siteInstance.js @@ -74,7 +74,7 @@ class SiteInstance extends models['ProxyOnlyResource'] { siteInstanceName: { required: false, readOnly: true, - serializedName: 'properties.name', + serializedName: 'properties.siteInstanceName', type: { name: 'String' } diff --git a/lib/services/webSiteManagement2/lib/models/sitePatchResource.js b/lib/services/webSiteManagement2/lib/models/sitePatchResource.js index 98ccede026..575bc5a043 100644 --- a/lib/services/webSiteManagement2/lib/models/sitePatchResource.js +++ b/lib/services/webSiteManagement2/lib/models/sitePatchResource.js @@ -42,6 +42,7 @@ class SitePatchResource extends models['ProxyOnlyResource'] { * "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". * @member {boolean} [reserved] true if reserved; otherwise, * false. Default value: false . + * @member {boolean} [isXenon] 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. @@ -53,6 +54,8 @@ class SitePatchResource extends models['ProxyOnlyResource'] { * @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 @@ -179,8 +182,22 @@ class SitePatchResource extends models['ProxyOnlyResource'] { * @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 @@ -252,31 +269,6 @@ class SitePatchResource extends models['ProxyOnlyResource'] { * @member {string} [cloningInfo.trafficManagerProfileName] Name of Traffic * Manager profile to create. This is only needed if Traffic Manager profile * does not already exist. - * @member {boolean} [cloningInfo.ignoreQuotas] true if quotas - * should be ignored; otherwise, false. - * @member {object} [snapshotInfo] If specified during app creation, the app - * is created from a previous snapshot. - * @member {string} [snapshotInfo.snapshotTime] Point in time in which the - * app recovery should be attempted, formatted as a DateTime string. - * @member {object} [snapshotInfo.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * @member {string} [snapshotInfo.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * @member {string} [snapshotInfo.recoveryTarget.id] ARM resource ID of the - * target 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} [snapshotInfo.overwrite] If true the - * recovery operation can overwrite source app; otherwise, - * false. - * @member {boolean} [snapshotInfo.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * @member {boolean} [snapshotInfo.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. * @member {string} [resourceGroup] Name of the resource group the app * belongs to. Read-only. * @member {boolean} [isDefaultContainer] true if the app is a @@ -444,6 +436,14 @@ class SitePatchResource extends models['ProxyOnlyResource'] { name: 'Boolean' } }, + isXenon: { + required: false, + serializedName: 'properties.isXenon', + defaultValue: false, + type: { + name: 'Boolean' + } + }, lastModifiedTimeUtc: { required: false, readOnly: true, @@ -574,14 +574,6 @@ class SitePatchResource extends models['ProxyOnlyResource'] { className: 'CloningInfo' } }, - snapshotInfo: { - required: false, - serializedName: 'properties.snapshotInfo', - type: { - name: 'Composite', - className: 'SnapshotRecoveryRequest' - } - }, resourceGroup: { required: false, readOnly: true, diff --git a/lib/services/webSiteManagement2/lib/models/slotDifference.js b/lib/services/webSiteManagement2/lib/models/slotDifference.js index f20bdff1da..49d154fc4c 100644 --- a/lib/services/webSiteManagement2/lib/models/slotDifference.js +++ b/lib/services/webSiteManagement2/lib/models/slotDifference.js @@ -20,8 +20,8 @@ const models = require('./index'); class SlotDifference extends models['ProxyOnlyResource'] { /** * Create a SlotDifference. - * @member {string} [slotDifferenceType] Type of the difference: Information, - * Warning or Error. + * @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 @@ -82,10 +82,10 @@ class SlotDifference extends models['ProxyOnlyResource'] { name: 'String' } }, - slotDifferenceType: { + level: { required: false, readOnly: true, - serializedName: 'properties.type', + serializedName: 'properties.level', type: { name: 'String' } diff --git a/lib/services/webSiteManagement2/lib/models/snapshotRecoveryRequest.js b/lib/services/webSiteManagement2/lib/models/snapshotRecoveryRequest.js deleted file mode 100644 index e59a088c7c..0000000000 --- a/lib/services/webSiteManagement2/lib/models/snapshotRecoveryRequest.js +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const models = require('./index'); - -/** - * Details about app recovery operation. - * - * @extends models['ProxyOnlyResource'] - */ -class SnapshotRecoveryRequest extends models['ProxyOnlyResource'] { - /** - * Create a SnapshotRecoveryRequest. - * @member {string} [snapshotTime] Point in time in which the app recovery - * should be attempted, formatted as a DateTime string. - * @member {object} [recoveryTarget] Specifies the web app that snapshot - * contents will be written to. - * @member {string} [recoveryTarget.location] Geographical location of the - * target web app, e.g. SouthEastAsia, SouthCentralUS - * @member {string} [recoveryTarget.id] ARM resource ID of the target 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 recovery 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 SnapshotRecoveryRequest - * - * @returns {object} metadata of SnapshotRecoveryRequest - * - */ - mapper() { - return { - required: false, - serializedName: 'SnapshotRecoveryRequest', - type: { - name: 'Composite', - className: 'SnapshotRecoveryRequest', - 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' - } - }, - recoveryTarget: { - required: false, - serializedName: 'properties.recoveryTarget', - type: { - name: 'Composite', - className: 'SnapshotRecoveryTarget' - } - }, - 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 = SnapshotRecoveryRequest; diff --git a/lib/services/websiteManagement2/lib/models/snapshotRecoveryTarget.js b/lib/services/webSiteManagement2/lib/models/snapshotRecoverySource.js similarity index 69% rename from lib/services/websiteManagement2/lib/models/snapshotRecoveryTarget.js rename to lib/services/webSiteManagement2/lib/models/snapshotRecoverySource.js index 9770a44e27..e545007e99 100644 --- a/lib/services/websiteManagement2/lib/models/snapshotRecoveryTarget.js +++ b/lib/services/webSiteManagement2/lib/models/snapshotRecoverySource.js @@ -11,15 +11,15 @@ 'use strict'; /** - * Specifies the web app that snapshot contents will be written to. + * Specifies the web app that snapshot contents will be retrieved from. * */ -class SnapshotRecoveryTarget { +class SnapshotRecoverySource { /** - * Create a SnapshotRecoveryTarget. - * @member {string} [location] Geographical location of the target web app, + * 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 target app. + * @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} @@ -29,18 +29,18 @@ class SnapshotRecoveryTarget { } /** - * Defines the metadata of SnapshotRecoveryTarget + * Defines the metadata of SnapshotRecoverySource * - * @returns {object} metadata of SnapshotRecoveryTarget + * @returns {object} metadata of SnapshotRecoverySource * */ mapper() { return { required: false, - serializedName: 'SnapshotRecoveryTarget', + serializedName: 'SnapshotRecoverySource', type: { name: 'Composite', - className: 'SnapshotRecoveryTarget', + className: 'SnapshotRecoverySource', modelProperties: { location: { required: false, @@ -62,4 +62,4 @@ class SnapshotRecoveryTarget { } } -module.exports = SnapshotRecoveryTarget; +module.exports = SnapshotRecoverySource; diff --git a/lib/services/webSiteManagement2/lib/models/snapshotRecoveryTarget.js b/lib/services/webSiteManagement2/lib/models/snapshotRecoveryTarget.js deleted file mode 100644 index 9770a44e27..0000000000 --- a/lib/services/webSiteManagement2/lib/models/snapshotRecoveryTarget.js +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -/** - * Specifies the web app that snapshot contents will be written to. - * - */ -class SnapshotRecoveryTarget { - /** - * Create a SnapshotRecoveryTarget. - * @member {string} [location] Geographical location of the target web app, - * e.g. SouthEastAsia, SouthCentralUS - * @member {string} [id] ARM resource ID of the target 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 SnapshotRecoveryTarget - * - * @returns {object} metadata of SnapshotRecoveryTarget - * - */ - mapper() { - return { - required: false, - serializedName: 'SnapshotRecoveryTarget', - type: { - name: 'Composite', - className: 'SnapshotRecoveryTarget', - modelProperties: { - location: { - required: false, - serializedName: 'location', - type: { - name: 'String' - } - }, - id: { - required: false, - serializedName: 'id', - type: { - name: 'String' - } - } - } - } - }; - } -} - -module.exports = SnapshotRecoveryTarget; diff --git a/lib/services/websiteManagement2/lib/models/snapshotRecoveryRequest.js b/lib/services/webSiteManagement2/lib/models/snapshotRestoreRequest.js similarity index 73% rename from lib/services/websiteManagement2/lib/models/snapshotRecoveryRequest.js rename to lib/services/webSiteManagement2/lib/models/snapshotRestoreRequest.js index e59a088c7c..ad5d840c8a 100644 --- a/lib/services/websiteManagement2/lib/models/snapshotRecoveryRequest.js +++ b/lib/services/webSiteManagement2/lib/models/snapshotRestoreRequest.js @@ -17,22 +17,23 @@ const models = require('./index'); * * @extends models['ProxyOnlyResource'] */ -class SnapshotRecoveryRequest extends models['ProxyOnlyResource'] { +class SnapshotRestoreRequest extends models['ProxyOnlyResource'] { /** - * Create a SnapshotRecoveryRequest. - * @member {string} [snapshotTime] Point in time in which the app recovery - * should be attempted, formatted as a DateTime string. - * @member {object} [recoveryTarget] Specifies the web app that snapshot - * contents will be written to. - * @member {string} [recoveryTarget.location] Geographical location of the - * target web app, e.g. SouthEastAsia, SouthCentralUS - * @member {string} [recoveryTarget.id] ARM resource ID of the target app. + * 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 recovery operation - * can overwrite source app; otherwise, false. + * @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 @@ -44,18 +45,18 @@ class SnapshotRecoveryRequest extends models['ProxyOnlyResource'] { } /** - * Defines the metadata of SnapshotRecoveryRequest + * Defines the metadata of SnapshotRestoreRequest * - * @returns {object} metadata of SnapshotRecoveryRequest + * @returns {object} metadata of SnapshotRestoreRequest * */ mapper() { return { required: false, - serializedName: 'SnapshotRecoveryRequest', + serializedName: 'SnapshotRestoreRequest', type: { name: 'Composite', - className: 'SnapshotRecoveryRequest', + className: 'SnapshotRestoreRequest', modelProperties: { id: { required: false, @@ -95,12 +96,12 @@ class SnapshotRecoveryRequest extends models['ProxyOnlyResource'] { name: 'String' } }, - recoveryTarget: { + recoverySource: { required: false, - serializedName: 'properties.recoveryTarget', + serializedName: 'properties.recoverySource', type: { name: 'Composite', - className: 'SnapshotRecoveryTarget' + className: 'SnapshotRecoverySource' } }, overwrite: { @@ -130,4 +131,4 @@ class SnapshotRecoveryRequest extends models['ProxyOnlyResource'] { } } -module.exports = SnapshotRecoveryRequest; +module.exports = SnapshotRestoreRequest; diff --git a/lib/services/webSiteManagement2/lib/models/sourceControl.js b/lib/services/webSiteManagement2/lib/models/sourceControl.js index 0c0d72a318..3e7a294e88 100644 --- a/lib/services/webSiteManagement2/lib/models/sourceControl.js +++ b/lib/services/webSiteManagement2/lib/models/sourceControl.js @@ -20,7 +20,6 @@ const models = require('./index'); class SourceControl extends models['ProxyOnlyResource'] { /** * Create a SourceControl. - * @member {string} [sourceControlName] Name or source control type. * @member {string} [token] OAuth access token. * @member {string} [tokenSecret] OAuth access token secret. * @member {string} [refreshToken] OAuth refresh token. @@ -75,13 +74,6 @@ class SourceControl extends models['ProxyOnlyResource'] { name: 'String' } }, - sourceControlName: { - required: false, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, token: { required: false, serializedName: 'properties.token', diff --git a/lib/services/webSiteManagement2/lib/models/stackMajorVersion.js b/lib/services/webSiteManagement2/lib/models/stackMajorVersion.js new file mode 100644 index 0000000000..f8a3e54984 --- /dev/null +++ b/lib/services/webSiteManagement2/lib/models/stackMajorVersion.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'); + +/** + * 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 index 8cb844d445..9227735918 100644 --- a/lib/services/webSiteManagement2/lib/models/stampCapacity.js +++ b/lib/services/webSiteManagement2/lib/models/stampCapacity.js @@ -26,7 +26,7 @@ class StampCapacity { * @member {string} [computeMode] Shared/dedicated workers. Possible values * include: 'Shared', 'Dedicated', 'Dynamic' * @member {string} [workerSize] Size of the machines. Possible values - * include: 'Default', 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3' + * include: 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', 'Default' * @member {number} [workerSizeId] Size ID of machines: * 0 - Small * 1 - Medium @@ -37,6 +37,7 @@ class StampCapacity { * @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() { } @@ -96,7 +97,7 @@ class StampCapacity { serializedName: 'workerSize', type: { name: 'Enum', - allowedValues: [ 'Default', 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3' ] + allowedValues: [ 'Small', 'Medium', 'Large', 'D1', 'D2', 'D3', 'Default' ] } }, workerSizeId: { @@ -126,6 +127,13 @@ class StampCapacity { type: { name: 'String' } + }, + isLinux: { + required: false, + serializedName: 'isLinux', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/websiteManagement2/lib/models/resourceHealthMetadata.js b/lib/services/webSiteManagement2/lib/models/swiftVirtualNetwork.js similarity index 61% rename from lib/services/websiteManagement2/lib/models/resourceHealthMetadata.js rename to lib/services/webSiteManagement2/lib/models/swiftVirtualNetwork.js index 7c8d1c457d..7001e790fd 100644 --- a/lib/services/websiteManagement2/lib/models/resourceHealthMetadata.js +++ b/lib/services/webSiteManagement2/lib/models/swiftVirtualNetwork.js @@ -13,35 +13,37 @@ const models = require('./index'); /** - * Used for getting ResourceHealthCheck settings. + * Swift Virtual Network Contract. This is used to enable the new Swift way of + * doing virtual network integration. * * @extends models['ProxyOnlyResource'] */ -class ResourceHealthMetadata extends models['ProxyOnlyResource'] { +class SwiftVirtualNetwork 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 + * 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 ResourceHealthMetadata + * Defines the metadata of SwiftVirtualNetwork * - * @returns {object} metadata of ResourceHealthMetadata + * @returns {object} metadata of SwiftVirtualNetwork * */ mapper() { return { required: false, - serializedName: 'ResourceHealthMetadata', + serializedName: 'SwiftVirtualNetwork', type: { name: 'Composite', - className: 'ResourceHealthMetadata', + className: 'SwiftVirtualNetwork', modelProperties: { id: { required: false, @@ -74,16 +76,16 @@ class ResourceHealthMetadata extends models['ProxyOnlyResource'] { name: 'String' } }, - category: { + subnetResourceId: { required: false, - serializedName: 'properties.category', + serializedName: 'properties.subnetResourceId', type: { name: 'String' } }, - signalAvailability: { + swiftSupported: { required: false, - serializedName: 'properties.signalAvailability', + serializedName: 'properties.swiftSupported', type: { name: 'Boolean' } @@ -94,4 +96,4 @@ class ResourceHealthMetadata extends models['ProxyOnlyResource'] { } } -module.exports = ResourceHealthMetadata; +module.exports = SwiftVirtualNetwork; diff --git a/lib/services/webSiteManagement2/lib/models/topLevelDomain.js b/lib/services/webSiteManagement2/lib/models/topLevelDomain.js index 76d8577eaf..d5e0a3c95c 100644 --- a/lib/services/webSiteManagement2/lib/models/topLevelDomain.js +++ b/lib/services/webSiteManagement2/lib/models/topLevelDomain.js @@ -20,7 +20,6 @@ const models = require('./index'); class TopLevelDomain extends models['ProxyOnlyResource'] { /** * Create a TopLevelDomain. - * @member {string} [domainName] Name of the top level domain. * @member {boolean} [privacy] If true, then the top level * domain supports domain privacy; otherwise, false. */ @@ -73,14 +72,6 @@ class TopLevelDomain extends models['ProxyOnlyResource'] { name: 'String' } }, - domainName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, privacy: { required: false, serializedName: 'properties.privacy', diff --git a/lib/services/webSiteManagement2/lib/models/triggeredJobHistory.js b/lib/services/webSiteManagement2/lib/models/triggeredJobHistory.js index dda09c1cae..7623db0417 100644 --- a/lib/services/webSiteManagement2/lib/models/triggeredJobHistory.js +++ b/lib/services/webSiteManagement2/lib/models/triggeredJobHistory.js @@ -21,7 +21,7 @@ const models = require('./index'); class TriggeredJobHistory extends models['ProxyOnlyResource'] { /** * Create a TriggeredJobHistory. - * @member {array} [triggeredJobRuns] List of triggered web job runs. + * @member {array} [runs] List of triggered web job runs. */ constructor() { super(); @@ -72,9 +72,9 @@ class TriggeredJobHistory extends models['ProxyOnlyResource'] { name: 'String' } }, - triggeredJobRuns: { + runs: { required: false, - serializedName: 'properties.triggeredJobRuns', + serializedName: 'properties.runs', type: { name: 'Sequence', element: { diff --git a/lib/services/webSiteManagement2/lib/models/triggeredJobRun.js b/lib/services/webSiteManagement2/lib/models/triggeredJobRun.js index dafb649e30..ef4774b6e4 100644 --- a/lib/services/webSiteManagement2/lib/models/triggeredJobRun.js +++ b/lib/services/webSiteManagement2/lib/models/triggeredJobRun.js @@ -20,8 +20,8 @@ const models = require('./index'); class TriggeredJobRun extends models['ProxyOnlyResource'] { /** * Create a TriggeredJobRun. - * @member {string} [triggeredJobRunId] Job ID. - * @member {string} [triggeredJobRunName] Job name. + * @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. @@ -82,17 +82,16 @@ class TriggeredJobRun extends models['ProxyOnlyResource'] { name: 'String' } }, - triggeredJobRunId: { + webJobId: { required: false, - serializedName: 'properties.id', + serializedName: 'properties.web_job_id', type: { name: 'String' } }, - triggeredJobRunName: { + webJobName: { required: false, - readOnly: true, - serializedName: 'properties.name', + serializedName: 'properties.web_job_name', type: { name: 'String' } @@ -107,14 +106,14 @@ class TriggeredJobRun extends models['ProxyOnlyResource'] { }, startTime: { required: false, - serializedName: 'properties.startTime', + serializedName: 'properties.start_time', type: { name: 'DateTime' } }, endTime: { required: false, - serializedName: 'properties.endTime', + serializedName: 'properties.end_time', type: { name: 'DateTime' } @@ -128,14 +127,14 @@ class TriggeredJobRun extends models['ProxyOnlyResource'] { }, outputUrl: { required: false, - serializedName: 'properties.outputUrl', + serializedName: 'properties.output_url', type: { name: 'String' } }, errorUrl: { required: false, - serializedName: 'properties.errorUrl', + serializedName: 'properties.error_url', type: { name: 'String' } @@ -149,7 +148,7 @@ class TriggeredJobRun extends models['ProxyOnlyResource'] { }, jobName: { required: false, - serializedName: 'properties.jobName', + serializedName: 'properties.job_name', type: { name: 'String' } diff --git a/lib/services/webSiteManagement2/lib/models/triggeredWebJob.js b/lib/services/webSiteManagement2/lib/models/triggeredWebJob.js index 076ffffe05..b062eb3eb4 100644 --- a/lib/services/webSiteManagement2/lib/models/triggeredWebJob.js +++ b/lib/services/webSiteManagement2/lib/models/triggeredWebJob.js @@ -21,8 +21,8 @@ class TriggeredWebJob extends models['ProxyOnlyResource'] { /** * Create a TriggeredWebJob. * @member {object} [latestRun] Latest job run information. - * @member {string} [latestRun.triggeredJobRunId] Job ID. - * @member {string} [latestRun.triggeredJobRunName] Job name. + * @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. @@ -35,12 +35,10 @@ class TriggeredWebJob extends models['ProxyOnlyResource'] { * @member {string} [latestRun.trigger] Job trigger. * @member {string} [historyUrl] History URL. * @member {string} [schedulerLogsUrl] Scheduler Logs URL. - * @member {string} [triggeredWebJobName] Job name. Used as job identifier in - * ARM resource URI. * @member {string} [runCommand] Run command. * @member {string} [url] Job URL. * @member {string} [extraInfoUrl] Extra Info URL. - * @member {string} [jobType] Job type. Possible values include: + * @member {string} [webJobType] Job type. Possible values include: * 'Continuous', 'Triggered' * @member {string} [error] Error information. * @member {boolean} [usingSdk] Using SDK? @@ -97,7 +95,7 @@ class TriggeredWebJob extends models['ProxyOnlyResource'] { }, latestRun: { required: false, - serializedName: 'properties.latestRun', + serializedName: 'properties.latest_run', type: { name: 'Composite', className: 'TriggeredJobRun' @@ -105,29 +103,21 @@ class TriggeredWebJob extends models['ProxyOnlyResource'] { }, historyUrl: { required: false, - serializedName: 'properties.historyUrl', + serializedName: 'properties.history_url', type: { name: 'String' } }, schedulerLogsUrl: { required: false, - serializedName: 'properties.schedulerLogsUrl', - type: { - name: 'String' - } - }, - triggeredWebJobName: { - required: false, - readOnly: true, - serializedName: 'properties.name', + serializedName: 'properties.scheduler_logs_url', type: { name: 'String' } }, runCommand: { required: false, - serializedName: 'properties.runCommand', + serializedName: 'properties.run_command', type: { name: 'String' } @@ -141,14 +131,14 @@ class TriggeredWebJob extends models['ProxyOnlyResource'] { }, extraInfoUrl: { required: false, - serializedName: 'properties.extraInfoUrl', + serializedName: 'properties.extra_info_url', type: { name: 'String' } }, - jobType: { + webJobType: { required: false, - serializedName: 'properties.jobType', + serializedName: 'properties.web_job_type', type: { name: 'Enum', allowedValues: [ 'Continuous', 'Triggered' ] @@ -163,7 +153,7 @@ class TriggeredWebJob extends models['ProxyOnlyResource'] { }, usingSdk: { required: false, - serializedName: 'properties.usingSdk', + serializedName: 'properties.using_sdk', type: { name: 'Boolean' } diff --git a/lib/services/webSiteManagement2/lib/models/usage.js b/lib/services/webSiteManagement2/lib/models/usage.js index a8bb508dd5..b030fdbfde 100644 --- a/lib/services/webSiteManagement2/lib/models/usage.js +++ b/lib/services/webSiteManagement2/lib/models/usage.js @@ -21,7 +21,6 @@ class Usage extends models['ProxyOnlyResource'] { /** * Create a Usage. * @member {string} [displayName] Friendly name shown in the UI. - * @member {string} [usageName] Name of the quota. * @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. @@ -88,14 +87,6 @@ class Usage extends models['ProxyOnlyResource'] { name: 'String' } }, - usageName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, resourceName: { required: false, readOnly: true, diff --git a/lib/services/webSiteManagement2/lib/models/user.js b/lib/services/webSiteManagement2/lib/models/user.js index 8f3d0fbad6..ec8071fce3 100644 --- a/lib/services/webSiteManagement2/lib/models/user.js +++ b/lib/services/webSiteManagement2/lib/models/user.js @@ -20,13 +20,13 @@ const models = require('./index'); class User extends models['ProxyOnlyResource'] { /** * Create a User. - * @member {string} [userName] Username * @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(); @@ -77,13 +77,6 @@ class User extends models['ProxyOnlyResource'] { name: 'String' } }, - userName: { - required: false, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, publishingUserName: { required: true, serializedName: 'properties.publishingUserName', @@ -111,6 +104,13 @@ class User extends models['ProxyOnlyResource'] { type: { name: 'String' } + }, + scmUri: { + required: false, + serializedName: 'properties.scmUri', + type: { + name: 'String' + } } } } diff --git a/lib/services/webSiteManagement2/lib/models/validateRequest.js b/lib/services/webSiteManagement2/lib/models/validateRequest.js index 479983a00f..3ca18ee528 100644 --- a/lib/services/webSiteManagement2/lib/models/validateRequest.js +++ b/lib/services/webSiteManagement2/lib/models/validateRequest.js @@ -33,6 +33,8 @@ class ValidateRequest { * (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() { } @@ -116,6 +118,13 @@ class ValidateRequest { type: { name: 'String' } + }, + isXenon: { + required: false, + serializedName: 'properties.isXenon', + type: { + name: 'Boolean' + } } } } diff --git a/lib/services/webSiteManagement2/lib/models/vnetRoute.js b/lib/services/webSiteManagement2/lib/models/vnetRoute.js index 5df4cf5959..5dfe8a762e 100644 --- a/lib/services/webSiteManagement2/lib/models/vnetRoute.js +++ b/lib/services/webSiteManagement2/lib/models/vnetRoute.js @@ -21,8 +21,6 @@ const models = require('./index'); class VnetRoute extends models['ProxyOnlyResource'] { /** * Create a VnetRoute. - * @member {string} [vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. * @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. @@ -86,13 +84,6 @@ class VnetRoute extends models['ProxyOnlyResource'] { name: 'String' } }, - vnetRouteName: { - required: false, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, startAddress: { required: false, serializedName: 'properties.startAddress', diff --git a/lib/services/webSiteManagement2/lib/models/webJob.js b/lib/services/webSiteManagement2/lib/models/webJob.js index 8f2ed44730..071625ad9b 100644 --- a/lib/services/webSiteManagement2/lib/models/webJob.js +++ b/lib/services/webSiteManagement2/lib/models/webJob.js @@ -20,12 +20,10 @@ const models = require('./index'); class WebJob extends models['ProxyOnlyResource'] { /** * Create a WebJob. - * @member {string} [webJobName] Job name. Used as job identifier in ARM - * resource URI. * @member {string} [runCommand] Run command. * @member {string} [url] Job URL. * @member {string} [extraInfoUrl] Extra Info URL. - * @member {string} [jobType] Job type. Possible values include: + * @member {string} [webJobType] Job type. Possible values include: * 'Continuous', 'Triggered' * @member {string} [error] Error information. * @member {boolean} [usingSdk] Using SDK? @@ -80,17 +78,9 @@ class WebJob extends models['ProxyOnlyResource'] { name: 'String' } }, - webJobName: { - required: false, - readOnly: true, - serializedName: 'properties.name', - type: { - name: 'String' - } - }, runCommand: { required: false, - serializedName: 'properties.runCommand', + serializedName: 'properties.run_command', type: { name: 'String' } @@ -104,14 +94,14 @@ class WebJob extends models['ProxyOnlyResource'] { }, extraInfoUrl: { required: false, - serializedName: 'properties.extraInfoUrl', + serializedName: 'properties.extra_info_url', type: { name: 'String' } }, - jobType: { + webJobType: { required: false, - serializedName: 'properties.jobType', + serializedName: 'properties.web_job_type', type: { name: 'Enum', allowedValues: [ 'Continuous', 'Triggered' ] @@ -126,7 +116,7 @@ class WebJob extends models['ProxyOnlyResource'] { }, usingSdk: { required: false, - serializedName: 'properties.usingSdk', + serializedName: 'properties.using_sdk', type: { name: 'Boolean' } diff --git a/lib/services/webSiteManagement2/lib/operations/appServiceCertificateOrders.js b/lib/services/webSiteManagement2/lib/operations/appServiceCertificateOrders.js index 66ac67f507..c61d1b4c3d 100644 --- a/lib/services/webSiteManagement2/lib/operations/appServiceCertificateOrders.js +++ b/lib/services/webSiteManagement2/lib/operations/appServiceCertificateOrders.js @@ -48,12 +48,14 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -66,7 +68,7 @@ function _list(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -108,12 +110,13 @@ function _list(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -211,7 +214,6 @@ function _validatePurchaseInformation(appServiceCertificateOrder, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (appServiceCertificateOrder === null || appServiceCertificateOrder === undefined) { @@ -220,6 +222,9 @@ function _validatePurchaseInformation(appServiceCertificateOrder, options, callb if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -232,7 +237,7 @@ function _validatePurchaseInformation(appServiceCertificateOrder, options, callb 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -348,7 +353,6 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -371,6 +375,9 @@ function _listByResourceGroup(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -384,7 +391,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('&'); } @@ -426,12 +433,13 @@ function _listByResourceGroup(resourceGroupName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -505,7 +513,6 @@ function _get(resourceGroupName, certificateOrderName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -531,6 +538,9 @@ function _get(resourceGroupName, certificateOrderName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -545,7 +555,7 @@ function _get(resourceGroupName, certificateOrderName, options, callback) { requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); 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('&'); } @@ -587,12 +597,13 @@ function _get(resourceGroupName, certificateOrderName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -777,7 +788,6 @@ function _deleteMethod(resourceGroupName, certificateOrderName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -803,6 +813,9 @@ function _deleteMethod(resourceGroupName, certificateOrderName, options, callbac if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -817,7 +830,7 @@ function _deleteMethod(resourceGroupName, certificateOrderName, options, callbac requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); 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('&'); } @@ -948,7 +961,6 @@ function _update(resourceGroupName, certificateOrderName, certificateDistinguish if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -977,6 +989,9 @@ function _update(resourceGroupName, certificateOrderName, certificateDistinguish if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -991,7 +1006,7 @@ function _update(resourceGroupName, certificateOrderName, certificateDistinguish requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); 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('&'); } @@ -1047,12 +1062,13 @@ function _update(resourceGroupName, certificateOrderName, certificateDistinguish try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1143,7 +1159,6 @@ function _listCertificates(resourceGroupName, certificateOrderName, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1169,6 +1184,9 @@ function _listCertificates(resourceGroupName, certificateOrderName, options, cal if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1183,7 +1201,7 @@ function _listCertificates(resourceGroupName, certificateOrderName, options, cal requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); 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('&'); } @@ -1225,12 +1243,13 @@ function _listCertificates(resourceGroupName, certificateOrderName, options, cal try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1306,7 +1325,6 @@ function _getCertificate(resourceGroupName, certificateOrderName, name, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1335,6 +1353,9 @@ function _getCertificate(resourceGroupName, certificateOrderName, name, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1350,7 +1371,7 @@ function _getCertificate(resourceGroupName, certificateOrderName, name, options, requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1392,12 +1413,13 @@ function _getCertificate(resourceGroupName, certificateOrderName, name, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1569,7 +1591,6 @@ function _deleteCertificate(resourceGroupName, certificateOrderName, name, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1598,6 +1619,9 @@ function _deleteCertificate(resourceGroupName, certificateOrderName, name, optio if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1613,7 +1637,7 @@ function _deleteCertificate(resourceGroupName, certificateOrderName, name, optio requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1729,7 +1753,6 @@ function _updateCertificate(resourceGroupName, certificateOrderName, name, keyVa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1761,6 +1784,9 @@ function _updateCertificate(resourceGroupName, certificateOrderName, name, keyVa if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1776,7 +1802,7 @@ function _updateCertificate(resourceGroupName, certificateOrderName, name, keyVa requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1832,12 +1858,13 @@ function _updateCertificate(resourceGroupName, certificateOrderName, name, keyVa try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1944,7 +1971,6 @@ function _reissue(resourceGroupName, certificateOrderName, reissueCertificateOrd if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1973,6 +1999,9 @@ function _reissue(resourceGroupName, certificateOrderName, reissueCertificateOrd if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1987,7 +2016,7 @@ function _reissue(resourceGroupName, certificateOrderName, reissueCertificateOrd requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); 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('&'); } @@ -2116,7 +2145,6 @@ function _renew(resourceGroupName, certificateOrderName, renewCertificateOrderRe if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2145,6 +2173,9 @@ function _renew(resourceGroupName, certificateOrderName, renewCertificateOrderRe if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2159,7 +2190,7 @@ function _renew(resourceGroupName, certificateOrderName, renewCertificateOrderRe requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); 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('&'); } @@ -2275,7 +2306,6 @@ function _resendEmail(resourceGroupName, certificateOrderName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2301,6 +2331,9 @@ function _resendEmail(resourceGroupName, certificateOrderName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2315,7 +2348,7 @@ function _resendEmail(resourceGroupName, certificateOrderName, options, callback requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); 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('&'); } @@ -2420,7 +2453,6 @@ function _resendRequestEmails(resourceGroupName, certificateOrderName, options, throw new Error('callback cannot be null.'); } let name = (options && options.name !== undefined) ? options.name : undefined; - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2446,6 +2478,9 @@ function _resendRequestEmails(resourceGroupName, certificateOrderName, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof 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.'); } @@ -2468,7 +2503,7 @@ function _resendRequestEmails(resourceGroupName, certificateOrderName, options, requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); 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('&'); } @@ -2592,7 +2627,6 @@ function _retrieveSiteSeal(resourceGroupName, certificateOrderName, siteSealRequ if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2621,6 +2655,9 @@ function _retrieveSiteSeal(resourceGroupName, certificateOrderName, siteSealRequ if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2635,7 +2672,7 @@ function _retrieveSiteSeal(resourceGroupName, certificateOrderName, siteSealRequ requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); 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('&'); } @@ -2691,12 +2728,13 @@ function _retrieveSiteSeal(resourceGroupName, certificateOrderName, siteSealRequ try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2768,7 +2806,6 @@ function _verifyDomainOwnership(resourceGroupName, certificateOrderName, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2794,6 +2831,9 @@ function _verifyDomainOwnership(resourceGroupName, certificateOrderName, options if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2808,7 +2848,7 @@ function _verifyDomainOwnership(resourceGroupName, certificateOrderName, options requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); 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('&'); } @@ -2910,7 +2950,6 @@ function _retrieveCertificateActions(resourceGroupName, name, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2936,6 +2975,9 @@ function _retrieveCertificateActions(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2950,7 +2992,7 @@ function _retrieveCertificateActions(resourceGroupName, name, options, callback) requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -2992,12 +3034,13 @@ function _retrieveCertificateActions(resourceGroupName, name, options, callback) try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3083,7 +3126,6 @@ function _retrieveCertificateEmailHistory(resourceGroupName, name, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3109,6 +3151,9 @@ function _retrieveCertificateEmailHistory(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3123,7 +3168,7 @@ function _retrieveCertificateEmailHistory(resourceGroupName, name, options, call requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -3165,12 +3210,13 @@ function _retrieveCertificateEmailHistory(resourceGroupName, name, options, call try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3289,7 +3335,6 @@ function _beginCreateOrUpdate(resourceGroupName, certificateOrderName, certifica if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3318,6 +3363,9 @@ function _beginCreateOrUpdate(resourceGroupName, certificateOrderName, certifica if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3332,7 +3380,7 @@ function _beginCreateOrUpdate(resourceGroupName, certificateOrderName, certifica requestUrl = requestUrl.replace('{certificateOrderName}', encodeURIComponent(certificateOrderName)); 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('&'); } @@ -3388,12 +3436,13 @@ function _beginCreateOrUpdate(resourceGroupName, certificateOrderName, certifica try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3500,7 +3549,6 @@ function _beginCreateOrUpdateCertificate(resourceGroupName, certificateOrderName if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3532,6 +3580,9 @@ function _beginCreateOrUpdateCertificate(resourceGroupName, certificateOrderName if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3547,7 +3598,7 @@ function _beginCreateOrUpdateCertificate(resourceGroupName, certificateOrderName requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -3603,12 +3654,13 @@ function _beginCreateOrUpdateCertificate(resourceGroupName, certificateOrderName try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3750,12 +3802,13 @@ function _listNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3880,12 +3933,13 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4010,12 +4064,13 @@ function _listCertificatesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { diff --git a/lib/services/webSiteManagement2/lib/operations/appServiceEnvironments.js b/lib/services/webSiteManagement2/lib/operations/appServiceEnvironments.js index 77b8ecdb35..4e8dcefbed 100644 --- a/lib/services/webSiteManagement2/lib/operations/appServiceEnvironments.js +++ b/lib/services/webSiteManagement2/lib/operations/appServiceEnvironments.js @@ -48,12 +48,14 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -66,7 +68,7 @@ function _list(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -108,12 +110,13 @@ function _list(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -185,7 +188,6 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -208,6 +210,9 @@ function _listByResourceGroup(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -221,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('&'); } @@ -263,12 +268,13 @@ function _listByResourceGroup(resourceGroupName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -342,7 +348,6 @@ function _get(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -368,6 +373,9 @@ function _get(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -382,7 +390,7 @@ function _get(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -424,12 +432,13 @@ function _get(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -549,6 +558,15 @@ function _get(resourceGroupName, name, options, callback) { * @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. @@ -780,6 +798,15 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * @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. @@ -811,7 +838,6 @@ function _update(resourceGroupName, name, hostingEnvironmentEnvelope, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -840,6 +866,9 @@ function _update(resourceGroupName, name, hostingEnvironmentEnvelope, options, c if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -854,7 +883,7 @@ function _update(resourceGroupName, name, hostingEnvironmentEnvelope, options, c requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1008,7 +1037,6 @@ function _listCapacities(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1034,6 +1062,9 @@ function _listCapacities(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1048,7 +1079,7 @@ function _listCapacities(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1090,12 +1121,13 @@ function _listCapacities(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1168,7 +1200,6 @@ function _listVips(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1194,6 +1225,9 @@ function _listVips(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1208,7 +1242,7 @@ function _listVips(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1250,12 +1284,13 @@ function _listVips(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1290,6 +1325,93 @@ function _listVips(resourceGroupName, name, options, callback) { }); } + +/** + * @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. * @@ -1327,7 +1449,6 @@ function _listDiagnostics(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1353,6 +1474,9 @@ function _listDiagnostics(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1367,7 +1491,7 @@ function _listDiagnostics(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1409,12 +1533,13 @@ function _listDiagnostics(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1504,7 +1629,6 @@ function _getDiagnosticsItem(resourceGroupName, name, diagnosticsName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1533,6 +1657,9 @@ function _getDiagnosticsItem(resourceGroupName, name, diagnosticsName, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1548,7 +1675,7 @@ function _getDiagnosticsItem(resourceGroupName, name, diagnosticsName, options, requestUrl = requestUrl.replace('{diagnosticsName}', encodeURIComponent(diagnosticsName)); 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('&'); } @@ -1590,12 +1717,13 @@ function _getDiagnosticsItem(resourceGroupName, name, diagnosticsName, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1668,7 +1796,6 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1694,6 +1821,9 @@ function _listMetricDefinitions(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1708,7 +1838,7 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1750,12 +1880,13 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1840,7 +1971,6 @@ function _listMetrics(resourceGroupName, name, options, callback) { } let details = (options && options.details !== undefined) ? options.details : undefined; let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1872,6 +2002,9 @@ function _listMetrics(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1892,7 +2025,7 @@ function _listMetrics(resourceGroupName, name, 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('&'); } @@ -1934,12 +2067,13 @@ function _listMetrics(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2012,7 +2146,6 @@ function _listMultiRolePools(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2038,6 +2171,9 @@ function _listMultiRolePools(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2052,7 +2188,7 @@ function _listMultiRolePools(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -2094,12 +2230,13 @@ function _listMultiRolePools(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2172,7 +2309,6 @@ function _getMultiRolePool(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2198,6 +2334,9 @@ function _getMultiRolePool(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2212,7 +2351,7 @@ function _getMultiRolePool(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -2254,12 +2393,13 @@ function _getMultiRolePool(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2517,7 +2657,6 @@ function _updateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2546,6 +2685,9 @@ function _updateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, op if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2560,7 +2702,7 @@ function _updateMultiRolePool(resourceGroupName, name, multiRolePoolEnvelope, op requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -2716,7 +2858,6 @@ function _listMultiRolePoolInstanceMetricDefinitions(resourceGroupName, name, in if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2745,6 +2886,9 @@ function _listMultiRolePoolInstanceMetricDefinitions(resourceGroupName, name, in if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2760,7 +2904,7 @@ function _listMultiRolePoolInstanceMetricDefinitions(resourceGroupName, name, in requestUrl = requestUrl.replace('{instance}', encodeURIComponent(instance)); 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('&'); } @@ -2802,12 +2946,13 @@ function _listMultiRolePoolInstanceMetricDefinitions(resourceGroupName, name, in try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2889,7 +3034,6 @@ function _listMultiRolePoolInstanceMetrics(resourceGroupName, name, instance, op throw new Error('callback cannot be null.'); } let details = (options && options.details !== undefined) ? options.details : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2921,6 +3065,9 @@ function _listMultiRolePoolInstanceMetrics(resourceGroupName, name, instance, op if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2930,7 +3077,7 @@ function _listMultiRolePoolInstanceMetrics(resourceGroupName, name, instance, op // 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'; + 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)); @@ -2939,7 +3086,7 @@ function _listMultiRolePoolInstanceMetrics(resourceGroupName, name, instance, op if (details !== null && details !== undefined) { queryParameters.push('details=' + encodeURIComponent(details.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2981,12 +3128,13 @@ function _listMultiRolePoolInstanceMetrics(resourceGroupName, name, instance, op try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3061,7 +3209,6 @@ function _listMultiRoleMetricDefinitions(resourceGroupName, name, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3087,6 +3234,9 @@ function _listMultiRoleMetricDefinitions(resourceGroupName, name, options, callb if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3101,7 +3251,7 @@ function _listMultiRoleMetricDefinitions(resourceGroupName, name, options, callb requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -3143,12 +3293,13 @@ function _listMultiRoleMetricDefinitions(resourceGroupName, name, options, callb try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3242,7 +3393,6 @@ function _listMultiRoleMetrics(resourceGroupName, name, options, callback) { 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; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3283,6 +3433,9 @@ function _listMultiRoleMetrics(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3312,7 +3465,7 @@ function _listMultiRoleMetrics(resourceGroupName, name, 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('&'); } @@ -3354,12 +3507,13 @@ function _listMultiRoleMetrics(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3432,7 +3586,6 @@ function _listMultiRolePoolSkus(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3458,6 +3611,9 @@ function _listMultiRolePoolSkus(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3472,7 +3628,7 @@ function _listMultiRolePoolSkus(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -3514,12 +3670,13 @@ function _listMultiRolePoolSkus(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3593,7 +3750,6 @@ function _listMultiRoleUsages(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3619,6 +3775,9 @@ function _listMultiRoleUsages(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3633,7 +3792,7 @@ function _listMultiRoleUsages(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -3675,12 +3834,13 @@ function _listMultiRoleUsages(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3753,7 +3913,6 @@ function _listOperations(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3779,6 +3938,9 @@ function _listOperations(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3793,7 +3955,7 @@ function _listOperations(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -3835,12 +3997,13 @@ function _listOperations(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3926,7 +4089,6 @@ function _reboot(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3952,6 +4114,9 @@ function _reboot(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3966,7 +4131,7 @@ function _reboot(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -4151,7 +4316,6 @@ function _listAppServicePlans(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4177,6 +4341,9 @@ function _listAppServicePlans(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4191,7 +4358,7 @@ function _listAppServicePlans(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -4233,12 +4400,13 @@ function _listAppServicePlans(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4315,7 +4483,6 @@ function _listWebApps(resourceGroupName, name, options, callback) { throw new Error('callback cannot be null.'); } let propertiesToInclude = (options && options.propertiesToInclude !== undefined) ? options.propertiesToInclude : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4344,6 +4511,9 @@ function _listWebApps(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4361,7 +4531,7 @@ function _listWebApps(resourceGroupName, name, options, callback) { if (propertiesToInclude !== null && propertiesToInclude !== undefined) { queryParameters.push('propertiesToInclude=' + encodeURIComponent(propertiesToInclude)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -4403,12 +4573,13 @@ function _listWebApps(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4570,7 +4741,6 @@ function _listUsages(resourceGroupName, name, options, callback) { throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4599,6 +4769,9 @@ function _listUsages(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4616,7 +4789,7 @@ function _listUsages(resourceGroupName, name, 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('&'); } @@ -4658,12 +4831,13 @@ function _listUsages(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4736,7 +4910,6 @@ function _listWorkerPools(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4762,6 +4935,9 @@ function _listWorkerPools(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4776,7 +4952,7 @@ function _listWorkerPools(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -4818,12 +4994,13 @@ function _listWorkerPools(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4898,7 +5075,6 @@ function _getWorkerPool(resourceGroupName, name, workerPoolName, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4927,6 +5103,9 @@ function _getWorkerPool(resourceGroupName, name, workerPoolName, options, callba if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4942,7 +5121,7 @@ function _getWorkerPool(resourceGroupName, name, workerPoolName, options, callba requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); 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('&'); } @@ -4984,12 +5163,13 @@ function _getWorkerPool(resourceGroupName, name, workerPoolName, options, callba try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5251,7 +5431,6 @@ function _updateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEn if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5283,6 +5462,9 @@ function _updateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEn if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -5298,7 +5480,7 @@ function _updateWorkerPool(resourceGroupName, name, workerPoolName, workerPoolEn requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); 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('&'); } @@ -5456,7 +5638,6 @@ function _listWorkerPoolInstanceMetricDefinitions(resourceGroupName, name, worke if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5488,6 +5669,9 @@ function _listWorkerPoolInstanceMetricDefinitions(resourceGroupName, name, worke if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -5504,7 +5688,7 @@ function _listWorkerPoolInstanceMetricDefinitions(resourceGroupName, name, worke requestUrl = requestUrl.replace('{instance}', encodeURIComponent(instance)); 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('&'); } @@ -5546,12 +5730,13 @@ function _listWorkerPoolInstanceMetricDefinitions(resourceGroupName, name, worke try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5642,7 +5827,6 @@ function _listWorkerPoolInstanceMetrics(resourceGroupName, name, workerPoolName, } let details = (options && options.details !== undefined) ? options.details : undefined; let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5680,6 +5864,9 @@ function _listWorkerPoolInstanceMetrics(resourceGroupName, name, workerPoolName, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -5689,7 +5876,7 @@ function _listWorkerPoolInstanceMetrics(resourceGroupName, name, workerPoolName, // 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'; + 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)); @@ -5702,7 +5889,7 @@ function _listWorkerPoolInstanceMetrics(resourceGroupName, name, workerPoolName, 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('&'); } @@ -5744,12 +5931,13 @@ function _listWorkerPoolInstanceMetrics(resourceGroupName, name, workerPoolName, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5826,7 +6014,6 @@ function _listWebWorkerMetricDefinitions(resourceGroupName, name, workerPoolName if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5855,6 +6042,9 @@ function _listWebWorkerMetricDefinitions(resourceGroupName, name, workerPoolName if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -5870,7 +6060,7 @@ function _listWebWorkerMetricDefinitions(resourceGroupName, name, workerPoolName requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); 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('&'); } @@ -5912,12 +6102,13 @@ function _listWebWorkerMetricDefinitions(resourceGroupName, name, workerPoolName try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6006,7 +6197,6 @@ function _listWebWorkerMetrics(resourceGroupName, name, workerPoolName, options, } let details = (options && options.details !== undefined) ? options.details : undefined; let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6041,6 +6231,9 @@ function _listWebWorkerMetrics(resourceGroupName, name, workerPoolName, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -6062,7 +6255,7 @@ function _listWebWorkerMetrics(resourceGroupName, name, workerPoolName, options, 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('&'); } @@ -6104,12 +6297,13 @@ function _listWebWorkerMetrics(resourceGroupName, name, workerPoolName, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6184,7 +6378,6 @@ function _listWorkerPoolSkus(resourceGroupName, name, workerPoolName, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6213,6 +6406,9 @@ function _listWorkerPoolSkus(resourceGroupName, name, workerPoolName, options, c if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -6228,7 +6424,7 @@ function _listWorkerPoolSkus(resourceGroupName, name, workerPoolName, options, c requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); 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('&'); } @@ -6270,12 +6466,13 @@ function _listWorkerPoolSkus(resourceGroupName, name, workerPoolName, options, c try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6350,7 +6547,6 @@ function _listWebWorkerUsages(resourceGroupName, name, workerPoolName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6379,6 +6575,9 @@ function _listWebWorkerUsages(resourceGroupName, name, workerPoolName, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -6394,7 +6593,7 @@ function _listWebWorkerUsages(resourceGroupName, name, workerPoolName, options, requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); 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('&'); } @@ -6436,12 +6635,13 @@ function _listWebWorkerUsages(resourceGroupName, name, workerPoolName, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6560,6 +6760,15 @@ function _listWebWorkerUsages(resourceGroupName, name, workerPoolName, options, * @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. @@ -6595,7 +6804,6 @@ function _beginCreateOrUpdate(resourceGroupName, name, hostingEnvironmentEnvelop if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6624,6 +6832,9 @@ function _beginCreateOrUpdate(resourceGroupName, name, hostingEnvironmentEnvelop if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -6638,7 +6849,7 @@ function _beginCreateOrUpdate(resourceGroupName, name, hostingEnvironmentEnvelop requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -6793,7 +7004,6 @@ function _beginDeleteMethod(resourceGroupName, name, options, callback) { throw new Error('callback cannot be null.'); } let forceDelete = (options && options.forceDelete !== undefined) ? options.forceDelete : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6822,6 +7032,9 @@ function _beginDeleteMethod(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -6839,7 +7052,7 @@ function _beginDeleteMethod(resourceGroupName, name, options, callback) { if (forceDelete !== null && forceDelete !== undefined) { queryParameters.push('forceDelete=' + encodeURIComponent(forceDelete.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -6905,30 +7118,233 @@ function _beginDeleteMethod(resourceGroupName, name, options, callback) { } /** - * @summary Create or update a multi-role pool. + * @summary Move an App Service Environment to a different VNET. * - * Create or update a multi-role pool. + * 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} multiRolePoolEnvelope Properties of the multi-role pool. + * @param {object} vnetInfo Details for the new virtual network. * - * @param {number} [multiRolePoolEnvelope.workerSizeId] Worker size ID for - * referencing this worker pool. + * @param {string} [vnetInfo.id] Resource id of the Virtual Network. * - * @param {string} [multiRolePoolEnvelope.computeMode] Shared or dedicated app - * hosting. Possible values include: 'Shared', 'Dedicated', 'Dynamic' + * @param {string} [vnetInfo.subnet] Subnet within the Virtual Network. * - * @param {string} [multiRolePoolEnvelope.workerSize] VM size of the worker - * pool instances. + * @param {object} [options] Optional Parameters. * - * @param {number} [multiRolePoolEnvelope.workerCount] Number of instances in - * the worker pool. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [multiRolePoolEnvelope.sku] + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, response) + * + * {Error} 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. * @@ -6994,7 +7410,6 @@ function _beginCreateOrUpdateMultiRolePool(resourceGroupName, name, multiRolePoo if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7023,6 +7438,9 @@ function _beginCreateOrUpdateMultiRolePool(resourceGroupName, name, multiRolePoo if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -7037,7 +7455,7 @@ function _beginCreateOrUpdateMultiRolePool(resourceGroupName, name, multiRolePoo requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -7188,7 +7606,6 @@ function _beginResume(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7214,6 +7631,9 @@ function _beginResume(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -7228,7 +7648,7 @@ function _beginResume(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -7270,12 +7690,13 @@ function _beginResume(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -7365,7 +7786,6 @@ function _beginSuspend(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7391,6 +7811,9 @@ function _beginSuspend(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -7405,7 +7828,7 @@ function _beginSuspend(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -7447,12 +7870,13 @@ function _beginSuspend(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -7596,7 +8020,6 @@ function _beginCreateOrUpdateWorkerPool(resourceGroupName, name, workerPoolName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7628,6 +8051,9 @@ function _beginCreateOrUpdateWorkerPool(resourceGroupName, name, workerPoolName, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -7643,7 +8069,7 @@ function _beginCreateOrUpdateWorkerPool(resourceGroupName, name, workerPoolName, requestUrl = requestUrl.replace('{workerPoolName}', encodeURIComponent(workerPoolName)); 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('&'); } @@ -7846,12 +8272,13 @@ function _listNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -7976,12 +8403,13 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -8108,12 +8536,13 @@ function _listCapacitiesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -8148,6 +8577,85 @@ function _listCapacitiesNext(nextPageLink, options, callback) { }); } + +/** + * @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. * @@ -8238,12 +8746,13 @@ function _listMetricsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -8367,12 +8876,13 @@ function _listMultiRolePoolsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -8499,12 +9009,13 @@ function _listMultiRolePoolInstanceMetricDefinitionsNext(nextPageLink, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -8631,12 +9142,13 @@ function _listMultiRolePoolInstanceMetricsNext(nextPageLink, options, callback) try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -8762,12 +9274,13 @@ function _listMultiRoleMetricDefinitionsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -8892,12 +9405,13 @@ function _listMultiRoleMetricsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -9021,12 +9535,13 @@ function _listMultiRolePoolSkusNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -9151,12 +9666,13 @@ function _listMultiRoleUsagesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -9360,12 +9876,13 @@ function _listAppServicePlansNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -9489,12 +10006,13 @@ function _listWebAppsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -9628,14 +10146,144 @@ function _suspendNext(nextPageLink, 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 CsmUsageQuotaCollection} for more - * information. + * 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 _listUsagesNext(nextPageLink, options, callback) { +function _listWorkerPoolsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9698,12 +10346,13 @@ function _listUsagesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -9723,7 +10372,7 @@ function _listUsagesNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['CsmUsageQuotaCollection']().mapper(); + let resultMapper = new client.models['WorkerPoolCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -9739,9 +10388,11 @@ function _listUsagesNext(nextPageLink, options, callback) { } /** - * @summary Get all worker pools of an App Service Environment. + * @summary Get metric definitions for a specific instance of a worker pool of + * an App Service Environment. * - * Get all worker pools 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. @@ -9758,13 +10409,14 @@ function _listUsagesNext(nextPageLink, 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 WorkerPoolCollection} for more information. + * 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 _listWorkerPoolsNext(nextPageLink, options, callback) { +function _listWorkerPoolInstanceMetricDefinitionsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9827,12 +10479,13 @@ function _listWorkerPoolsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -9852,7 +10505,7 @@ function _listWorkerPoolsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WorkerPoolCollection']().mapper(); + let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -9868,12 +10521,12 @@ function _listWorkerPoolsNext(nextPageLink, options, callback) { } /** - * @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 + * @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. * @@ -9889,14 +10542,14 @@ function _listWorkerPoolsNext(nextPageLink, 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 ResourceMetricDefinitionCollection} for more + * 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 _listWorkerPoolInstanceMetricDefinitionsNext(nextPageLink, options, callback) { +function _listWorkerPoolInstanceMetricsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9959,12 +10612,13 @@ function _listWorkerPoolInstanceMetricDefinitionsNext(nextPageLink, options, cal try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -9984,7 +10638,7 @@ function _listWorkerPoolInstanceMetricDefinitionsNext(nextPageLink, options, cal parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); + let resultMapper = new client.models['ResourceMetricCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10000,12 +10654,11 @@ function _listWorkerPoolInstanceMetricDefinitionsNext(nextPageLink, options, cal } /** - * @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 + * @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. * @@ -10021,14 +10674,14 @@ function _listWorkerPoolInstanceMetricDefinitionsNext(nextPageLink, 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 ResourceMetricCollection} for more + * 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 _listWorkerPoolInstanceMetricsNext(nextPageLink, options, callback) { +function _listWebWorkerMetricDefinitionsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10091,12 +10744,13 @@ function _listWorkerPoolInstanceMetricsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -10116,7 +10770,7 @@ function _listWorkerPoolInstanceMetricsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricCollection']().mapper(); + let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10132,10 +10786,11 @@ function _listWorkerPoolInstanceMetricsNext(nextPageLink, options, callback) { } /** - * @summary Get metric definitions for a worker pool of an App Service - * Environment. + * @summary Get metrics for a worker pool of a AppServiceEnvironment (App + * Service Environment). * - * Get metric definitions for a worker pool of an 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. @@ -10152,14 +10807,14 @@ function _listWorkerPoolInstanceMetricsNext(nextPageLink, 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 ResourceMetricDefinitionCollection} for more + * 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 _listWebWorkerMetricDefinitionsNext(nextPageLink, options, callback) { +function _listWebWorkerMetricsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10222,12 +10877,13 @@ function _listWebWorkerMetricDefinitionsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -10247,7 +10903,7 @@ function _listWebWorkerMetricDefinitionsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); + let resultMapper = new client.models['ResourceMetricCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10263,11 +10919,9 @@ function _listWebWorkerMetricDefinitionsNext(nextPageLink, options, callback) { } /** - * @summary Get metrics for a worker pool of a AppServiceEnvironment (App - * Service Environment). + * @summary Get available SKUs for scaling a worker pool. * - * Get metrics for a worker pool of a AppServiceEnvironment (App Service - * Environment). + * Get available SKUs for scaling a worker pool. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -10284,14 +10938,13 @@ function _listWebWorkerMetricDefinitionsNext(nextPageLink, 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 ResourceMetricCollection} for more - * information. + * 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 _listWebWorkerMetricsNext(nextPageLink, options, callback) { +function _listWorkerPoolSkusNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10354,12 +11007,13 @@ function _listWebWorkerMetricsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -10379,7 +11033,7 @@ function _listWebWorkerMetricsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricCollection']().mapper(); + let resultMapper = new client.models['SkuInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10395,9 +11049,9 @@ function _listWebWorkerMetricsNext(nextPageLink, options, callback) { } /** - * @summary Get available SKUs for scaling a worker pool. + * @summary Get usage metrics for a worker pool of an App Service Environment. * - * Get available SKUs for scaling a worker pool. + * 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. @@ -10414,13 +11068,13 @@ function _listWebWorkerMetricsNext(nextPageLink, 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 SkuInfoCollection} for more information. + * 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 _listWorkerPoolSkusNext(nextPageLink, options, callback) { +function _listWebWorkerUsagesNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10483,12 +11137,13 @@ function _listWorkerPoolSkusNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -10508,7 +11163,7 @@ function _listWorkerPoolSkusNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SkuInfoCollection']().mapper(); + let resultMapper = new client.models['UsageCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10524,9 +11179,9 @@ function _listWorkerPoolSkusNext(nextPageLink, options, callback) { } /** - * @summary Get usage metrics for a worker pool of an App Service Environment. + * @summary Move an App Service Environment to a different VNET. * - * Get usage metrics for a worker pool of an App Service Environment. + * Move an App Service Environment to a different VNET. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -10543,13 +11198,13 @@ function _listWorkerPoolSkusNext(nextPageLink, 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 UsageCollection} for more information. + * 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 _listWebWorkerUsagesNext(nextPageLink, options, callback) { +function _beginChangeVnetNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10577,7 +11232,7 @@ function _listWebWorkerUsagesNext(nextPageLink, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -10602,7 +11257,7 @@ function _listWebWorkerUsagesNext(nextPageLink, options, callback) { 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); @@ -10612,12 +11267,13 @@ function _listWebWorkerUsagesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -10637,7 +11293,7 @@ function _listWebWorkerUsagesNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['UsageCollection']().mapper(); + let resultMapper = new client.models['WebAppCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10647,6 +11303,23 @@ function _listWebWorkerUsagesNext(nextPageLink, options, callback) { 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); }); @@ -10741,12 +11414,13 @@ function _beginResumeNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -10887,12 +11561,13 @@ function _beginSuspendNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -10960,6 +11635,7 @@ class AppServiceEnvironments { this._update = _update; this._listCapacities = _listCapacities; this._listVips = _listVips; + this._changeVnet = _changeVnet; this._listDiagnostics = _listDiagnostics; this._getDiagnosticsItem = _getDiagnosticsItem; this._listMetricDefinitions = _listMetricDefinitions; @@ -10993,6 +11669,7 @@ class AppServiceEnvironments { this._listWebWorkerUsages = _listWebWorkerUsages; this._beginCreateOrUpdate = _beginCreateOrUpdate; this._beginDeleteMethod = _beginDeleteMethod; + this._beginChangeVnet = _beginChangeVnet; this._beginCreateOrUpdateMultiRolePool = _beginCreateOrUpdateMultiRolePool; this._beginResume = _beginResume; this._beginSuspend = _beginSuspend; @@ -11000,6 +11677,7 @@ class AppServiceEnvironments { this._listNext = _listNext; this._listByResourceGroupNext = _listByResourceGroupNext; this._listCapacitiesNext = _listCapacitiesNext; + this._changeVnetNext = _changeVnetNext; this._listMetricsNext = _listMetricsNext; this._listMultiRolePoolsNext = _listMultiRolePoolsNext; this._listMultiRolePoolInstanceMetricDefinitionsNext = _listMultiRolePoolInstanceMetricDefinitionsNext; @@ -11020,6 +11698,7 @@ class AppServiceEnvironments { this._listWebWorkerMetricsNext = _listWebWorkerMetricsNext; this._listWorkerPoolSkusNext = _listWorkerPoolSkusNext; this._listWebWorkerUsagesNext = _listWebWorkerUsagesNext; + this._beginChangeVnetNext = _beginChangeVnetNext; this._beginResumeNext = _beginResumeNext; this._beginSuspendNext = _beginSuspendNext; } @@ -11373,6 +12052,15 @@ class AppServiceEnvironments { * @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. @@ -11488,6 +12176,15 @@ class AppServiceEnvironments { * @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. @@ -11725,6 +12422,15 @@ class AppServiceEnvironments { * @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. @@ -11836,6 +12542,15 @@ class AppServiceEnvironments { * @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. @@ -12055,7 +12770,111 @@ class AppServiceEnvironments { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listVips(resourceGroupName, name, options, optionalCallback) { + 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') { @@ -12064,14 +12883,14 @@ class AppServiceEnvironments { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listVips(resourceGroupName, name, options, (err, result, request, response) => { + self._changeVnet(resourceGroupName, name, vnetInfo, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listVips(resourceGroupName, name, options, optionalCallback); + return self._changeVnet(resourceGroupName, name, vnetInfo, options, optionalCallback); } } @@ -15628,6 +16447,15 @@ class AppServiceEnvironments { * @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. @@ -15743,6 +16571,15 @@ class AppServiceEnvironments { * @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. @@ -15896,6 +16733,110 @@ class AppServiceEnvironments { } } + /** + * @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. * @@ -16747,6 +17688,94 @@ class AppServiceEnvironments { } } + /** + * @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. * @@ -18544,6 +19573,94 @@ class AppServiceEnvironments { } } + /** + * @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. * diff --git a/lib/services/webSiteManagement2/lib/operations/appServicePlans.js b/lib/services/webSiteManagement2/lib/operations/appServicePlans.js index 418daf0d0c..edd4f486a6 100644 --- a/lib/services/webSiteManagement2/lib/operations/appServicePlans.js +++ b/lib/services/webSiteManagement2/lib/operations/appServicePlans.js @@ -54,7 +54,6 @@ function _list(options, callback) { throw new Error('callback cannot be null.'); } let detailed = (options && options.detailed !== undefined) ? options.detailed : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (detailed !== null && detailed !== undefined && typeof detailed !== 'boolean') { @@ -63,6 +62,9 @@ function _list(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -78,7 +80,7 @@ function _list(options, callback) { if (detailed !== null && detailed !== undefined) { queryParameters.push('detailed=' + encodeURIComponent(detailed.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -120,12 +122,13 @@ function _list(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -197,7 +200,6 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -220,6 +222,9 @@ function _listByResourceGroup(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -233,7 +238,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('&'); } @@ -275,12 +280,13 @@ function _listByResourceGroup(resourceGroupName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -353,7 +359,6 @@ function _get(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -379,6 +384,9 @@ function _get(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -393,7 +401,7 @@ function _get(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -488,9 +496,6 @@ function _get(resourceGroupName, name, options, callback) { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -514,9 +519,15 @@ function _get(resourceGroupName, name, options, callback) { * @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] 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. @@ -668,7 +679,6 @@ function _deleteMethod(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -694,6 +704,9 @@ function _deleteMethod(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -708,7 +721,7 @@ function _deleteMethod(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -785,9 +798,6 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanPatchResourceName Name for the - * App Service plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -811,9 +821,15 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * @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] 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. @@ -848,7 +864,6 @@ function _update(resourceGroupName, name, appServicePlan, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -877,6 +892,9 @@ function _update(resourceGroupName, name, appServicePlan, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -891,7 +909,7 @@ function _update(resourceGroupName, name, appServicePlan, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -947,12 +965,13 @@ function _update(resourceGroupName, name, appServicePlan, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1041,7 +1060,6 @@ function _listCapabilities(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1067,6 +1085,9 @@ function _listCapabilities(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1081,7 +1102,7 @@ function _listCapabilities(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1123,12 +1144,13 @@ function _listCapabilities(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1219,7 +1241,6 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1251,6 +1272,9 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1267,7 +1291,7 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); 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('&'); } @@ -1309,12 +1333,13 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1390,7 +1415,6 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1422,6 +1446,9 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1438,7 +1465,7 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); 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('&'); } @@ -1545,7 +1572,6 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1577,6 +1603,9 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1593,7 +1622,7 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); 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('&'); } @@ -1635,12 +1664,13 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1717,7 +1747,6 @@ function _listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1749,6 +1778,9 @@ function _listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1765,7 +1797,7 @@ function _listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); 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('&'); } @@ -1807,12 +1839,13 @@ function _listWebAppsByHybridConnection(resourceGroupName, name, namespaceName, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1887,7 +1920,6 @@ function _getHybridConnectionPlanLimit(resourceGroupName, name, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1913,6 +1945,9 @@ function _getHybridConnectionPlanLimit(resourceGroupName, name, options, callbac if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1927,7 +1962,7 @@ function _getHybridConnectionPlanLimit(resourceGroupName, name, options, callbac requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1969,12 +2004,13 @@ function _getHybridConnectionPlanLimit(resourceGroupName, name, options, callbac try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2048,7 +2084,6 @@ function _listHybridConnections(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2074,6 +2109,9 @@ function _listHybridConnections(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2088,7 +2126,7 @@ function _listHybridConnections(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -2130,12 +2168,13 @@ function _listHybridConnections(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2211,7 +2250,6 @@ function _listMetricDefintions(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2237,6 +2275,9 @@ function _listMetricDefintions(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2251,7 +2292,7 @@ function _listMetricDefintions(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -2293,12 +2334,13 @@ function _listMetricDefintions(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2383,7 +2425,6 @@ function _listMetrics(resourceGroupName, name, options, callback) { } let details = (options && options.details !== undefined) ? options.details : undefined; let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2415,6 +2456,9 @@ function _listMetrics(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2435,7 +2479,7 @@ function _listMetrics(resourceGroupName, name, 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('&'); } @@ -2477,12 +2521,13 @@ function _listMetrics(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2560,7 +2605,6 @@ function _restartWebApps(resourceGroupName, name, options, callback) { throw new Error('callback cannot be null.'); } let softRestart = (options && options.softRestart !== undefined) ? options.softRestart : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2589,6 +2633,9 @@ function _restartWebApps(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2606,7 +2653,7 @@ function _restartWebApps(resourceGroupName, name, options, callback) { if (softRestart !== null && softRestart !== undefined) { queryParameters.push('softRestart=' + encodeURIComponent(softRestart.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2723,7 +2770,6 @@ function _listWebApps(resourceGroupName, name, options, callback) { 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; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2758,6 +2804,9 @@ function _listWebApps(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2781,7 +2830,7 @@ function _listWebApps(resourceGroupName, name, options, callback) { if (top !== null && top !== undefined) { queryParameters.push('$top=' + encodeURIComponent(top)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2823,12 +2872,13 @@ function _listWebApps(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2900,7 +2950,6 @@ function _getServerFarmSkus(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2926,6 +2975,9 @@ function _getServerFarmSkus(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2940,7 +2992,7 @@ function _getServerFarmSkus(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -2982,12 +3034,13 @@ function _getServerFarmSkus(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3072,7 +3125,6 @@ function _listUsages(resourceGroupName, name, options, callback) { throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3101,6 +3153,9 @@ function _listUsages(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3118,7 +3173,7 @@ function _listUsages(resourceGroupName, name, 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('&'); } @@ -3160,12 +3215,13 @@ function _listUsages(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3237,7 +3293,6 @@ function _listVnets(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3263,6 +3318,9 @@ function _listVnets(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3277,7 +3335,7 @@ function _listVnets(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -3319,12 +3377,13 @@ function _listVnets(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3413,7 +3472,6 @@ function _getVnetFromServerFarm(resourceGroupName, name, vnetName, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3442,6 +3500,9 @@ function _getVnetFromServerFarm(resourceGroupName, name, vnetName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3457,7 +3518,7 @@ function _getVnetFromServerFarm(resourceGroupName, name, vnetName, options, call requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); 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('&'); } @@ -3582,7 +3643,6 @@ function _getVnetGateway(resourceGroupName, name, vnetName, gatewayName, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3614,6 +3674,9 @@ function _getVnetGateway(resourceGroupName, name, vnetName, gatewayName, options if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3630,7 +3693,7 @@ function _getVnetGateway(resourceGroupName, name, vnetName, gatewayName, options requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); 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('&'); } @@ -3672,12 +3735,13 @@ function _getVnetGateway(resourceGroupName, name, vnetName, gatewayName, options try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3764,7 +3828,6 @@ function _updateVnetGateway(resourceGroupName, name, vnetName, gatewayName, conn if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3799,6 +3862,9 @@ function _updateVnetGateway(resourceGroupName, name, vnetName, gatewayName, conn if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3815,7 +3881,7 @@ function _updateVnetGateway(resourceGroupName, name, vnetName, gatewayName, conn requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); 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('&'); } @@ -3871,12 +3937,13 @@ function _updateVnetGateway(resourceGroupName, name, vnetName, gatewayName, conn try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3952,7 +4019,6 @@ function _listRoutesForVnet(resourceGroupName, name, vnetName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3981,6 +4047,9 @@ function _listRoutesForVnet(resourceGroupName, name, vnetName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3996,7 +4065,7 @@ function _listRoutesForVnet(resourceGroupName, name, vnetName, options, callback requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); 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('&'); } @@ -4038,12 +4107,13 @@ function _listRoutesForVnet(resourceGroupName, name, vnetName, options, callback try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4133,7 +4203,6 @@ function _getRouteForVnet(resourceGroupName, name, vnetName, routeName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4165,6 +4234,9 @@ function _getRouteForVnet(resourceGroupName, name, vnetName, routeName, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4181,7 +4253,7 @@ function _getRouteForVnet(resourceGroupName, name, vnetName, routeName, options, requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); 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('&'); } @@ -4293,9 +4365,6 @@ function _getRouteForVnet(resourceGroupName, name, vnetName, routeName, options, * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @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. @@ -4342,7 +4411,6 @@ function _createOrUpdateVnetRoute(resourceGroupName, name, vnetName, routeName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4377,6 +4445,9 @@ function _createOrUpdateVnetRoute(resourceGroupName, name, vnetName, routeName, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4393,7 +4464,7 @@ function _createOrUpdateVnetRoute(resourceGroupName, name, vnetName, routeName, requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); 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('&'); } @@ -4530,7 +4601,6 @@ function _deleteVnetRoute(resourceGroupName, name, vnetName, routeName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4562,6 +4632,9 @@ function _deleteVnetRoute(resourceGroupName, name, vnetName, routeName, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4578,7 +4651,7 @@ function _deleteVnetRoute(resourceGroupName, name, vnetName, routeName, options, requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); 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('&'); } @@ -4659,9 +4732,6 @@ function _deleteVnetRoute(resourceGroupName, name, vnetName, routeName, options, * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @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. @@ -4708,7 +4778,6 @@ function _updateVnetRoute(resourceGroupName, name, vnetName, routeName, route, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4743,6 +4812,9 @@ function _updateVnetRoute(resourceGroupName, name, vnetName, routeName, route, o if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4759,7 +4831,7 @@ function _updateVnetRoute(resourceGroupName, name, vnetName, routeName, route, o requestUrl = requestUrl.replace('{routeName}', encodeURIComponent(routeName)); 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('&'); } @@ -4895,7 +4967,6 @@ function _rebootWorker(resourceGroupName, name, workerName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4924,6 +4995,9 @@ function _rebootWorker(resourceGroupName, name, workerName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4939,7 +5013,7 @@ function _rebootWorker(resourceGroupName, name, workerName, options, callback) { requestUrl = requestUrl.replace('{workerName}', encodeURIComponent(workerName)); 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('&'); } @@ -5016,9 +5090,6 @@ function _rebootWorker(resourceGroupName, name, workerName, options, callback) { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -5042,9 +5113,15 @@ function _rebootWorker(resourceGroupName, name, workerName, options, callback) { * @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] 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. @@ -5117,7 +5194,6 @@ function _beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-09-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5146,6 +5222,9 @@ function _beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -5160,7 +5239,7 @@ function _beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -5216,12 +5295,13 @@ function _beginCreateOrUpdate(resourceGroupName, name, appServicePlan, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5363,12 +5443,13 @@ function _listNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5493,12 +5574,13 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5622,12 +5704,13 @@ function _listWebAppsByHybridConnectionNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5752,12 +5835,13 @@ function _listHybridConnectionsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5884,12 +5968,13 @@ function _listMetricDefintionsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6014,12 +6099,13 @@ function _listMetricsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6143,12 +6229,13 @@ function _listWebAppsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6273,12 +6360,13 @@ function _listUsagesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6647,9 +6735,6 @@ class AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -6673,9 +6758,15 @@ class AppServicePlans { * @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] 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. @@ -6757,9 +6848,6 @@ class AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -6783,9 +6871,15 @@ class AppServicePlans { * @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] 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. @@ -6980,9 +7074,6 @@ class AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanPatchResourceName Name for the - * App Service plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -7006,9 +7097,15 @@ class AppServicePlans { * @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] 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. @@ -7052,9 +7149,6 @@ class AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanPatchResourceName Name for the - * App Service plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -7078,9 +7172,15 @@ class AppServicePlans { * @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] 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. @@ -9050,9 +9150,6 @@ class AppServicePlans { * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @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. @@ -9112,9 +9209,6 @@ class AppServicePlans { * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @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. @@ -9295,9 +9389,6 @@ class AppServicePlans { * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @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. @@ -9357,9 +9448,6 @@ class AppServicePlans { * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @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. @@ -9534,9 +9622,6 @@ class AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -9560,9 +9645,15 @@ class AppServicePlans { * @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] 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. @@ -9644,9 +9735,6 @@ class AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -9670,9 +9758,15 @@ class AppServicePlans { * @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] 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. diff --git a/lib/services/webSiteManagement2/lib/operations/certificateRegistrationProvider.js b/lib/services/webSiteManagement2/lib/operations/certificateRegistrationProvider.js index d46700b376..14e286327f 100644 --- a/lib/services/webSiteManagement2/lib/operations/certificateRegistrationProvider.js +++ b/lib/services/webSiteManagement2/lib/operations/certificateRegistrationProvider.js @@ -50,9 +50,11 @@ function _listOperations(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-08-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.'); } @@ -64,7 +66,7 @@ function _listOperations(options, callback) { let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.CertificateRegistration/operations'; let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -106,12 +108,13 @@ function _listOperations(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -238,12 +241,13 @@ function _listOperationsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { diff --git a/lib/services/webSiteManagement2/lib/operations/certificates.js b/lib/services/webSiteManagement2/lib/operations/certificates.js index 601943e575..5bda762528 100644 --- a/lib/services/webSiteManagement2/lib/operations/certificates.js +++ b/lib/services/webSiteManagement2/lib/operations/certificates.js @@ -47,12 +47,14 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -65,7 +67,7 @@ function _list(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -107,12 +109,13 @@ function _list(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -183,7 +186,6 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -206,6 +208,9 @@ function _listByResourceGroup(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -219,7 +224,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('&'); } @@ -261,12 +266,13 @@ function _listByResourceGroup(resourceGroupName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -339,7 +345,6 @@ function _get(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -365,6 +370,9 @@ function _get(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -379,7 +387,7 @@ function _get(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -421,12 +429,13 @@ function _get(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -524,7 +533,6 @@ function _createOrUpdate(resourceGroupName, name, certificateEnvelope, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -553,6 +561,9 @@ function _createOrUpdate(resourceGroupName, name, certificateEnvelope, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -567,7 +578,7 @@ function _createOrUpdate(resourceGroupName, name, certificateEnvelope, options, requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -623,12 +634,13 @@ function _createOrUpdate(resourceGroupName, name, certificateEnvelope, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -700,7 +712,6 @@ function _deleteMethod(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -726,6 +737,9 @@ function _deleteMethod(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -740,7 +754,7 @@ function _deleteMethod(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -864,7 +878,6 @@ function _update(resourceGroupName, name, certificateEnvelope, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -893,6 +906,9 @@ function _update(resourceGroupName, name, certificateEnvelope, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -907,7 +923,7 @@ function _update(resourceGroupName, name, certificateEnvelope, options, callback requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -963,12 +979,13 @@ function _update(resourceGroupName, name, certificateEnvelope, options, callback try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1092,12 +1109,13 @@ function _listNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1221,12 +1239,13 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { diff --git a/lib/services/webSiteManagement2/lib/operations/deletedWebApps.js b/lib/services/webSiteManagement2/lib/operations/deletedWebApps.js index 50d8c1e457..e8f1fec2a2 100644 --- a/lib/services/webSiteManagement2/lib/operations/deletedWebApps.js +++ b/lib/services/webSiteManagement2/lib/operations/deletedWebApps.js @@ -48,12 +48,14 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -66,7 +68,7 @@ function _list(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -108,12 +110,13 @@ function _list(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -238,12 +241,13 @@ function _listNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { diff --git a/lib/services/webSiteManagement2/lib/operations/diagnostics.js b/lib/services/webSiteManagement2/lib/operations/diagnostics.js index 9eb79eb3f3..92f387cbf1 100644 --- a/lib/services/webSiteManagement2/lib/operations/diagnostics.js +++ b/lib/services/webSiteManagement2/lib/operations/diagnostics.js @@ -15,14 +15,14 @@ const msRestAzure = require('ms-rest-azure'); const WebResource = msRest.WebResource; /** - * @summary Get Diagnostics Categories + * @summary List Hosting Environment Detector Responses * - * Get Diagnostics Categories + * List Hosting Environment Detector Responses * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} siteName Site Name + * @param {string} name Site Name * * @param {object} [options] Optional Parameters. * @@ -36,14 +36,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 DiagnosticCategoryCollection} for more + * 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 _listSiteDiagnosticCategories(resourceGroupName, siteName, options, callback) { +function _listHostingEnvironmentDetectorResponses(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -53,7 +53,6 @@ function _listSiteDiagnosticCategories(resourceGroupName, siteName, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -73,12 +72,15 @@ function _listSiteDiagnosticCategories(resourceGroupName, siteName, options, cal 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.'); } @@ -88,12 +90,12 @@ function _listSiteDiagnosticCategories(resourceGroupName, siteName, options, cal // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics'; + let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors'; 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -135,12 +137,13 @@ function _listSiteDiagnosticCategories(resourceGroupName, siteName, options, cal try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -160,7 +163,7 @@ function _listSiteDiagnosticCategories(resourceGroupName, siteName, options, cal parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticCategoryCollection']().mapper(); + let resultMapper = new client.models['DetectorResponseCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -176,19 +179,25 @@ function _listSiteDiagnosticCategories(resourceGroupName, siteName, options, cal } /** - * @summary Get Diagnostics Category + * @summary Get Hosting Environment Detector Response * - * Get Diagnostics Category + * Get Hosting Environment Detector Response * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} siteName Site Name + * @param {string} name App Service Environment Name * - * @param {string} diagnosticCategory Diagnostic Category + * @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 * @@ -199,13 +208,13 @@ function _listSiteDiagnosticCategories(resourceGroupName, siteName, 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 DiagnosticCategory} for more information. + * 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 _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCategory, options, callback) { +function _getHostingEnvironmentDetectorResponse(resourceGroupName, name, detectorName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -215,7 +224,9 @@ function _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCateg if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; + 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') { @@ -235,15 +246,35 @@ function _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCateg 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 (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 (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.'); } @@ -253,13 +284,22 @@ function _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCateg // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}'; + 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('{siteName}', encodeURIComponent(siteName)); - requestUrl = requestUrl.replace('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); + requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); + requestUrl = requestUrl.replace('{detectorName}', encodeURIComponent(detectorName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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('&'); } @@ -301,12 +341,13 @@ function _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCateg try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -326,7 +367,7 @@ function _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCateg parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticCategory']().mapper(); + let resultMapper = new client.models['DetectorResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -342,17 +383,15 @@ function _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCateg } /** - * @summary Get Site Analyses + * @summary List Site Detector Responses * - * Get Site Analyses + * List Site Detector Responses * * @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 @@ -365,14 +404,14 @@ function _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCateg * {Error} 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 + * 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 _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, options, callback) { +function _listSiteDetectorResponses(resourceGroupName, siteName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -382,7 +421,6 @@ function _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -405,12 +443,12 @@ function _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, opti 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.'); } @@ -420,13 +458,12 @@ function _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, opti // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses'; + 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('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); 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,12 +505,13 @@ function _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, opti try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -493,7 +531,7 @@ function _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, opti parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticAnalysisCollection']().mapper(); + let resultMapper = new client.models['DetectorResponseCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -509,21 +547,25 @@ function _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, opti } /** - * @summary Get Site Analysis + * @summary Get site detector response * - * Get Site Analysis + * Get site detector response * * @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} 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 * @@ -534,13 +576,13 @@ function _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, 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 DiagnosticAnalysis} for more information. + * 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 _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analysisName, options, callback) { +function _getSiteDetectorResponse(resourceGroupName, siteName, detectorName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -550,7 +592,9 @@ function _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analy if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; + 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') { @@ -573,15 +617,32 @@ function _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analy 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 (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.'); } @@ -591,14 +652,22 @@ function _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analy // 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}'; + 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('{diagnosticCategory}', encodeURIComponent(diagnosticCategory)); - requestUrl = requestUrl.replace('{analysisName}', encodeURIComponent(analysisName)); + requestUrl = requestUrl.replace('{detectorName}', encodeURIComponent(detectorName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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('&'); } @@ -640,12 +709,13 @@ function _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analy try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -665,7 +735,7 @@ function _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analy parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticAnalysis']().mapper(); + let resultMapper = new client.models['DetectorResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -681,27 +751,17 @@ function _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analy } /** - * @summary Execute Analysis + * @summary Get Diagnostics Categories * - * Execute Analysis + * Get Diagnostics Categories * * @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 * @@ -712,13 +772,14 @@ function _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analy * {Error} 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. + * 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 _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analysisName, options, callback) { +function _listSiteDiagnosticCategories(resourceGroupName, siteName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -728,10 +789,6 @@ function _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, a 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 apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -754,32 +811,12 @@ function _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, a 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.'); } @@ -789,30 +826,19 @@ function _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, a // 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'; + 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('{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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -847,12 +873,13 @@ function _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, a try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -872,7 +899,7 @@ function _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, a parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticAnalysis']().mapper(); + let resultMapper = new client.models['DiagnosticCategoryCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -888,9 +915,9 @@ function _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, a } /** - * @summary Get Detectors + * @summary Get Diagnostics Category * - * Get Detectors + * Get Diagnostics Category * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -911,14 +938,13 @@ function _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, a * {Error} 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. + * 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 _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, options, callback) { +function _getSiteDiagnosticCategory(resourceGroupName, siteName, diagnosticCategory, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -928,7 +954,6 @@ function _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -957,6 +982,9 @@ function _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, opt if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -966,13 +994,13 @@ function _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, opt // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1014,12 +1042,13 @@ function _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, opt try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1039,7 +1068,7 @@ function _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, opt parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticDetectorCollection']().mapper(); + let resultMapper = new client.models['DiagnosticCategory']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1055,9 +1084,9 @@ function _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, opt } /** - * @summary Get Detector + * @summary Get Site Analyses * - * Get Detector + * Get Site Analyses * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -1066,8 +1095,6 @@ function _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, opt * * @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 @@ -1080,14 +1107,14 @@ function _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, 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 DiagnosticDetectorCollection} for more + * 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 _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detectorName, options, callback) { +function _listSiteAnalyses(resourceGroupName, siteName, diagnosticCategory, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1097,7 +1124,6 @@ function _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detec if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1123,12 +1149,12 @@ function _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detec 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.'); } @@ -1138,14 +1164,13 @@ function _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detec // 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}'; + 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('{detectorName}', encodeURIComponent(detectorName)); 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('&'); } @@ -1187,12 +1212,13 @@ function _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detec try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1212,7 +1238,7 @@ function _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detec parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticDetectorCollection']().mapper(); + let resultMapper = new client.models['DiagnosticAnalysisCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1228,27 +1254,21 @@ function _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detec } /** - * @summary Execute Detector + * @summary Get Site Analysis * - * Execute Detector + * Get Site Analysis * * @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 Diagnostic Category * - * @param {string} diagnosticCategory Category Name + * @param {string} analysisName Analysis 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 * @@ -1259,14 +1279,13 @@ function _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detec * {Error} 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. + * 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 _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnosticCategory, options, callback) { +function _getSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analysisName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1276,10 +1295,6 @@ function _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnos 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 apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1302,32 +1317,18 @@ function _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnos 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 (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.'); } @@ -1337,30 +1338,21 @@ function _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnos // 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'; + 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('{detectorName}', encodeURIComponent(detectorName)); 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -1395,12 +1387,13 @@ function _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnos try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1420,7 +1413,7 @@ function _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnos parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticDetectorResponse']().mapper(); + let resultMapper = new client.models['DiagnosticAnalysis']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1436,19 +1429,27 @@ function _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnos } /** - * @summary Get Diagnostics Categories + * @summary Execute Analysis * - * Get Diagnostics Categories + * Execute Analysis * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * * @param {string} siteName Site Name * - * @param {string} slot Slot 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 * @@ -1459,14 +1460,13 @@ function _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnos * {Error} 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. + * 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 _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, options, callback) { +function _executeSiteAnalysis(resourceGroupName, siteName, diagnosticCategory, analysisName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1476,7 +1476,9 @@ function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; + 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') { @@ -1499,12 +1501,35 @@ function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, op 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 (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.'); } @@ -1514,20 +1539,30 @@ function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, op // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics'; + 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('{slot}', encodeURIComponent(slot)); + 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(apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -1562,12 +1597,13 @@ function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, op try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1587,7 +1623,7 @@ function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, op parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticCategoryCollection']().mapper(); + let resultMapper = new client.models['DiagnosticAnalysis']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1603,9 +1639,9 @@ function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, op } /** - * @summary Get Diagnostics Category + * @summary Get Detectors * - * Get Diagnostics Category + * Get Detectors * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -1614,8 +1650,6 @@ function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, op * * @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 @@ -1628,13 +1662,14 @@ function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, op * {Error} 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. + * 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 _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticCategory, slot, options, callback) { +function _listSiteDetectors(resourceGroupName, siteName, diagnosticCategory, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1644,7 +1679,6 @@ function _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticC if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1670,12 +1704,12 @@ function _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticC 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.'); } @@ -1685,14 +1719,13 @@ function _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticC // 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}'; + 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('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -1734,12 +1767,13 @@ function _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticC try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1759,7 +1793,7 @@ function _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticC parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticCategory']().mapper(); + let resultMapper = new client.models['DiagnosticDetectorCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1775,9 +1809,9 @@ function _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticC } /** - * @summary Get Site Analyses + * @summary Get Detector * - * Get Site Analyses + * Get Detector * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -1786,7 +1820,7 @@ function _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticC * * @param {string} diagnosticCategory Diagnostic Category * - * @param {string} slot Slot Name + * @param {string} detectorName Detector Name * * @param {object} [options] Optional Parameters. * @@ -1800,14 +1834,14 @@ function _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticC * {Error} 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 + * 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 _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, slot, options, callback) { +function _getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detectorName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1817,7 +1851,6 @@ function _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1843,12 +1876,15 @@ function _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, 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 (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.'); } @@ -1858,14 +1894,14 @@ function _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, // 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'; + 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('{slot}', encodeURIComponent(slot)); + requestUrl = requestUrl.replace('{detectorName}', encodeURIComponent(detectorName)); 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('&'); } @@ -1907,12 +1943,13 @@ function _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1932,7 +1969,7 @@ function _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticAnalysisCollection']().mapper(); + let resultMapper = new client.models['DiagnosticDetectorCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1948,23 +1985,27 @@ function _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, } /** - * @summary Get Site Analysis + * @summary Execute Detector * - * Get Site Analysis + * Execute 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} analysisName Analysis Name + * @param {string} detectorName Detector Resource Name * - * @param {string} slot Slot - optional + * @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 * @@ -1975,13 +2016,14 @@ function _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, * {Error} 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. + * 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 _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, analysisName, slot, options, callback) { +function _executeSiteDetector(resourceGroupName, siteName, detectorName, diagnosticCategory, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1991,7 +2033,9 @@ function _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, a if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; + 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') { @@ -2014,18 +2058,35 @@ function _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, a 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 (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 (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { - throw new Error('slot cannot be null or undefined and it 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.'); } @@ -2035,22 +2096,30 @@ function _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, a // 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}'; + 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('{analysisName}', encodeURIComponent(analysisName)); - requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -2085,12 +2154,13 @@ function _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, a try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2110,7 +2180,7 @@ function _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, a parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticAnalysis']().mapper(); + let resultMapper = new client.models['DiagnosticDetectorResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2126,29 +2196,19 @@ function _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, a } /** - * @summary Execute Analysis + * @summary List Site Detector Responses * - * Execute Analysis + * List Site Detector Responses * * @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 * @@ -2159,13 +2219,14 @@ function _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, a * {Error} 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. + * 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 _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, analysisName, slot, options, callback) { +function _listSiteDetectorResponsesSlot(resourceGroupName, siteName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2175,10 +2236,6 @@ function _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategor 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 apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2201,35 +2258,15 @@ function _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategor 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.'); } @@ -2239,31 +2276,20 @@ function _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategor // 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'; + 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('{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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -2298,12 +2324,13 @@ function _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategor try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2323,7 +2350,7 @@ function _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategor parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticAnalysis']().mapper(); + let resultMapper = new client.models['DetectorResponseCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2339,21 +2366,27 @@ function _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategor } /** - * @summary Get Detectors + * @summary Get site detector response * - * Get Detectors + * Get site detector response * * @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 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 * @@ -2364,14 +2397,13 @@ function _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategor * {Error} 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. + * 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 _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, slot, options, callback) { +function _getSiteDetectorResponseSlot(resourceGroupName, siteName, detectorName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2381,7 +2413,9 @@ function _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; + 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') { @@ -2404,15 +2438,35 @@ function _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, 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 (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.'); } @@ -2422,14 +2476,23 @@ function _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, // 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'; + 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('{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(apiVersion)); + 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('&'); } @@ -2471,12 +2534,13 @@ function _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2496,7 +2560,7 @@ function _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticDetectorCollection']().mapper(); + let resultMapper = new client.models['DetectorResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2512,19 +2576,15 @@ function _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, } /** - * @summary Get Detector + * @summary Get Diagnostics Categories * - * Get Detector + * Get Diagnostics Categories * * @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. @@ -2539,14 +2599,14 @@ function _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, * {Error} 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 + * 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 _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, detectorName, slot, options, callback) { +function _listSiteDiagnosticCategoriesSlot(resourceGroupName, siteName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2556,7 +2616,6 @@ function _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, d if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2579,18 +2638,15 @@ function _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, d 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.'); } @@ -2600,15 +2656,13 @@ function _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, d // 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}'; + 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('{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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2650,12 +2704,13 @@ function _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, d try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2675,7 +2730,7 @@ function _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, d parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticDetectorCollection']().mapper(); + let resultMapper = new client.models['DiagnosticCategoryCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2691,29 +2746,21 @@ function _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, d } /** - * @summary Execute Detector + * @summary Get Diagnostics Category * - * Execute Detector + * Get Diagnostics Category * * @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} diagnosticCategory Diagnostic Category * * @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 * @@ -2724,14 +2771,13 @@ function _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, d * {Error} 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. + * 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 _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, diagnosticCategory, slot, options, callback) { +function _getSiteDiagnosticCategorySlot(resourceGroupName, siteName, diagnosticCategory, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2741,10 +2787,6 @@ function _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, dia 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 apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2767,35 +2809,18 @@ function _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, dia 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.'); } @@ -2805,31 +2830,21 @@ function _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, dia // 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'; + 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('{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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -2864,12 +2879,13 @@ function _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, dia try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2889,7 +2905,7 @@ function _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, dia parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticDetectorResponse']().mapper(); + let resultMapper = new client.models['DiagnosticCategory']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2905,12 +2921,18 @@ function _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, dia } /** - * @summary Get Diagnostics Categories + * @summary Get Site Analyses * - * Get Diagnostics Categories + * Get Site Analyses * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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. * @@ -2924,14 +2946,14 @@ function _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, dia * {Error} 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 + * 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 _listSiteDiagnosticCategoriesNext(nextPageLink, options, callback) { +function _listSiteAnalysesSlot(resourceGroupName, siteName, diagnosticCategory, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2943,8 +2965,37 @@ function _listSiteDiagnosticCategoriesNext(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 (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.'); @@ -2954,8 +3005,18 @@ function _listSiteDiagnosticCategoriesNext(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.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(); @@ -2994,12 +3055,13 @@ function _listSiteDiagnosticCategoriesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3019,7 +3081,7 @@ function _listSiteDiagnosticCategoriesNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticCategoryCollection']().mapper(); + let resultMapper = new client.models['DiagnosticAnalysisCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3035,12 +3097,20 @@ function _listSiteDiagnosticCategoriesNext(nextPageLink, options, callback) { } /** - * @summary Get Site Analyses + * @summary Get Site Analysis * - * Get Site Analyses + * Get Site Analysis * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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. * @@ -3054,14 +3124,13 @@ function _listSiteDiagnosticCategoriesNext(nextPageLink, 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 DiagnosticAnalysisCollection} for more - * information. + * 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 _listSiteAnalysesNext(nextPageLink, options, callback) { +function _getSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, analysisName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3073,20 +3142,63 @@ function _listSiteAnalysesNext(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 (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } } - } catch (error) { - return callback(error); - } - - // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - + 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'; @@ -3124,12 +3236,13 @@ function _listSiteAnalysesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3149,7 +3262,7 @@ function _listSiteAnalysesNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticAnalysisCollection']().mapper(); + let resultMapper = new client.models['DiagnosticAnalysis']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3165,15 +3278,29 @@ function _listSiteAnalysesNext(nextPageLink, options, callback) { } /** - * @summary Get Detectors + * @summary Execute Analysis * - * Get Detectors + * Execute Analysis * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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 * @@ -3184,14 +3311,13 @@ function _listSiteAnalysesNext(nextPageLink, 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 DiagnosticDetectorCollection} for more - * information. + * 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 _listSiteDetectorsNext(nextPageLink, options, callback) { +function _executeSiteAnalysisSlot(resourceGroupName, siteName, diagnosticCategory, analysisName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3201,10 +3327,62 @@ function _listSiteDetectorsNext(nextPageLink, options, callback) { 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 (nextPageLink === 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 (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.'); @@ -3214,12 +3392,32 @@ function _listSiteDetectorsNext(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.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 = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -3254,12 +3452,13 @@ function _listSiteDetectorsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3279,7 +3478,7 @@ function _listSiteDetectorsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticDetectorCollection']().mapper(); + let resultMapper = new client.models['DiagnosticAnalysis']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3295,12 +3494,18 @@ function _listSiteDetectorsNext(nextPageLink, options, callback) { } /** - * @summary Get Detector + * @summary Get Detectors * - * Get Detector + * Get Detectors * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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. * @@ -3321,7 +3526,7 @@ function _listSiteDetectorsNext(nextPageLink, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getSiteDetectorNext(nextPageLink, options, callback) { +function _listSiteDetectorsSlot(resourceGroupName, siteName, diagnosticCategory, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3333,8 +3538,37 @@ function _getSiteDetectorNext(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 (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.'); @@ -3344,8 +3578,18 @@ function _getSiteDetectorNext(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.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(); @@ -3384,12 +3628,13 @@ function _getSiteDetectorNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3425,12 +3670,20 @@ function _getSiteDetectorNext(nextPageLink, options, callback) { } /** - * @summary Get Diagnostics Categories + * @summary Get Detector * - * Get Diagnostics Categories + * Get Detector * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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. * @@ -3444,14 +3697,14 @@ function _getSiteDetectorNext(nextPageLink, 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 DiagnosticCategoryCollection} for more + * 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 _listSiteDiagnosticCategoriesSlotNext(nextPageLink, options, callback) { +function _getSiteDetectorSlot(resourceGroupName, siteName, diagnosticCategory, detectorName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3463,22 +3716,65 @@ function _listSiteDiagnosticCategoriesSlotNext(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 (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); + } + if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); + } } - } catch (error) { - return callback(error); - } - - // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - - // Create HTTP transport objects - let httpRequest = new WebResource(); + 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 = {}; @@ -3514,12 +3810,13 @@ function _listSiteDiagnosticCategoriesSlotNext(nextPageLink, options, callback) try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3539,7 +3836,7 @@ function _listSiteDiagnosticCategoriesSlotNext(nextPageLink, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticCategoryCollection']().mapper(); + let resultMapper = new client.models['DiagnosticDetectorCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3555,15 +3852,29 @@ function _listSiteDiagnosticCategoriesSlotNext(nextPageLink, options, callback) } /** - * @summary Get Site Analyses + * @summary Execute Detector * - * Get Site Analyses + * Execute Detector * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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 * @@ -3574,14 +3885,14 @@ function _listSiteDiagnosticCategoriesSlotNext(nextPageLink, 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 DiagnosticAnalysisCollection} for more + * 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 _listSiteAnalysesSlotNext(nextPageLink, options, callback) { +function _executeSiteDetectorSlot(resourceGroupName, siteName, detectorName, diagnosticCategory, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3591,10 +3902,62 @@ function _listSiteAnalysesSlotNext(nextPageLink, options, callback) { 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 (nextPageLink === 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 (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.'); @@ -3604,12 +3967,32 @@ function _listSiteAnalysesSlotNext(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.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 = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -3644,12 +4027,13 @@ function _listSiteAnalysesSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3669,7 +4053,7 @@ function _listSiteAnalysesSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticAnalysisCollection']().mapper(); + let resultMapper = new client.models['DiagnosticDetectorResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3685,9 +4069,9 @@ function _listSiteAnalysesSlotNext(nextPageLink, options, callback) { } /** - * @summary Get Detectors + * @summary List Hosting Environment Detector Responses * - * Get Detectors + * List Hosting Environment Detector Responses * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -3704,14 +4088,14 @@ function _listSiteAnalysesSlotNext(nextPageLink, 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 DiagnosticDetectorCollection} for more + * 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 _listSiteDetectorsSlotNext(nextPageLink, options, callback) { +function _listHostingEnvironmentDetectorResponsesNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3774,12 +4158,13 @@ function _listSiteDetectorsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3799,7 +4184,7 @@ function _listSiteDetectorsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticDetectorCollection']().mapper(); + let resultMapper = new client.models['DetectorResponseCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3815,9 +4200,9 @@ function _listSiteDetectorsSlotNext(nextPageLink, options, callback) { } /** - * @summary Get Detector + * @summary List Site Detector Responses * - * Get Detector + * List Site Detector Responses * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -3834,14 +4219,14 @@ function _listSiteDetectorsSlotNext(nextPageLink, 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 DiagnosticDetectorCollection} for more + * 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 _getSiteDetectorSlotNext(nextPageLink, options, callback) { +function _listSiteDetectorResponsesNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -3904,12 +4289,13 @@ function _getSiteDetectorSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3929,7 +4315,7 @@ function _getSiteDetectorSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DiagnosticDetectorCollection']().mapper(); + let resultMapper = new client.models['DetectorResponseCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -3944,38 +4330,1628 @@ function _getSiteDetectorSlotNext(nextPageLink, options, callback) { }); } -/** Class representing a Diagnostics. */ -class Diagnostics { - /** - * Create a Diagnostics. - * @param {WebSiteManagementClient} client Reference to the service client. +/** + * @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. */ - constructor(client) { - this.client = client; - 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._listSiteDiagnosticCategoriesSlot = _listSiteDiagnosticCategoriesSlot; - this._getSiteDiagnosticCategorySlot = _getSiteDiagnosticCategorySlot; - this._listSiteAnalysesSlot = _listSiteAnalysesSlot; - this._getSiteAnalysisSlot = _getSiteAnalysisSlot; - this._executeSiteAnalysisSlot = _executeSiteAnalysisSlot; - this._listSiteDetectorsSlot = _listSiteDetectorsSlot; - this._getSiteDetectorSlot = _getSiteDetectorSlot; - this._executeSiteDetectorSlot = _executeSiteDetectorSlot; - this._listSiteDiagnosticCategoriesNext = _listSiteDiagnosticCategoriesNext; - this._listSiteAnalysesNext = _listSiteAnalysesNext; - this._listSiteDetectorsNext = _listSiteDetectorsNext; - this._getSiteDetectorNext = _getSiteDetectorNext; - this._listSiteDiagnosticCategoriesSlotNext = _listSiteDiagnosticCategoriesSlotNext; - this._listSiteAnalysesSlotNext = _listSiteAnalysesSlotNext; - this._listSiteDetectorsSlotNext = _listSiteDetectorsSlotNext; - this._getSiteDetectorSlotNext = _getSiteDetectorSlotNext; + 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); + } } /** @@ -4624,7 +6600,217 @@ class Diagnostics { * * @param {string} diagnosticCategory Diagnostic Category * - * @param {string} detectorName Detector Name + * @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. * @@ -4638,7 +6824,7 @@ class Diagnostics { * * {Promise} A promise is returned * - * @resolve {DiagnosticDetectorCollection} - The deserialized result object. + * @resolve {DetectorResponseCollection} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4647,14 +6833,14 @@ class Diagnostics { * {Error} 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 + * 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. */ - getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detectorName, options, optionalCallback) { + listSiteDetectorResponsesSlot(resourceGroupName, siteName, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4663,21 +6849,21 @@ class Diagnostics { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detectorName, options, (err, result, request, response) => { + self._listSiteDetectorResponsesSlot(resourceGroupName, siteName, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getSiteDetector(resourceGroupName, siteName, diagnosticCategory, detectorName, options, optionalCallback); + return self._listSiteDetectorResponsesSlot(resourceGroupName, siteName, slot, options, optionalCallback); } } /** - * @summary Execute Detector + * @summary Get site detector response * - * Execute Detector + * Get site detector response * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -4686,7 +6872,7 @@ class Diagnostics { * * @param {string} detectorName Detector Resource Name * - * @param {string} diagnosticCategory Category Name + * @param {string} slot Slot Name * * @param {object} [options] Optional Parameters. * @@ -4701,15 +6887,15 @@ class Diagnostics { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - executeSiteDetectorWithHttpOperationResponse(resourceGroupName, siteName, detectorName, diagnosticCategory, options) { + getSiteDetectorResponseSlotWithHttpOperationResponse(resourceGroupName, siteName, detectorName, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._executeSiteDetector(resourceGroupName, siteName, detectorName, diagnosticCategory, options, (err, result, request, response) => { + 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); } @@ -4720,9 +6906,9 @@ class Diagnostics { } /** - * @summary Execute Detector + * @summary Get site detector response * - * Execute Detector + * Get site detector response * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -4731,7 +6917,7 @@ class Diagnostics { * * @param {string} detectorName Detector Resource Name * - * @param {string} diagnosticCategory Category Name + * @param {string} slot Slot Name * * @param {object} [options] Optional Parameters. * @@ -4751,7 +6937,7 @@ class Diagnostics { * * {Promise} A promise is returned * - * @resolve {DiagnosticDetectorResponse} - The deserialized result object. + * @resolve {DetectorResponse} - The deserialized result object. * * @reject {Error} - The error object. * @@ -4760,14 +6946,13 @@ class Diagnostics { * {Error} 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. + * 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. */ - executeSiteDetector(resourceGroupName, siteName, detectorName, diagnosticCategory, options, optionalCallback) { + getSiteDetectorResponseSlot(resourceGroupName, siteName, detectorName, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -4776,14 +6961,14 @@ class Diagnostics { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._executeSiteDetector(resourceGroupName, siteName, detectorName, diagnosticCategory, options, (err, result, request, response) => { + self._getSiteDetectorResponseSlot(resourceGroupName, siteName, detectorName, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._executeSiteDetector(resourceGroupName, siteName, detectorName, diagnosticCategory, options, optionalCallback); + return self._getSiteDetectorResponseSlot(resourceGroupName, siteName, detectorName, slot, options, optionalCallback); } } @@ -5628,6 +7813,184 @@ class Diagnostics { } } + /** + * @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 * @@ -5984,6 +8347,95 @@ class Diagnostics { } } + /** + * @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 * diff --git a/lib/services/webSiteManagement2/lib/operations/domainRegistrationProvider.js b/lib/services/webSiteManagement2/lib/operations/domainRegistrationProvider.js index 6de060c6f0..15f1b4c10e 100644 --- a/lib/services/webSiteManagement2/lib/operations/domainRegistrationProvider.js +++ b/lib/services/webSiteManagement2/lib/operations/domainRegistrationProvider.js @@ -50,9 +50,11 @@ function _listOperations(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-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.'); } @@ -64,7 +66,7 @@ function _listOperations(options, callback) { let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.DomainRegistration/operations'; let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -106,12 +108,13 @@ function _listOperations(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -238,12 +241,13 @@ function _listOperationsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { diff --git a/lib/services/webSiteManagement2/lib/operations/domains.js b/lib/services/webSiteManagement2/lib/operations/domains.js index 639d0e7229..a1222e1242 100644 --- a/lib/services/webSiteManagement2/lib/operations/domains.js +++ b/lib/services/webSiteManagement2/lib/operations/domains.js @@ -51,12 +51,14 @@ function _checkAvailability(options, callback) { throw new Error('callback cannot be null.'); } let name = (options && options.name !== undefined) ? options.name : undefined; - let apiVersion = '2015-04-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.apiVersion === null || this.client.apiVersion === undefined || typeof 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.'); } @@ -77,7 +79,7 @@ function _checkAvailability(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -133,12 +135,13 @@ function _checkAvailability(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -206,12 +209,14 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -224,7 +229,7 @@ function _list(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -266,12 +271,13 @@ function _list(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -340,12 +346,14 @@ function _getControlCenterSsoRequest(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -358,7 +366,7 @@ function _getControlCenterSsoRequest(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -400,12 +408,13 @@ function _getControlCenterSsoRequest(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -483,7 +492,6 @@ function _listRecommendations(parameters, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (parameters === null || parameters === undefined) { @@ -492,6 +500,9 @@ function _listRecommendations(parameters, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -504,7 +515,7 @@ function _listRecommendations(parameters, options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -560,12 +571,13 @@ function _listRecommendations(parameters, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -636,7 +648,6 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -659,6 +670,9 @@ function _listByResourceGroup(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -672,7 +686,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('&'); } @@ -714,12 +728,13 @@ function _listByResourceGroup(resourceGroupName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -792,7 +807,6 @@ function _get(resourceGroupName, domainName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -818,6 +832,9 @@ function _get(resourceGroupName, domainName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -832,7 +849,7 @@ function _get(resourceGroupName, domainName, options, callback) { requestUrl = requestUrl.replace('{domainName}', encodeURIComponent(domainName)); 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('&'); } @@ -874,12 +891,13 @@ function _get(resourceGroupName, domainName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1117,7 +1135,6 @@ function _deleteMethod(resourceGroupName, domainName, options, callback) { throw new Error('callback cannot be null.'); } let forceHardDeleteDomain = (options && options.forceHardDeleteDomain !== undefined) ? options.forceHardDeleteDomain : undefined; - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1146,6 +1163,9 @@ function _deleteMethod(resourceGroupName, domainName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1163,7 +1183,7 @@ function _deleteMethod(resourceGroupName, domainName, options, callback) { if (forceHardDeleteDomain !== null && forceHardDeleteDomain !== undefined) { queryParameters.push('forceHardDeleteDomain=' + encodeURIComponent(forceHardDeleteDomain.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1342,7 +1362,6 @@ function _update(resourceGroupName, domainName, domain, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1377,6 +1396,9 @@ function _update(resourceGroupName, domainName, domain, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1391,7 +1413,7 @@ function _update(resourceGroupName, domainName, domain, options, callback) { requestUrl = requestUrl.replace('{domainName}', encodeURIComponent(domainName)); 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('&'); } @@ -1447,12 +1469,13 @@ function _update(resourceGroupName, domainName, domain, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1543,7 +1566,6 @@ function _listOwnershipIdentifiers(resourceGroupName, domainName, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1569,6 +1591,9 @@ function _listOwnershipIdentifiers(resourceGroupName, domainName, options, callb if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1583,7 +1608,7 @@ function _listOwnershipIdentifiers(resourceGroupName, domainName, options, callb requestUrl = requestUrl.replace('{domainName}', encodeURIComponent(domainName)); 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('&'); } @@ -1625,12 +1650,13 @@ function _listOwnershipIdentifiers(resourceGroupName, domainName, options, callb try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1706,7 +1732,6 @@ function _getOwnershipIdentifier(resourceGroupName, domainName, name, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1735,6 +1760,9 @@ function _getOwnershipIdentifier(resourceGroupName, domainName, name, options, c if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1750,7 +1778,7 @@ function _getOwnershipIdentifier(resourceGroupName, domainName, name, options, c requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1792,12 +1820,13 @@ function _getOwnershipIdentifier(resourceGroupName, domainName, name, options, c try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1882,7 +1911,6 @@ function _createOrUpdateOwnershipIdentifier(resourceGroupName, domainName, name, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1914,6 +1942,9 @@ function _createOrUpdateOwnershipIdentifier(resourceGroupName, domainName, name, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1929,7 +1960,7 @@ function _createOrUpdateOwnershipIdentifier(resourceGroupName, domainName, name, requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -1985,12 +2016,13 @@ function _createOrUpdateOwnershipIdentifier(resourceGroupName, domainName, name, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2064,7 +2096,6 @@ function _deleteOwnershipIdentifier(resourceGroupName, domainName, name, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2093,6 +2124,9 @@ function _deleteOwnershipIdentifier(resourceGroupName, domainName, name, options if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2108,7 +2142,7 @@ function _deleteOwnershipIdentifier(resourceGroupName, domainName, name, options requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -2223,7 +2257,6 @@ function _updateOwnershipIdentifier(resourceGroupName, domainName, name, domainO if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2255,6 +2288,9 @@ function _updateOwnershipIdentifier(resourceGroupName, domainName, name, domainO if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2270,7 +2306,7 @@ function _updateOwnershipIdentifier(resourceGroupName, domainName, name, domainO requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -2326,12 +2362,13 @@ function _updateOwnershipIdentifier(resourceGroupName, domainName, name, domainO try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2366,6 +2403,150 @@ function _updateOwnershipIdentifier(resourceGroupName, domainName, name, domainO }); } +/** + * @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. * @@ -2484,7 +2665,6 @@ function _beginCreateOrUpdate(resourceGroupName, domainName, domain, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2519,6 +2699,9 @@ function _beginCreateOrUpdate(resourceGroupName, domainName, domain, options, ca if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -2533,7 +2716,7 @@ function _beginCreateOrUpdate(resourceGroupName, domainName, domain, options, ca requestUrl = requestUrl.replace('{domainName}', encodeURIComponent(domainName)); 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('&'); } @@ -2589,12 +2772,13 @@ function _beginCreateOrUpdate(resourceGroupName, domainName, domain, options, ca try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2735,12 +2919,13 @@ function _listNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2865,12 +3050,13 @@ function _listRecommendationsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2994,12 +3180,13 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3124,12 +3311,13 @@ function _listOwnershipIdentifiersNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3186,6 +3374,7 @@ class Domains { this._createOrUpdateOwnershipIdentifier = _createOrUpdateOwnershipIdentifier; this._deleteOwnershipIdentifier = _deleteOwnershipIdentifier; this._updateOwnershipIdentifier = _updateOwnershipIdentifier; + this._renew = _renew; this._beginCreateOrUpdate = _beginCreateOrUpdate; this._listNext = _listNext; this._listRecommendationsNext = _listRecommendationsNext; @@ -4836,6 +5025,97 @@ class Domains { } } + /** + * @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. * diff --git a/lib/services/webSiteManagement2/lib/operations/index.d.ts b/lib/services/webSiteManagement2/lib/operations/index.d.ts index adc66a835d..6383b5e281 100644 --- a/lib/services/webSiteManagement2/lib/operations/index.d.ts +++ b/lib/services/webSiteManagement2/lib/operations/index.d.ts @@ -3440,6 +3440,70 @@ export interface Domains { 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. * @@ -5116,6 +5180,300 @@ export interface DeletedWebApps { 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 * @@ -5709,6 +6067,161 @@ export interface Diagnostics { 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 * @@ -6334,6 +6847,130 @@ export interface Diagnostics { 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 * @@ -6582,6 +7219,68 @@ export interface Diagnostics { 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 * @@ -6846,16 +7545,19 @@ export interface Provider { * * @param {object} [options] Optional Parameters. * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getAvailableStacksWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getAvailableStacksWithHttpOperationResponse(options?: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Get available application frameworks and their versions @@ -6864,6 +7566,9 @@ export interface Provider { * * @param {object} [options] Optional Parameters. * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -6874,7 +7579,7 @@ export interface Provider { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {ApplicationStackCollection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6882,15 +7587,17 @@ export interface Provider { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {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?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getAvailableStacks(callback: ServiceCallback): void; - getAvailableStacks(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + getAvailableStacks(options?: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + getAvailableStacks(callback: ServiceCallback): void; + getAvailableStacks(options: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -6960,16 +7667,19 @@ export interface Provider { * * @param {object} [options] Optional Parameters. * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - getAvailableStacksOnPremWithHttpOperationResponse(options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getAvailableStacksOnPremWithHttpOperationResponse(options?: { osTypeSelected? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Get available application frameworks and their versions @@ -6978,6 +7688,9 @@ export interface Provider { * * @param {object} [options] Optional Parameters. * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -6988,7 +7701,7 @@ export interface Provider { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {ApplicationStackCollection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -6996,15 +7709,79 @@ export interface Provider { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {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?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getAvailableStacksOnPrem(callback: ServiceCallback): void; - getAvailableStacksOnPrem(options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** @@ -7071,6 +7848,68 @@ export interface Provider { 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; } /** @@ -7103,11 +7942,11 @@ export interface Recommendations { * * @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?: { featured? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + listWithHttpOperationResponse(options?: { featured? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary List all recommendations for a subscription. @@ -7135,7 +7974,7 @@ export interface Recommendations { * * {Promise} A promise is returned. * - * @resolve {Array} - The deserialized result object. + * @resolve {RecommendationCollection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7143,15 +7982,17 @@ export interface Recommendations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Array} [result] - The deserialized result object if an error did not occur. + * {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; + 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; /** @@ -7208,6 +8049,68 @@ export interface Recommendations { 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. @@ -7221,6 +8124,10 @@ export interface Recommendations { * * @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=channels eq 'Api' or channel eq 'Notification' and * startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' @@ -7231,11 +8138,11 @@ export interface Recommendations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listHistoryForWebAppWithHttpOperationResponse(resourceGroupName: string, siteName: string, options?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + 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 @@ -7250,6 +8157,10 @@ export interface Recommendations { * * @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=channels eq 'Api' or channel eq 'Notification' and * startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' @@ -7265,7 +8176,7 @@ export interface Recommendations { * * {Promise} A promise is returned. * - * @resolve {Array} - The deserialized result object. + * @resolve {RecommendationCollection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7273,15 +8184,17 @@ export interface Recommendations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Array} [result] - The deserialized result object if an error did not occur. + * {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?: { filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listHistoryForWebApp(resourceGroupName: string, siteName: string, callback: ServiceCallback): void; - listHistoryForWebApp(resourceGroupName: string, siteName: string, options: { filter? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** @@ -7309,11 +8222,11 @@ export interface Recommendations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @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>; + listRecommendedRulesForWebAppWithHttpOperationResponse(resourceGroupName: string, siteName: string, options?: { featured? : boolean, filter? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Get all recommendations for an app. @@ -7345,7 +8258,7 @@ export interface Recommendations { * * {Promise} A promise is returned. * - * @resolve {Array} - The deserialized result object. + * @resolve {RecommendationCollection} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -7353,15 +8266,17 @@ export interface Recommendations { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Array} [result] - The deserialized result object if an error did not occur. + * {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; + 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; /** @@ -7509,6 +8424,10 @@ export interface Recommendations { * @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 * @@ -7518,7 +8437,7 @@ export interface Recommendations { * * @reject {Error|ServiceError} - The error object. */ - getRuleDetailsByWebAppWithHttpOperationResponse(resourceGroupName: string, siteName: string, name: string, options?: { updateSeen? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + 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. @@ -7537,6 +8456,10 @@ export interface Recommendations { * @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 * @@ -7562,9 +8485,265 @@ export interface Recommendations { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getRuleDetailsByWebApp(resourceGroupName: string, siteName: string, name: string, options?: { updateSeen? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + 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, customHeaders? : { [headerName: string]: 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; } /** @@ -7795,6 +8974,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -7813,6 +8994,9 @@ export interface WebApps { * @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. @@ -8011,9 +9195,29 @@ export interface WebApps { * @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. @@ -8089,51 +9293,17 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests * * @param {object} [siteEnvelope.identity] * - * @param {object} [siteEnvelope.identity.type] Type of managed service - * 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. * @@ -8143,19 +9313,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -8165,7 +9322,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.Site, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + createOrUpdateWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.Site, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Creates a new web, mobile, or API app in an existing resource @@ -8197,6 +9354,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -8215,6 +9374,9 @@ export interface WebApps { * @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. @@ -8413,9 +9575,29 @@ export interface WebApps { * @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. @@ -8491,51 +9673,17 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests * * @param {object} [siteEnvelope.identity] * - * @param {object} [siteEnvelope.identity.type] Type of managed service - * 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. * @@ -8545,19 +9693,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -8583,9 +9718,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + createOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; createOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, callback: ServiceCallback): void; - createOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -8608,9 +9743,6 @@ export interface WebApps { * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -8620,7 +9752,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - deleteMethodWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, skipDnsRegistration? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + deleteMethodWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Deletes a web, mobile, or API app, or one of the deployment slots. @@ -8642,9 +9774,6 @@ export interface WebApps { * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -8669,9 +9798,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - deleteMethod(resourceGroupName: string, name: string, options?: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, skipDnsRegistration? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + deleteMethod(resourceGroupName: string, name: string, options?: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; deleteMethod(resourceGroupName: string, name: string, callback: ServiceCallback): void; - deleteMethod(resourceGroupName: string, name: string, options: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, skipDnsRegistration? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteMethod(resourceGroupName: string, name: string, options: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -8704,6 +9833,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -8722,6 +9853,9 @@ export interface WebApps { * @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. @@ -8920,9 +10054,29 @@ export interface WebApps { * @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. @@ -8998,43 +10152,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -9043,19 +10160,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -9065,7 +10169,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - updateWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + updateWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Creates a new web, mobile, or API app in an existing resource @@ -9097,6 +10201,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -9115,6 +10221,9 @@ export interface WebApps { * @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. @@ -9313,9 +10422,29 @@ export interface WebApps { * @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. @@ -9391,43 +10520,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -9436,19 +10528,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -9474,9 +10553,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - update(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + update(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; update(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, callback: ServiceCallback): void; - update(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, options: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + update(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -9648,8 +10727,6 @@ export interface WebApps { * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName 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. @@ -9680,9 +10757,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -9711,8 +10785,6 @@ export interface WebApps { * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName 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. @@ -9743,9 +10815,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -9845,157 +10914,6 @@ export interface WebApps { listBackups(resourceGroupName: string, name: 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. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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. - */ - discoverRestoreWithHttpOperationResponse(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. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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. - */ - discoverRestore(resourceGroupName: string, name: string, request: models.RestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - discoverRestore(resourceGroupName: string, name: string, request: models.RestoreRequest, callback: ServiceCallback): void; - discoverRestore(resourceGroupName: string, name: string, request: models.RestoreRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - /** * @summary Gets a backup of an app by its ID. * @@ -10153,8 +11071,6 @@ export interface WebApps { * * @param {object} request Information on backup request. * - * @param {string} request.backupRequestName 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. @@ -10185,9 +11101,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -10223,8 +11136,6 @@ export interface WebApps { * * @param {object} request Information on backup request. * - * @param {string} request.backupRequestName 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. @@ -10255,9 +11166,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -10335,7 +11243,7 @@ export interface WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -10353,11 +11261,11 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @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>; + 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 @@ -10402,7 +11310,7 @@ export interface WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -10425,7 +11333,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {RestoreResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -10433,16 +11341,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestoreResponse} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} 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. */ - 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; + 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; /** @@ -10728,6 +11635,9 @@ export interface WebApps { * 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 @@ -10894,6 +11804,9 @@ export interface WebApps { * 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 @@ -11081,8 +11994,6 @@ export interface WebApps { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName 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. @@ -11113,9 +12024,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -11143,8 +12051,6 @@ export interface WebApps { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName 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. @@ -11175,9 +12081,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -12330,6 +13233,339 @@ export interface WebApps { 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. @@ -12426,6 +13662,9 @@ export interface WebApps { * * @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. * @@ -12603,8 +13842,28 @@ export interface WebApps { * @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. @@ -12647,6 +13906,9 @@ export interface WebApps { * * @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. * @@ -12824,8 +14086,28 @@ export interface WebApps { * @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. @@ -12887,6 +14169,9 @@ export interface WebApps { * * @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. * @@ -13064,8 +14349,28 @@ export interface WebApps { * @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. @@ -13108,6 +14413,9 @@ export interface WebApps { * * @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. * @@ -13285,8 +14593,28 @@ export interface WebApps { * @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. @@ -13615,7 +14943,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - getWebSiteContainerLogsZipWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + getContainerLogsZipWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Gets the ZIP archived docker log files for the given site @@ -13653,9 +14981,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getWebSiteContainerLogsZip(resourceGroupName: string, name: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getWebSiteContainerLogsZip(resourceGroupName: string, name: string, callback: ServiceCallback): void; - getWebSiteContainerLogsZip(resourceGroupName: string, name: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** @@ -14149,8 +15477,6 @@ export interface WebApps { * * @param {object} deployment Deployment details. * - * @param {string} [deployment.deploymentId] Identifier for deployment. - * * @param {number} [deployment.status] Deployment status. * * @param {string} [deployment.message] Details about deployment status. @@ -14199,8 +15525,6 @@ export interface WebApps { * * @param {object} deployment Deployment details. * - * @param {string} [deployment.deploymentId] Identifier for deployment. - * * @param {number} [deployment.status] Deployment status. * * @param {string} [deployment.message] Details about deployment status. @@ -14399,6 +15723,159 @@ export interface WebApps { 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. * @@ -15253,6 +16730,8 @@ export interface WebApps { * * @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. @@ -15299,6 +16778,8 @@ export interface WebApps { * * @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. @@ -18904,12 +20385,6 @@ export interface WebApps { * * @param {string} [premierAddOn.vendor] Premier add on Vendor. * - * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * * @param {string} [premierAddOn.marketplacePublisher] Premier add on * Marketplace publisher. * @@ -18956,12 +20431,6 @@ export interface WebApps { * * @param {string} [premierAddOn.vendor] Premier add on Vendor. * - * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * * @param {string} [premierAddOn.marketplacePublisher] Premier add on * Marketplace publisher. * @@ -19074,6 +20543,265 @@ export interface WebApps { 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. @@ -19955,57 +21683,443 @@ export interface WebApps { * * {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; + 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} [options] Optional Parameters. + * + * @param {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {object} [options.customHeaders] Headers that 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, options?: { format? : string, 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} [options] Optional Parameters. + * + * @param {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} 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, options?: { format? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, callback: ServiceCallback): void; + listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, options: { format? : string, 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 Gets the publishing profile for an app (or deployment slot, if - * specified). + * @summary Restores a deleted web app to this web app. * - * Gets the publishing profile for an app (or deployment slot, if specified). + * 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 the app. + * @param {string} name Name of web app. * - * @param {object} [options] Optional Parameters. + * @param {object} restoreRequest Deleted web app restore information. * - * @param {string} [options.format] Name of the format. Valid values are: - * FileZilla3 - * WebDeploy -- default - * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * @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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. */ - listPublishingProfileXmlWithSecretsWithHttpOperationResponse(resourceGroupName: string, name: string, options?: { format? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + restoreFromDeletedAppWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets the publishing profile for an app (or deployment slot, if - * specified). + * @summary Restores a deleted web app to this web app. * - * Gets the publishing profile for an app (or deployment slot, if specified). + * 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 the app. + * @param {string} name Name of web app. * - * @param {object} [options] Optional Parameters. + * @param {object} restoreRequest Deleted web app restore information. * - * @param {string} [options.format] Name of the format. Valid values are: - * FileZilla3 - * WebDeploy -- default - * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * @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 @@ -20017,7 +22131,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {Object} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -20025,58 +22139,59 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {Object} [result] - The deserialized result object if an error did not occur. + * {null} [result] - The deserialized result object if an error did not occur. * * {WebResource} [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, options?: { format? : string, customHeaders? : { [headerName: string]: string; } }): Promise; - listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, callback: ServiceCallback): void; - listPublishingProfileXmlWithSecrets(resourceGroupName: string, name: string, options: { format? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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 Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -20089,200 +22204,53 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - recoverWithHttpOperationResponse(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + restoreSnapshotWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.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. - */ - recover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - recover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, callback: ServiceCallback): void; - recover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, 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 {string} [restoreRequest.kind] Kind of resource. * * @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 * @@ -20307,9 +22275,9 @@ export interface WebApps { * * {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; + 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; /** @@ -20754,6 +22722,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -20772,6 +22742,9 @@ export interface WebApps { * @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. @@ -20970,9 +22943,29 @@ export interface WebApps { * @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. @@ -21048,51 +23041,17 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests * * @param {object} [siteEnvelope.identity] * - * @param {object} [siteEnvelope.identity.type] Type of managed service - * 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. * @@ -21105,19 +23064,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -21127,7 +23073,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - createOrUpdateSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + 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 @@ -21159,6 +23105,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -21177,6 +23125,9 @@ export interface WebApps { * @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. @@ -21375,9 +23326,29 @@ export interface WebApps { * @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. @@ -21453,51 +23424,17 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests * * @param {object} [siteEnvelope.identity] * - * @param {object} [siteEnvelope.identity.type] Type of managed service - * 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. * @@ -21510,19 +23447,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -21548,9 +23472,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - createOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + 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: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + createOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -21576,9 +23500,6 @@ export interface WebApps { * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -21588,7 +23509,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - deleteSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, skipDnsRegistration? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + 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. @@ -21613,9 +23534,6 @@ export interface WebApps { * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -21640,9 +23558,9 @@ export interface WebApps { * * {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, skipDnsRegistration? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + 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, skipDnsRegistration? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + deleteSlot(resourceGroupName: string, name: string, slot: string, options: { deleteMetrics? : boolean, deleteEmptyServerFarm? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -21675,6 +23593,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -21693,6 +23613,9 @@ export interface WebApps { * @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. @@ -21891,9 +23814,29 @@ export interface WebApps { * @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. @@ -21969,43 +23912,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -22017,19 +23923,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -22039,7 +23932,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - updateSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, slot: string, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + 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 @@ -22071,6 +23964,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -22089,6 +23984,9 @@ export interface WebApps { * @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. @@ -22287,9 +24185,29 @@ export interface WebApps { * @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. @@ -22365,43 +24283,6 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -22413,19 +24294,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -22451,9 +24319,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - updateSlot(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, slot: string, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + 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: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + updateSlot(resourceGroupName: string, name: string, siteEnvelope: models.SitePatchResource, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -22637,8 +24505,6 @@ export interface WebApps { * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName 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. @@ -22669,9 +24535,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -22703,8 +24566,6 @@ export interface WebApps { * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName 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. @@ -22735,9 +24596,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -22846,163 +24704,6 @@ export interface WebApps { listBackupsSlot(resourceGroupName: string, name: 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. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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. - */ - discoverRestoreSlotWithHttpOperationResponse(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. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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. - */ - discoverRestoreSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - discoverRestoreSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, callback: ServiceCallback): void; - discoverRestoreSlot(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; - - /** * @summary Gets a backup of an app by its ID. * @@ -23172,8 +24873,6 @@ export interface WebApps { * * @param {object} request Information on backup request. * - * @param {string} request.backupRequestName 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. @@ -23204,9 +24903,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -23245,8 +24941,6 @@ export interface WebApps { * * @param {object} request Information on backup request. * - * @param {string} request.backupRequestName 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. @@ -23277,9 +24971,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will @@ -23360,7 +25051,7 @@ export interface WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -23381,11 +25072,11 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @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>; + 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 @@ -23430,7 +25121,7 @@ export interface WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -23456,7 +25147,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {RestoreResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -23464,16 +25155,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestoreResponse} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} 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. */ - 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; + 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; /** @@ -23781,6 +25471,9 @@ export interface WebApps { * 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 @@ -23950,6 +25643,9 @@ export interface WebApps { * 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 @@ -24146,8 +25842,6 @@ export interface WebApps { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName 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. @@ -24178,9 +25872,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -24212,8 +25903,6 @@ export interface WebApps { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName 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. @@ -24244,9 +25933,6 @@ export interface WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -25243,23 +26929,95 @@ export interface WebApps { * * {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; + 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 the Push settings associated with web app. + * @summary Gets a Swift Virtual Network connection. * - * Gets the Push settings associated with web app. + * Gets a Swift Virtual Network connection. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -25268,24 +27026,25 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @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>; + getSwiftVirtualNetworkConnectionSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets the Push settings associated with web app. + * @summary Gets a Swift Virtual Network connection. * - * Gets the Push settings associated with web app. + * Gets a Swift Virtual Network connection. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -25299,7 +27058,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {PushSettings} - The deserialized result object. + * @resolve {SwiftVirtualNetwork} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -25307,16 +27066,302 @@ export interface WebApps { * * {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. + * {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. */ - 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; + 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; /** @@ -25421,6 +27466,9 @@ export interface WebApps { * * @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. * @@ -25598,8 +27646,28 @@ export interface WebApps { * @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 @@ -25645,6 +27713,9 @@ export interface WebApps { * * @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. * @@ -25822,8 +27893,28 @@ export interface WebApps { * @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 @@ -25888,6 +27979,9 @@ export interface WebApps { * * @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. * @@ -26065,8 +28159,28 @@ export interface WebApps { * @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 @@ -26112,6 +28226,9 @@ export interface WebApps { * * @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. * @@ -26289,8 +28406,28 @@ export interface WebApps { * @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 @@ -26649,7 +28786,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - getWebSiteContainerLogsZipSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + 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 @@ -26690,9 +28827,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - getWebSiteContainerLogsZipSlot(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - getWebSiteContainerLogsZipSlot(resourceGroupName: string, name: string, slot: string, callback: ServiceCallback): void; - getWebSiteContainerLogsZipSlot(resourceGroupName: string, name: string, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** @@ -27209,150 +29346,345 @@ export interface WebApps { * * {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; - + 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 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 {string} [deployment.deploymentId] Identifier for deployment. - * - * @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. + * @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. * - * Create a deployment for an app, or a deployment slot. + * 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 {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 {string} [deployment.deploymentId] Identifier for deployment. - * - * @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. + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. * - * {Promise} A promise is returned. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @resolve {Deployment} - The deserialized result object. + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @reject {Error|ServiceError} - The error object. + * @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. * - * {ServiceCallback} optionalCallback(err, result, request, response) + * @param {string} [request.siteName] Name of an app. * - * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. * - * {Deployment} [result] - The deserialized result object if an error did not occur. - * See {@link Deployment} for more information. + * @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. * - * {WebResource} [request] - The HTTP Request object if an error did not occur. + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * {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. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * Delete a deployment by its ID for an app, or a deployment slot. + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. * - * @param {string} name Name of the app. + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). * - * @param {string} id Deployment ID. + * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. + * specified, the API will perform discovery for the production slot. * * @param {object} [options] Optional Parameters. * @@ -27361,108 +29693,68 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @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>; + discoverBackupSlotWithHttpOperationResponse(resourceGroupName: string, name: string, request: models.RestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Delete a deployment by its ID for an app, or a deployment slot. + * @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. * - * Delete a deployment by its ID for an app, or a deployment slot. + * 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 {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 {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. * - * @param {string} name Name of the app. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @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} [request.blobName] Name of a blob which contains the backup. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. + * @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 {object} [options] Optional Parameters. + * @param {string} [request.siteName] Name of an app. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. * - * @returns {Promise} A promise is returned + * @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. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * @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. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * List deployment log for specific deployment for an app, or a deployment - * slot. + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. * - * @param {string} name Name of the app. + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). * - * @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} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. + * specified, the API will perform discovery for the production slot. * * @param {object} [options] Optional Parameters. * @@ -27476,7 +29768,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {Deployment} - The deserialized result object. + * @resolve {RestoreRequest} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -27484,16 +29776,16 @@ export interface WebApps { * * {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. + * {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. */ - 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; + 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; /** @@ -28419,6 +30711,8 @@ export interface WebApps { * * @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. @@ -28468,6 +30762,8 @@ export interface WebApps { * * @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. @@ -32019,25 +34315,399 @@ export interface WebApps { * * {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; + 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 a named add-on of an app. + * @summary Gets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Gets a named add-on of an app. + * 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 Name of the app. - * - * @param {string} premierAddOnName Add-on name. + * @param {string} name The name of the web app. * - * @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 {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. * @@ -32046,26 +34716,25 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @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>; + getPrivateAccessSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Gets a named add-on of an app. + * @summary Gets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Gets a named add-on of an app. + * 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 Name of the app. - * - * @param {string} premierAddOnName Add-on name. + * @param {string} name The name of the web app. * - * @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 {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. * @@ -32079,7 +34748,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {PremierAddOn} - The deserialized result object. + * @resolve {PrivateAccess} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -32087,59 +34756,40 @@ export interface WebApps { * * {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. + * {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. */ - 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; + 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 Updates a named add-on of an app. + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Updates a named add-on of an app. + * 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 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.premierAddOnName] Premier add on Name. + * @param {string} name The name of the web app. * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. + * @param {object} access The information for the private access * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. + * @param {boolean} [access.enabled] Whether private access is enabled or not. * - * @param {string} [premierAddOn.marketplacePublisher] Premier add on - * Marketplace publisher. + * @param {array} [access.virtualNetworks] The Virtual Networks (and subnets) + * allowed to access the site privately. * - * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace - * offer. - * - * @param {string} [premierAddOn.kind] Kind of resource. - * - * @param {string} premierAddOn.location Resource Location. + * @param {string} [access.kind] Kind of resource. * - * @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 {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. * @@ -32148,128 +34798,34 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @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.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * - * @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; - + putPrivateAccessVnetSlotWithHttpOperationResponse(resourceGroupName: string, name: string, access: models.PrivateAccess, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Delete a premier add-on from an app. + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Delete a premier add-on from an app. + * 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 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 + * @param {string} name The name of the web app. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {object} access The information for the private access * - * @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. + * @param {boolean} [access.enabled] Whether private access is enabled or not. * - * Delete a premier add-on from an app. + * @param {array} [access.virtualNetworks] The Virtual Networks (and subnets) + * allowed to access the site privately. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {string} [access.kind] Kind of resource. * - * @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 {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. * @@ -32283,7 +34839,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {null} - The deserialized result object. + * @resolve {PrivateAccess} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -32291,15 +34847,16 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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. */ - 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; + 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; /** @@ -33343,110 +35900,136 @@ export interface WebApps { /** - * @summary Recovers a web app to a previous snapshot. + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * Recovers a web app to a previous snapshot. + * 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 web app. + * @param {string} name Name of the app. * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API resets configuration settings for the production slot. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {object} [options] Optional Parameters. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @returns {Promise} A promise is returned * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {boolean} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. + * @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. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. + * Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * @param {boolean} [recoveryEntity.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} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {string} [recoveryEntity.kind] Kind of resource. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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 + * @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 {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [request] - The HTTP Request object if an error did not occur. + * + * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - recoverSlotWithHttpOperationResponse(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + 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 Recovers a web app to a previous snapshot. + * @summary Restarts an app (or deployment slot, if specified). * - * Recovers a web app to a previous snapshot. + * 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 web app. + * @param {string} name Name of the app. * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restart the production slot. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {object} [options] Optional Parameters. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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 {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @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 {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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 {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. + * @returns {Promise} A promise is returned * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {boolean} [recoveryEntity.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. + * @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). * - * @param {string} [recoveryEntity.kind] Kind of resource. + * Restarts an app (or deployment slot, if specified). * - * @param {string} slot Name of web app slot. If not specified then will - * default to production 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 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 * @@ -33471,25 +36054,63 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - recoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - recoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, callback: ServiceCallback): void; - recoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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 Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * @summary Restores an app from a backup blob in Azure Storage. * - * Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * 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 resets configuration settings for the production slot. + * specified, the API will restore a backup of the production slot. * * @param {object} [options] Optional Parameters. * @@ -33502,22 +36123,60 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - resetSlotConfigurationSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + restoreFromBackupBlobSlotWithHttpOperationResponse(resourceGroupName: string, name: string, request: models.RestoreRequest, 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. + * @summary Restores an app from a backup blob in Azure Storage. * - * Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * 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 resets configuration settings for the production slot. + * specified, the API will restore a backup of the production slot. * * @param {object} [options] Optional Parameters. * @@ -33545,33 +36204,40 @@ export interface WebApps { * * {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; + 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 Restarts an app (or deployment slot, if specified). + * @summary Restores a deleted web app to this web app. * - * Restarts an app (or deployment slot, if specified). + * 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 the app. + * @param {string} name Name of web app. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will restart the production slot. + * @param {object} restoreRequest Deleted web app restore information. * - * @param {object} [options] Optional Parameters. + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} * - * @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} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. * - * @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 {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 @@ -33582,30 +36248,173 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - restartSlotWithHttpOperationResponse(resourceGroupName: string, name: string, slot: string, options?: { softRestart? : boolean, synchronous? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + restoreFromDeletedAppSlotWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.DeletedAppRestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Restarts an app (or deployment slot, if specified). + * @summary Restores a deleted web app to this web app. * - * Restarts an app (or deployment slot, if specified). + * 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 the app. + * @param {string} name Name of web app. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will restart the production slot. + * @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 {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 {object} [options.customHeaders] Headers that will be added to the + * request * - * @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 {ServiceCallback} [optionalCallback] - The optional callback. + * + * @returns {ServiceCallback|Promise} If a callback was passed as the last + * parameter then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned. + * + * @resolve {null} - The deserialized result object. + * + * @reject {Error|ServiceError} - The error object. + * + * {ServiceCallback} optionalCallback(err, result, request, response) + * + * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. + * + * {null} [result] - The deserialized result object if an error did not occur. + * + * {WebResource} [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 @@ -33631,9 +36440,9 @@ export interface WebApps { * * {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; + 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; /** @@ -38470,6 +41279,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -38488,6 +41299,9 @@ export interface WebApps { * @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. @@ -38686,9 +41500,29 @@ export interface WebApps { * @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. @@ -38764,51 +41598,17 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests * * @param {object} [siteEnvelope.identity] * - * @param {object} [siteEnvelope.identity.type] Type of managed service - * 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. * @@ -38818,19 +41618,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -38840,7 +41627,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.Site, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + beginCreateOrUpdateWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.Site, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Creates a new web, mobile, or API app in an existing resource @@ -38872,6 +41659,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -38890,6 +41679,9 @@ export interface WebApps { * @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. @@ -39088,9 +41880,29 @@ export interface WebApps { * @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. @@ -39166,51 +41978,17 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests * * @param {object} [siteEnvelope.identity] * - * @param {object} [siteEnvelope.identity.type] Type of managed service - * 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. * @@ -39220,19 +41998,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -39258,9 +42023,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + beginCreateOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; beginCreateOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, callback: ServiceCallback): void; - beginCreateOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdate(resourceGroupName: string, name: string, siteEnvelope: models.Site, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -39306,7 +42071,7 @@ export interface WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -39324,11 +42089,11 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @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>; + 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 @@ -39373,7 +42138,7 @@ export interface WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -39396,7 +42161,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {RestoreResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -39404,16 +42169,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestoreResponse} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} 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. */ - 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; + 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; /** @@ -39616,6 +42380,8 @@ export interface WebApps { * * @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. @@ -39662,6 +42428,8 @@ export interface WebApps { * * @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. @@ -40032,46 +42800,285 @@ export interface WebApps { /** - * @summary Recovers a web app to a previous snapshot. + * @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. * - * Recovers a web app to a previous snapshot. + * 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Deleted web app restore information. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @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} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -40084,49 +43091,50 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - beginRecoverWithHttpOperationResponse(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginRestoreSnapshotWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -40154,9 +43162,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginRecover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginRecover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, callback: ServiceCallback): void; - beginRecover(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** @@ -40258,6 +43266,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -40276,6 +43286,9 @@ export interface WebApps { * @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. @@ -40474,9 +43487,29 @@ export interface WebApps { * @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. @@ -40552,51 +43585,17 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests * * @param {object} [siteEnvelope.identity] * - * @param {object} [siteEnvelope.identity.type] Type of managed service - * 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. * @@ -40609,19 +43608,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -40631,7 +43617,7 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - beginCreateOrUpdateSlotWithHttpOperationResponse(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise>; + 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 @@ -40663,6 +43649,8 @@ export interface WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -40681,6 +43669,9 @@ export interface WebApps { * @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. @@ -40879,9 +43870,29 @@ export interface WebApps { * @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. @@ -40957,51 +43968,17 @@ export interface WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests * * @param {object} [siteEnvelope.identity] * - * @param {object} [siteEnvelope.identity.type] Type of managed service - * 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. * @@ -41014,19 +43991,6 @@ export interface WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -41052,9 +44016,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginCreateOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options?: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }): Promise; + 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: { skipDnsRegistration? : boolean, skipCustomDomainVerification? : boolean, forceDnsRegistration? : boolean, ttlInSeconds? : string, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + beginCreateOrUpdateSlot(resourceGroupName: string, name: string, siteEnvelope: models.Site, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -41100,7 +44064,7 @@ export interface WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -41121,11 +44085,11 @@ export interface WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @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>; + 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 @@ -41170,7 +44134,7 @@ export interface WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -41196,7 +44160,7 @@ export interface WebApps { * * {Promise} A promise is returned. * - * @resolve {RestoreResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error|ServiceError} - The error object. * @@ -41204,16 +44168,15 @@ export interface WebApps { * * {Error|ServiceError} err - The Error object if an error occurred, null otherwise. * - * {RestoreResponse} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} 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. */ - 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; + 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; /** @@ -41433,6 +44396,8 @@ export interface WebApps { * * @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. @@ -41482,6 +44447,8 @@ export interface WebApps { * * @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. @@ -41665,46 +44632,297 @@ export interface WebApps { /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores an app from a backup blob in Azure Storage. * - * Recovers a web app to a previous snapshot. + * 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will * default to production slot. @@ -41720,49 +44938,50 @@ export interface WebApps { * * @reject {Error|ServiceError} - The error object. */ - beginRecoverSlotWithHttpOperationResponse(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; + beginRestoreSnapshotSlotWithHttpOperationResponse(resourceGroupName: string, name: string, restoreRequest: models.SnapshotRestoreRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise>; /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will * default to production slot. @@ -41793,9 +45012,9 @@ export interface WebApps { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - beginRecoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options?: { customHeaders? : { [headerName: string]: string; } }): Promise; - beginRecoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, callback: ServiceCallback): void; - beginRecoverSlot(resourceGroupName: string, name: string, recoveryEntity: models.SnapshotRecoveryRequest, slot: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + 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; /** @@ -46019,6 +49238,15 @@ export interface AppServiceEnvironments { * @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. @@ -46122,6 +49350,15 @@ export interface AppServiceEnvironments { * @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. @@ -46317,6 +49554,15 @@ export interface AppServiceEnvironments { * @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. @@ -46416,6 +49662,15 @@ export interface AppServiceEnvironments { * @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. @@ -46586,6 +49841,83 @@ export interface AppServiceEnvironments { 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. * @@ -49302,6 +52634,15 @@ export interface AppServiceEnvironments { * @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. @@ -49405,6 +52746,15 @@ export interface AppServiceEnvironments { * @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. @@ -49516,6 +52866,83 @@ export interface AppServiceEnvironments { 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. * @@ -50178,6 +53605,67 @@ export interface AppServiceEnvironments { 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. * @@ -51435,6 +54923,67 @@ export interface AppServiceEnvironments { 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. * @@ -51771,9 +55320,6 @@ export interface AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -51797,9 +55343,15 @@ export interface AppServicePlans { * @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] 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. @@ -51869,9 +55421,6 @@ export interface AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -51895,9 +55444,15 @@ export interface AppServicePlans { * @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] 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. @@ -52050,9 +55605,6 @@ export interface AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanPatchResourceName Name for the - * App Service plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -52076,9 +55628,15 @@ export interface AppServicePlans { * @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] 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. @@ -52110,9 +55668,6 @@ export interface AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanPatchResourceName Name for the - * App Service plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -52136,9 +55691,15 @@ export interface AppServicePlans { * @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] 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. @@ -53580,9 +57141,6 @@ export interface AppServicePlans { * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @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. @@ -53630,9 +57188,6 @@ export interface AppServicePlans { * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @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. @@ -53771,9 +57326,6 @@ export interface AppServicePlans { * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @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. @@ -53821,9 +57373,6 @@ export interface AppServicePlans { * * @param {object} route Definition of the Virtual Network route. * - * @param {string} [route.vnetRouteName] The name of this route. This is only - * returned by the server and does not need to be set by the client. - * * @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. @@ -53956,9 +57505,6 @@ export interface AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -53982,9 +57528,15 @@ export interface AppServicePlans { * @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] 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. @@ -54054,9 +57606,6 @@ export interface AppServicePlans { * * @param {object} appServicePlan Details of the App Service plan. * - * @param {string} appServicePlan.appServicePlanName Name for the App Service - * plan. - * * @param {string} [appServicePlan.workerTierName] Target worker tier assigned * to the App Service plan. * @@ -54080,9 +57629,15 @@ export interface AppServicePlans { * @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] 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. diff --git a/lib/services/webSiteManagement2/lib/operations/provider.js b/lib/services/webSiteManagement2/lib/operations/provider.js index 4dbf3d5433..064fc16469 100644 --- a/lib/services/webSiteManagement2/lib/operations/provider.js +++ b/lib/services/webSiteManagement2/lib/operations/provider.js @@ -21,6 +21,9 @@ const WebResource = msRest.WebResource; * * @param {object} [options] Optional Parameters. * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -31,6 +34,8 @@ 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 ApplicationStackCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -46,9 +51,15 @@ function _getAvailableStacks(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; + 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.'); } @@ -60,7 +71,10 @@ function _getAvailableStacks(options, callback) { let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/availableStacks'; let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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('&'); } @@ -102,12 +116,13 @@ function _getAvailableStacks(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -127,13 +142,7 @@ function _getAvailableStacks(options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'Object' - } - }; + let resultMapper = new client.models['ApplicationStackCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -184,9 +193,11 @@ function _listOperations(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-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.'); } @@ -198,7 +209,7 @@ function _listOperations(options, callback) { let baseUrl = this.client.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/operations'; let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -240,12 +251,13 @@ function _listOperations(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -287,6 +299,9 @@ function _listOperations(options, callback) { * * @param {object} [options] Optional Parameters. * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -297,6 +312,8 @@ function _listOperations(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 ApplicationStackCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -312,12 +329,18 @@ function _getAvailableStacksOnPrem(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; + 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.'); } @@ -330,7 +353,10 @@ function _getAvailableStacksOnPrem(options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/availableStacks'; requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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('&'); } @@ -372,12 +398,13 @@ function _getAvailableStacksOnPrem(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -397,13 +424,138 @@ function _getAvailableStacksOnPrem(options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'Object' - } - }; + 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) { @@ -510,12 +662,13 @@ function _listOperationsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -550,6 +703,137 @@ function _listOperationsNext(nextPageLink, options, callback) { }); } +/** + * @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 { /** @@ -561,7 +845,9 @@ class Provider { this._getAvailableStacks = _getAvailableStacks; this._listOperations = _listOperations; this._getAvailableStacksOnPrem = _getAvailableStacksOnPrem; + this._getAvailableStacksNext = _getAvailableStacksNext; this._listOperationsNext = _listOperationsNext; + this._getAvailableStacksOnPremNext = _getAvailableStacksOnPremNext; } /** @@ -571,12 +857,15 @@ class Provider { * * @param {object} [options] Optional Parameters. * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -601,6 +890,9 @@ class Provider { * * @param {object} [options] Optional Parameters. * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -611,7 +903,7 @@ class Provider { * * {Promise} A promise is returned * - * @resolve {Object} - The deserialized result object. + * @resolve {ApplicationStackCollection} - The deserialized result object. * * @reject {Error} - The error object. * @@ -620,6 +912,8 @@ class Provider { * {Error} 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. * @@ -739,12 +1033,15 @@ class Provider { * * @param {object} [options] Optional Parameters. * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -769,6 +1066,9 @@ class Provider { * * @param {object} [options] Optional Parameters. * + * @param {string} [options.osTypeSelected] Possible values include: 'Windows', + * 'Linux' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -779,7 +1079,7 @@ class Provider { * * {Promise} A promise is returned * - * @resolve {Object} - The deserialized result object. + * @resolve {ApplicationStackCollection} - The deserialized result object. * * @reject {Error} - The error object. * @@ -788,6 +1088,8 @@ class Provider { * {Error} 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. * @@ -813,6 +1115,95 @@ class Provider { } } + /** + * @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 @@ -906,6 +1297,95 @@ class Provider { } } + /** + * @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 index 85bd91da8e..9a5449c349 100644 --- a/lib/services/webSiteManagement2/lib/operations/recommendations.js +++ b/lib/services/webSiteManagement2/lib/operations/recommendations.js @@ -39,7 +39,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 RecommendationCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -57,7 +59,6 @@ function _list(options, callback) { } let featured = (options && options.featured !== undefined) ? options.featured : undefined; let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-03-01'; // Validate try { if (featured !== null && featured !== undefined && typeof featured !== 'boolean') { @@ -69,6 +70,9 @@ function _list(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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -87,7 +91,7 @@ function _list(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('&'); } @@ -129,12 +133,13 @@ function _list(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -154,21 +159,7 @@ function _list(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: 'RecommendationElementType', - type: { - name: 'Composite', - className: 'Recommendation' - } - } - } - }; + let resultMapper = new client.models['RecommendationCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -215,12 +206,14 @@ function _resetAllFilters(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -233,7 +226,7 @@ function _resetAllFilters(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -298,6 +291,131 @@ function _resetAllFilters(options, callback) { }); } +/** + * @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. @@ -311,6 +429,10 @@ function _resetAllFilters(options, callback) { * * @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=channels eq 'Api' or channel eq 'Notification' and * startTime eq '2014-01-01T00:00:00Z' and endTime eq '2014-12-31T23:59:59Z' @@ -325,7 +447,9 @@ function _resetAllFilters(options, callback) { * * {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 RecommendationCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -341,8 +465,8 @@ function _listHistoryForWebApp(resourceGroupName, siteName, options, callback) { 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; - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -365,12 +489,18 @@ function _listHistoryForWebApp(resourceGroupName, siteName, options, callback) { 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.'); } @@ -385,10 +515,13 @@ function _listHistoryForWebApp(resourceGroupName, siteName, options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -430,12 +563,13 @@ function _listHistoryForWebApp(resourceGroupName, siteName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -455,21 +589,7 @@ function _listHistoryForWebApp(resourceGroupName, siteName, 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: 'RecommendationElementType', - type: { - name: 'Composite', - className: 'Recommendation' - } - } - } - }; + let resultMapper = new client.models['RecommendationCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -513,7 +633,9 @@ function _listHistoryForWebApp(resourceGroupName, siteName, options, callback) { * * {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 RecommendationCollection} for more + * information. * * {object} [request] - The HTTP Request object if an error did not occur. * @@ -531,7 +653,6 @@ function _listRecommendedRulesForWebApp(resourceGroupName, siteName, options, ca } let featured = (options && options.featured !== undefined) ? options.featured : undefined; let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -563,6 +684,9 @@ function _listRecommendedRulesForWebApp(resourceGroupName, siteName, options, ca if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -583,7 +707,7 @@ function _listRecommendedRulesForWebApp(resourceGroupName, siteName, options, ca 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('&'); } @@ -625,12 +749,13 @@ function _listRecommendedRulesForWebApp(resourceGroupName, siteName, options, ca try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -650,21 +775,7 @@ function _listRecommendedRulesForWebApp(resourceGroupName, siteName, options, ca 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: 'RecommendationElementType', - type: { - name: 'Composite', - className: 'Recommendation' - } - } - } - }; + let resultMapper = new client.models['RecommendationCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -716,7 +827,6 @@ function _disableAllForWebApp(resourceGroupName, siteName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -742,6 +852,9 @@ function _disableAllForWebApp(resourceGroupName, siteName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -756,7 +869,7 @@ function _disableAllForWebApp(resourceGroupName, siteName, options, callback) { requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); 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('&'); } @@ -858,7 +971,6 @@ function _resetAllFiltersForWebApp(resourceGroupName, siteName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -884,6 +996,9 @@ function _resetAllFiltersForWebApp(resourceGroupName, siteName, options, callbac if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -898,7 +1013,7 @@ function _resetAllFiltersForWebApp(resourceGroupName, siteName, options, callbac requestUrl = requestUrl.replace('{siteName}', encodeURIComponent(siteName)); 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('&'); } @@ -980,6 +1095,10 @@ function _resetAllFiltersForWebApp(resourceGroupName, siteName, options, callbac * @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 * @@ -1007,7 +1126,7 @@ function _getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, cal throw new Error('callback cannot be null.'); } let updateSeen = (options && options.updateSeen !== undefined) ? options.updateSeen : undefined; - let apiVersion = '2016-03-01'; + let recommendationId = (options && options.recommendationId !== undefined) ? options.recommendationId : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1036,9 +1155,15 @@ function _getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, cal 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.'); } @@ -1057,7 +1182,10 @@ function _getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, cal if (updateSeen !== null && updateSeen !== undefined) { queryParameters.push('updateSeen=' + encodeURIComponent(updateSeen.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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('&'); } @@ -1099,12 +1227,13 @@ function _getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, cal try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1139,89 +1268,1030 @@ function _getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, cal }); } -/** 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._listHistoryForWebApp = _listHistoryForWebApp; - this._listRecommendedRulesForWebApp = _listRecommendedRulesForWebApp; - this._disableAllForWebApp = _disableAllForWebApp; - this._resetAllFiltersForWebApp = _resetAllFiltersForWebApp; - this._getRuleDetailsByWebApp = _getRuleDetailsByWebApp; +/** + * @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; } - - /** - * @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=channels 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; - }); - }); + if (!callback) { + throw new Error('callback cannot be null.'); } - - /** - * @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=channels 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. - * + // Validate + try { + if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { + throw new Error('resourceGroupName cannot be null or undefined and it must be of type string.'); + } + if (resourceGroupName !== null && resourceGroupName !== undefined) { + if (resourceGroupName.length > 90) + { + throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); + } + if (resourceGroupName.length < 1) + { + throw new 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=channels 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=channels 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=channels 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=channels 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=channels + * 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=channels + * 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 {Array} - The deserialized result object. + * @resolve {RecommendationCollection} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1229,13 +2299,15 @@ class Recommendations { * * {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 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) { + listRecommendedRulesForWebApp(resourceGroupName, siteName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1244,21 +2316,26 @@ class Recommendations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { + self._listRecommendedRulesForWebApp(resourceGroupName, siteName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._list(options, optionalCallback); + return self._listRecommendedRulesForWebApp(resourceGroupName, siteName, options, optionalCallback); } } /** - * @summary Reset all recommendation opt-out settings for a subscription. + * @summary Disable all recommendations for an app. * - * Reset all recommendation opt-out settings for a subscription. + * 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. * @@ -1271,11 +2348,11 @@ class Recommendations { * * @reject {Error} - The error object. */ - resetAllFiltersWithHttpOperationResponse(options) { + disableAllForWebAppWithHttpOperationResponse(resourceGroupName, siteName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._resetAllFilters(options, (err, result, request, response) => { + self._disableAllForWebApp(resourceGroupName, siteName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1286,9 +2363,14 @@ class Recommendations { } /** - * @summary Reset all recommendation opt-out settings for a subscription. + * @summary Disable all recommendations for an app. * - * Reset all recommendation opt-out settings for a subscription. + * 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. * @@ -1316,7 +2398,7 @@ class Recommendations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - resetAllFilters(options, optionalCallback) { + disableAllForWebApp(resourceGroupName, siteName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1325,22 +2407,21 @@ class Recommendations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._resetAllFilters(options, (err, result, request, response) => { + self._disableAllForWebApp(resourceGroupName, siteName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._resetAllFilters(options, optionalCallback); + return self._disableAllForWebApp(resourceGroupName, siteName, options, optionalCallback); } } /** - * @summary Get past recommendations for an app, optionally specified by the - * time range. + * @summary Reset all recommendation opt-out settings for an app. * - * Get past recommendations for an app, optionally specified by the time range. + * Reset all recommendation opt-out settings for an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -1349,25 +2430,20 @@ class Recommendations { * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] Filter is specified by using OData syntax. - * Example: $filter=channels 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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listHistoryForWebAppWithHttpOperationResponse(resourceGroupName, siteName, options) { + resetAllFiltersForWebAppWithHttpOperationResponse(resourceGroupName, siteName, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listHistoryForWebApp(resourceGroupName, siteName, options, (err, result, request, response) => { + self._resetAllFiltersForWebApp(resourceGroupName, siteName, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1378,10 +2454,9 @@ class Recommendations { } /** - * @summary Get past recommendations for an app, optionally specified by the - * time range. + * @summary Reset all recommendation opt-out settings for an app. * - * Get past recommendations for an app, optionally specified by the time range. + * Reset all recommendation opt-out settings for an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -1390,11 +2465,6 @@ class Recommendations { * * @param {object} [options] Optional Parameters. * - * @param {string} [options.filter] Filter is specified by using OData syntax. - * Example: $filter=channels 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 * @@ -1405,7 +2475,7 @@ class Recommendations { * * {Promise} A promise is returned * - * @resolve {Array} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1413,13 +2483,13 @@ class Recommendations { * * {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. */ - listHistoryForWebApp(resourceGroupName, siteName, options, optionalCallback) { + resetAllFiltersForWebApp(resourceGroupName, siteName, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1428,51 +2498,52 @@ class Recommendations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listHistoryForWebApp(resourceGroupName, siteName, options, (err, result, request, response) => { + self._resetAllFiltersForWebApp(resourceGroupName, siteName, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listHistoryForWebApp(resourceGroupName, siteName, options, optionalCallback); + return self._resetAllFiltersForWebApp(resourceGroupName, siteName, options, optionalCallback); } } /** - * @summary Get all recommendations for an app. + * @summary Get a recommendation rule for an app. * - * Get all recommendations 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.featured] Specify true to return only - * the most critical recommendations. The default is false, which - * returns all recommendations. + * @param {boolean} [options.updateSeen] Specify true to update + * the last-seen timestamp of the recommendation object. * - * @param {string} [options.filter] Return only channels specified in the - * filter. Filter is specified by using OData syntax. Example: $filter=channels - * eq 'Api' or channel eq 'Notification' + * @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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listRecommendedRulesForWebAppWithHttpOperationResponse(resourceGroupName, siteName, options) { + getRuleDetailsByWebAppWithHttpOperationResponse(resourceGroupName, siteName, name, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._listRecommendedRulesForWebApp(resourceGroupName, siteName, options, (err, result, request, response) => { + self._getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1483,24 +2554,25 @@ class Recommendations { } /** - * @summary Get all recommendations for an app. + * @summary Get a recommendation rule for an app. * - * Get all recommendations 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.featured] Specify true to return only - * the most critical recommendations. The default is false, which - * returns all recommendations. + * @param {boolean} [options.updateSeen] Specify true to update + * the last-seen timestamp of the recommendation object. * - * @param {string} [options.filter] Return only channels specified in the - * filter. Filter is specified by using OData syntax. Example: $filter=channels - * eq 'Api' or channel eq 'Notification' + * @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 @@ -1512,7 +2584,7 @@ class Recommendations { * * {Promise} A promise is returned * - * @resolve {Array} - The deserialized result object. + * @resolve {RecommendationRule} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1520,13 +2592,14 @@ class Recommendations { * * {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 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. */ - listRecommendedRulesForWebApp(resourceGroupName, siteName, options, optionalCallback) { + getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1535,26 +2608,28 @@ class Recommendations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listRecommendedRulesForWebApp(resourceGroupName, siteName, options, (err, result, request, response) => { + self._getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listRecommendedRulesForWebApp(resourceGroupName, siteName, options, optionalCallback); + return self._getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, optionalCallback); } } /** - * @summary Disable all recommendations for an app. + * @summary Disables the specific rule for a web site permanently. * - * Disable all recommendations for an app. + * 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 Name of the app. + * @param {string} siteName Site name + * + * @param {string} name Rule name * * @param {object} [options] Optional Parameters. * @@ -1567,11 +2642,11 @@ class Recommendations { * * @reject {Error} - The error object. */ - disableAllForWebAppWithHttpOperationResponse(resourceGroupName, siteName, options) { + disableRecommendationForSiteWithHttpOperationResponse(resourceGroupName, siteName, name, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._disableAllForWebApp(resourceGroupName, siteName, options, (err, result, request, response) => { + self._disableRecommendationForSite(resourceGroupName, siteName, name, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1582,14 +2657,16 @@ class Recommendations { } /** - * @summary Disable all recommendations for an app. + * @summary Disables the specific rule for a web site permanently. * - * Disable all recommendations for an app. + * 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 Name of the app. + * @param {string} siteName Site name + * + * @param {string} name Rule name * * @param {object} [options] Optional Parameters. * @@ -1617,7 +2694,7 @@ class Recommendations { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - disableAllForWebApp(resourceGroupName, siteName, options, optionalCallback) { + disableRecommendationForSite(resourceGroupName, siteName, name, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1626,26 +2703,24 @@ class Recommendations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._disableAllForWebApp(resourceGroupName, siteName, options, (err, result, request, response) => { + self._disableRecommendationForSite(resourceGroupName, siteName, name, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._disableAllForWebApp(resourceGroupName, siteName, options, optionalCallback); + return self._disableRecommendationForSite(resourceGroupName, siteName, name, options, optionalCallback); } } /** - * @summary Reset all recommendation opt-out settings for an app. - * - * Reset all recommendation opt-out settings for an app. + * @summary List all recommendations for a subscription. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * List all recommendations for a subscription. * - * @param {string} siteName Name of the app. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -1654,15 +2729,15 @@ class Recommendations { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - resetAllFiltersForWebAppWithHttpOperationResponse(resourceGroupName, siteName, options) { + listNextWithHttpOperationResponse(nextPageLink, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._resetAllFiltersForWebApp(resourceGroupName, siteName, options, (err, result, request, response) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1673,14 +2748,12 @@ class Recommendations { } /** - * @summary Reset all recommendation opt-out settings for an app. - * - * Reset all recommendation opt-out settings for an app. + * @summary List all recommendations for a subscription. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * List all recommendations for a subscription. * - * @param {string} siteName Name of the app. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * @@ -1694,7 +2767,7 @@ class Recommendations { * * {Promise} A promise is returned * - * @resolve {null} - The deserialized result object. + * @resolve {RecommendationCollection} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1702,13 +2775,15 @@ class Recommendations { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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. */ - resetAllFiltersForWebApp(resourceGroupName, siteName, options, optionalCallback) { + listNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1717,48 +2792,42 @@ class Recommendations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._resetAllFiltersForWebApp(resourceGroupName, siteName, options, (err, result, request, response) => { + self._listNext(nextPageLink, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._resetAllFiltersForWebApp(resourceGroupName, siteName, options, optionalCallback); + return self._listNext(nextPageLink, 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. + * @summary Get past recommendations for an app, optionally specified by the + * time range. * - * @param {string} siteName Name of the app. + * Get past recommendations for an app, optionally specified by the time range. * - * @param {string} name Name of the recommendation. + * @param {string} nextPageLink The NextLink from the previous successful call + * to List operation. * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.updateSeen] Specify true to update - * the last-seen timestamp of the recommendation 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. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - getRuleDetailsByWebAppWithHttpOperationResponse(resourceGroupName, siteName, name, options) { + listHistoryForWebAppNextWithHttpOperationResponse(nextPageLink, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, (err, result, request, response) => { + self._listHistoryForWebAppNext(nextPageLink, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -1769,21 +2838,104 @@ class Recommendations { } /** - * @summary Get a recommendation rule for an app. + * @summary Get past recommendations for an app, optionally specified by the + * time range. * - * Get a recommendation rule for an app. + * 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} nextPageLink The NextLink from the previous successful call + * to List operation. * - * @param {string} siteName Name of the app. + * @param {object} [options] Optional Parameters. * - * @param {string} name Name of the recommendation. + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} 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 {boolean} [options.updateSeen] Specify true to update - * the last-seen timestamp of the recommendation 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. + */ + 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 @@ -1795,7 +2947,7 @@ class Recommendations { * * {Promise} A promise is returned * - * @resolve {RecommendationRule} - The deserialized result object. + * @resolve {RecommendationCollection} - The deserialized result object. * * @reject {Error} - The error object. * @@ -1804,13 +2956,14 @@ class Recommendations { * {Error} 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. + * 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. */ - getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, optionalCallback) { + listRecommendedRulesForWebAppNext(nextPageLink, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -1819,14 +2972,14 @@ class Recommendations { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, (err, result, request, response) => { + self._listRecommendedRulesForWebAppNext(nextPageLink, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getRuleDetailsByWebApp(resourceGroupName, siteName, name, options, optionalCallback); + return self._listRecommendedRulesForWebAppNext(nextPageLink, options, optionalCallback); } } diff --git a/lib/services/webSiteManagement2/lib/operations/topLevelDomains.js b/lib/services/webSiteManagement2/lib/operations/topLevelDomains.js index ed6c81ea55..20fa9e42ae 100644 --- a/lib/services/webSiteManagement2/lib/operations/topLevelDomains.js +++ b/lib/services/webSiteManagement2/lib/operations/topLevelDomains.js @@ -48,12 +48,14 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -66,7 +68,7 @@ function _list(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -108,12 +110,13 @@ function _list(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -183,7 +186,6 @@ function _get(name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { @@ -192,6 +194,9 @@ function _get(name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -205,7 +210,7 @@ function _get(name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -247,12 +252,13 @@ function _get(name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -335,7 +341,6 @@ function _listAgreements(name, agreementOption, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2015-04-01'; // Validate try { if (name === null || name === undefined || typeof name.valueOf() !== 'string') { @@ -347,6 +352,9 @@ function _listAgreements(name, agreementOption, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -360,7 +368,7 @@ function _listAgreements(name, agreementOption, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -416,12 +424,13 @@ function _listAgreements(name, agreementOption, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -546,12 +555,13 @@ function _listNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -678,12 +688,13 @@ function _listAgreementsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { diff --git a/lib/services/webSiteManagement2/lib/operations/webApps.js b/lib/services/webSiteManagement2/lib/operations/webApps.js index 9b397075b2..1ddf143e63 100644 --- a/lib/services/webSiteManagement2/lib/operations/webApps.js +++ b/lib/services/webSiteManagement2/lib/operations/webApps.js @@ -47,12 +47,14 @@ function _list(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-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.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -65,7 +67,7 @@ function _list(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -107,12 +109,13 @@ function _list(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -188,7 +191,6 @@ function _listByResourceGroup(resourceGroupName, options, callback) { throw new Error('callback cannot be null.'); } let includeSlots = (options && options.includeSlots !== undefined) ? options.includeSlots : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -214,6 +216,9 @@ function _listByResourceGroup(resourceGroupName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -230,7 +235,7 @@ function _listByResourceGroup(resourceGroupName, options, callback) { if (includeSlots !== null && includeSlots !== undefined) { queryParameters.push('includeSlots=' + encodeURIComponent(includeSlots.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -272,12 +277,13 @@ function _listByResourceGroup(resourceGroupName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -350,7 +356,6 @@ function _get(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -376,6 +381,9 @@ function _get(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -390,7 +398,7 @@ function _get(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -503,6 +511,8 @@ function _get(resourceGroupName, name, options, callback) { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -521,6 +531,9 @@ function _get(resourceGroupName, name, options, callback) { * @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. @@ -719,9 +732,29 @@ function _get(resourceGroupName, name, options, callback) { * @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. @@ -797,51 +830,17 @@ function _get(resourceGroupName, name, options, callback) { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests * * @param {object} [siteEnvelope.identity] * - * @param {object} [siteEnvelope.identity.type] Type of managed service - * 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. * @@ -851,19 +850,6 @@ function _get(resourceGroupName, name, options, callback) { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -952,9 +938,6 @@ function _createOrUpdate(resourceGroupName, name, siteEnvelope, options, callbac * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -982,8 +965,6 @@ function _deleteMethod(resourceGroupName, name, options, callback) { } let deleteMetrics = (options && options.deleteMetrics !== undefined) ? options.deleteMetrics : undefined; let deleteEmptyServerFarm = (options && options.deleteEmptyServerFarm !== undefined) ? options.deleteEmptyServerFarm : undefined; - let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1012,12 +993,12 @@ function _deleteMethod(resourceGroupName, name, options, callback) { if (deleteEmptyServerFarm !== null && deleteEmptyServerFarm !== undefined && typeof deleteEmptyServerFarm !== 'boolean') { throw new Error('deleteEmptyServerFarm must be of type boolean.'); } - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { - throw new Error('skipDnsRegistration must be of type boolean.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -1038,10 +1019,7 @@ function _deleteMethod(resourceGroupName, name, options, callback) { if (deleteEmptyServerFarm !== null && deleteEmptyServerFarm !== undefined) { queryParameters.push('deleteEmptyServerFarm=' + encodeURIComponent(deleteEmptyServerFarm.toString())); } - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { - queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1136,6 +1114,8 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -1154,6 +1134,9 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * @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. @@ -1352,9 +1335,29 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * @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. @@ -1430,63 +1433,212 @@ function _deleteMethod(resourceGroupName, name, options, callback) { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. + * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site + * to accept only https requests. Issues redirect for + * http requests * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. + * @param {string} [siteEnvelope.kind] Kind of resource. * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS + * @param {object} [options] Optional Parameters. * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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 {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. + * @param {function} callback - The callback. * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. + * @returns {function} callback(err, result, request, response) * - * @param {boolean} [siteEnvelope.snapshotInfo.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. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {string} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Site} for more information. * - * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site - * to accept only https requests. Issues redirect for - * http requests + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {string} [siteEnvelope.kind] Kind of resource. + * {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. * - * @param {object} [options] Optional Parameters. + * Analyze a custom hostname. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. + * @param {string} name Name of web app. * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. + * @param {object} [options] Optional Parameters. * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. + * @param {string} [options.hostName] Custom hostname. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -1498,13 +1650,14 @@ function _deleteMethod(resourceGroupName, name, 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 Site} for more information. + * 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 _update(resourceGroupName, name, siteEnvelope, options, callback) { +function _analyzeCustomHostname(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1514,11 +1667,7 @@ function _update(resourceGroupName, name, siteEnvelope, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; - let skipCustomDomainVerification = (options && options.skipCustomDomainVerification !== undefined) ? options.skipCustomDomainVerification : undefined; - let forceDnsRegistration = (options && options.forceDnsRegistration !== undefined) ? options.forceDnsRegistration : undefined; - let ttlInSeconds = (options && options.ttlInSeconds !== undefined) ? options.ttlInSeconds : undefined; - let apiVersion = '2016-08-01'; + let hostName = (options && options.hostName !== undefined) ? options.hostName : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1541,24 +1690,15 @@ function _update(resourceGroupName, name, siteEnvelope, options, callback) { if (name === 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { - throw new Error('skipDnsRegistration must be of type boolean.'); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined && typeof skipCustomDomainVerification !== 'boolean') { - throw new Error('skipCustomDomainVerification must be of type boolean.'); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined && typeof forceDnsRegistration !== 'boolean') { - throw new Error('forceDnsRegistration must be of type boolean.'); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined && typeof ttlInSeconds.valueOf() !== 'string') { - throw new Error('ttlInSeconds must be of type string.'); + if (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.'); } @@ -1568,31 +1708,22 @@ function _update(resourceGroupName, name, siteEnvelope, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}'; + 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { - queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined) { - queryParameters.push('skipCustomDomainVerification=' + encodeURIComponent(skipCustomDomainVerification.toString())); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined) { - queryParameters.push('forceDnsRegistration=' + encodeURIComponent(forceDnsRegistration.toString())); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined) { - queryParameters.push('ttlInSeconds=' + encodeURIComponent(ttlInSeconds)); + if (hostName !== null && hostName !== undefined) { + queryParameters.push('hostName=' + encodeURIComponent(hostName)); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -1610,28 +1741,14 @@ function _update(resourceGroupName, name, siteEnvelope, options, callback) { } } } - // 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; + httpRequest.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); @@ -1641,12 +1758,13 @@ function _update(resourceGroupName, name, siteEnvelope, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1666,7 +1784,7 @@ function _update(resourceGroupName, name, siteEnvelope, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Site']().mapper(); + let resultMapper = new client.models['CustomHostnameAnalysisResult']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -1676,41 +1794,33 @@ function _update(resourceGroupName, name, siteEnvelope, options, callback) { 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. + * @summary Applies the configuration settings from the target slot onto the + * current slot. * - * Analyze a custom hostname. + * 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 web app. + * @param {string} name Name of the app. * - * @param {object} [options] Optional Parameters. + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. * - * @param {string} [options.hostName] Custom hostname. + * @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 @@ -1721,15 +1831,13 @@ function _update(resourceGroupName, name, siteEnvelope, 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 CustomHostnameAnalysisResult} 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 _analyzeCustomHostname(resourceGroupName, name, options, callback) { +function _applySlotConfigToProduction(resourceGroupName, name, slotSwapEntity, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1739,8 +1847,6 @@ function _analyzeCustomHostname(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let hostName = (options && options.hostName !== undefined) ? options.hostName : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1763,12 +1869,15 @@ function _analyzeCustomHostname(resourceGroupName, name, options, callback) { if (name === 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 (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.'); } @@ -1778,22 +1887,19 @@ function _analyzeCustomHostname(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/analyzeCustomHostname'; + 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 = []; - if (hostName !== null && hostName !== undefined) { - queryParameters.push('hostName=' + encodeURIComponent(hostName)); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-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 @@ -1811,7 +1917,21 @@ function _analyzeCustomHostname(resourceGroupName, name, options, callback) { } } } - httpRequest.body = null; + // 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) { @@ -1846,48 +1966,55 @@ function _analyzeCustomHostname(resourceGroupName, name, 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['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. + * @summary Creates a backup of an app. * - * Applies the configuration settings from the target slot onto the current - * slot. + * 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} slotSwapEntity JSON object that contains the target slot - * name. See example. + * @param {object} request Backup configuration. You can use the JSON response + * from the POST action as input here. * - * @param {string} slotSwapEntity.targetSlot Destination deployment slot during - * swap operation. + * @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 {boolean} slotSwapEntity.preserveVnet true to preserve - * Virtual Network to the slot during swap; otherwise, false. + * @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. * @@ -1900,13 +2027,14 @@ function _analyzeCustomHostname(resourceGroupName, name, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _applySlotConfigToProduction(resourceGroupName, name, slotSwapEntity, options, callback) { +function _backup(resourceGroupName, name, request, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -1916,7 +2044,6 @@ function _applySlotConfigToProduction(resourceGroupName, name, slotSwapEntity, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1939,12 +2066,15 @@ function _applySlotConfigToProduction(resourceGroupName, name, slotSwapEntity, o if (name === 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 (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.'); } @@ -1954,12 +2084,12 @@ function _applySlotConfigToProduction(resourceGroupName, name, slotSwapEntity, o // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/applySlotConfig'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1988,14 +2118,14 @@ function _applySlotConfigToProduction(resourceGroupName, name, slotSwapEntity, o 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'); + 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(slotSwapEntity, null, 2)}.`); + `payload - ${JSON.stringify(request, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -2015,12 +2145,13 @@ function _applySlotConfigToProduction(resourceGroupName, name, slotSwapEntity, o try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2033,61 +2164,38 @@ function _applySlotConfigToProduction(resourceGroupName, name, slotSwapEntity, 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['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 Creates a backup of an app. + * @summary Gets existing backups of an app. * - * Creates a backup 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} request Backup configuration. You can use the JSON response - * from the POST action as input here. - * - * @param {string} request.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @param {string} [request.kind] Kind of resource. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -2100,13 +2208,13 @@ function _applySlotConfigToProduction(resourceGroupName, name, slotSwapEntity, 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 BackupItem} for more information. + * 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 _backup(resourceGroupName, name, request, options, callback) { +function _listBackups(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2116,7 +2224,6 @@ function _backup(resourceGroupName, name, request, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2139,12 +2246,12 @@ function _backup(resourceGroupName, name, request, options, callback) { if (name === 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.'); } @@ -2154,19 +2261,19 @@ function _backup(resourceGroupName, name, request, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backup'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -2184,21 +2291,7 @@ function _backup(resourceGroupName, name, request, options, callback) { } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -2215,12 +2308,13 @@ function _backup(resourceGroupName, name, request, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2240,7 +2334,7 @@ function _backup(resourceGroupName, name, request, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupItem']().mapper(); + let resultMapper = new client.models['BackupItemCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2256,15 +2350,17 @@ function _backup(resourceGroupName, name, request, options, callback) { } /** - * @summary Gets existing backups of an app. + * @summary Gets a backup of an app by its ID. * - * Gets existing backups of an app. + * 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 @@ -2277,13 +2373,13 @@ function _backup(resourceGroupName, name, request, 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 BackupItemCollection} for more information. + * 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 _listBackups(resourceGroupName, name, options, callback) { +function _getBackupStatus(resourceGroupName, name, backupId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2293,7 +2389,6 @@ function _listBackups(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2316,9 +2411,15 @@ function _listBackups(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -2328,12 +2429,13 @@ function _listBackups(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2375,12 +2477,13 @@ function _listBackups(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2400,7 +2503,7 @@ function _listBackups(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupItemCollection']().mapper(); + let resultMapper = new client.models['BackupItem']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -2416,57 +2519,16 @@ function _listBackups(resourceGroupName, name, options, callback) { } /** - * @summary Discovers an existing app backup that can be restored from a blob - * in Azure storage. + * @summary Deletes a backup of an app by its ID. * - * Discovers an existing app backup that can be restored from a blob in Azure - * storage. + * 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 {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' - * - * @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} backupId ID of the backup. * * @param {object} [options] Optional Parameters. * @@ -2479,14 +2541,13 @@ function _listBackups(resourceGroupName, name, 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 RestoreRequest} 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 _discoverRestore(resourceGroupName, name, request, options, callback) { +function _deleteBackup(resourceGroupName, name, backupId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2496,7 +2557,6 @@ function _discoverRestore(resourceGroupName, name, request, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2519,12 +2579,15 @@ function _discoverRestore(resourceGroupName, name, request, options, callback) { if (name === 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 (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.'); } @@ -2534,19 +2597,20 @@ function _discoverRestore(resourceGroupName, name, request, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/discover'; + 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(apiVersion)); + queryParameters.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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -2564,28 +2628,14 @@ function _discoverRestore(resourceGroupName, name, request, options, callback) { } } } - // 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; + httpRequest.body = null; // 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 !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -2613,39 +2663,62 @@ function _discoverRestore(resourceGroupName, name, request, 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['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 Gets a backup of an app by its ID. + * @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 a backup of an app by its ID. + * 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 the app. + * @param {string} name Name of web app. * - * @param {string} backupId ID of the backup. + * @param {string} backupId ID of backup. + * + * @param {object} request Information on backup request. + * + * @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. * @@ -2665,7 +2738,7 @@ function _discoverRestore(resourceGroupName, name, request, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getBackupStatus(resourceGroupName, name, backupId, options, callback) { +function _listBackupStatusSecrets(resourceGroupName, name, backupId, request, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -2675,7 +2748,6 @@ function _getBackupStatus(resourceGroupName, name, backupId, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2701,9 +2773,15 @@ function _getBackupStatus(resourceGroupName, name, backupId, options, callback) 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.'); } @@ -2713,20 +2791,20 @@ function _getBackupStatus(resourceGroupName, name, backupId, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}'; + 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(apiVersion)); + queryParameters.push('api-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 @@ -2744,7 +2822,21 @@ function _getBackupStatus(resourceGroupName, name, backupId, options, callback) } } } - httpRequest.body = null; + // 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) { @@ -2761,12 +2853,13 @@ function _getBackupStatus(resourceGroupName, name, backupId, options, callback) try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2801,10 +2894,13 @@ function _getBackupStatus(resourceGroupName, name, backupId, options, callback) }); } + /** - * @summary Deletes a backup of an app by its ID. + * @summary Restores a specific backup to another app (or deployment slot, if + * specified). * - * Deletes a backup of an app by its ID. + * 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. @@ -2813,6 +2909,46 @@ function _getBackupStatus(resourceGroupName, name, backupId, options, callback) * * @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 @@ -2830,7 +2966,74 @@ function _getBackupStatus(resourceGroupName, name, backupId, options, callback) * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteBackup(resourceGroupName, name, backupId, options, callback) { +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') { @@ -2840,7 +3043,6 @@ function _deleteBackup(resourceGroupName, name, backupId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2863,509 +3065,11 @@ function _deleteBackup(resourceGroupName, name, backupId, options, callback) { if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(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.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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' - * - * @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 RestoreResponse} for more information. - * - * {object} [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 - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RestoreResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in 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} resourceGroupName Name of the resource group to which the - * resource belongs. - * - * @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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.'); @@ -3381,7 +3085,7 @@ function _listConfigurations(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -3423,12 +3127,13 @@ function _listConfigurations(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3507,7 +3212,6 @@ function _updateApplicationSettings(resourceGroupName, name, appSettings, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3536,6 +3240,9 @@ function _updateApplicationSettings(resourceGroupName, name, appSettings, option if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3550,7 +3257,7 @@ function _updateApplicationSettings(resourceGroupName, name, appSettings, option requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -3606,12 +3313,13 @@ function _updateApplicationSettings(resourceGroupName, name, appSettings, option try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3684,7 +3392,6 @@ function _listApplicationSettings(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -3710,6 +3417,9 @@ function _listApplicationSettings(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -3724,7 +3434,7 @@ function _listApplicationSettings(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -3766,12 +3476,13 @@ function _listApplicationSettings(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -3881,6 +3592,9 @@ function _listApplicationSettings(resourceGroupName, name, options, callback) { * 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 @@ -3987,7 +3701,6 @@ function _updateAuthSettings(resourceGroupName, name, siteAuthSettings, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4016,6 +3729,9 @@ function _updateAuthSettings(resourceGroupName, name, siteAuthSettings, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4030,7 +3746,7 @@ function _updateAuthSettings(resourceGroupName, name, siteAuthSettings, options, requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -4086,12 +3802,13 @@ function _updateAuthSettings(resourceGroupName, name, siteAuthSettings, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4164,7 +3881,6 @@ function _getAuthSettings(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4190,6 +3906,9 @@ function _getAuthSettings(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4204,7 +3923,7 @@ function _getAuthSettings(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -4246,12 +3965,13 @@ function _getAuthSettings(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4298,8 +4018,6 @@ function _getAuthSettings(resourceGroupName, name, options, callback) { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName 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. @@ -4330,9 +4048,6 @@ function _getAuthSettings(resourceGroupName, name, options, callback) { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -4363,7 +4078,6 @@ function _updateBackupConfiguration(resourceGroupName, name, request, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4392,6 +4106,9 @@ function _updateBackupConfiguration(resourceGroupName, name, request, options, c if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4406,7 +4123,7 @@ function _updateBackupConfiguration(resourceGroupName, name, request, options, c requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -4462,12 +4179,13 @@ function _updateBackupConfiguration(resourceGroupName, name, request, options, c try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4539,7 +4257,6 @@ function _deleteBackupConfiguration(resourceGroupName, name, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4565,6 +4282,9 @@ function _deleteBackupConfiguration(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4579,7 +4299,7 @@ function _deleteBackupConfiguration(resourceGroupName, name, options, callback) requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -4682,7 +4402,6 @@ function _getBackupConfiguration(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4708,6 +4427,9 @@ function _getBackupConfiguration(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4722,7 +4444,7 @@ function _getBackupConfiguration(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -4764,12 +4486,13 @@ function _getBackupConfiguration(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -4850,7 +4573,6 @@ function _updateConnectionStrings(resourceGroupName, name, connectionStrings, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -4879,6 +4601,9 @@ function _updateConnectionStrings(resourceGroupName, name, connectionStrings, op if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -4893,7 +4618,7 @@ function _updateConnectionStrings(resourceGroupName, name, connectionStrings, op requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -4949,12 +4674,13 @@ function _updateConnectionStrings(resourceGroupName, name, connectionStrings, op try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5028,7 +4754,6 @@ function _listConnectionStrings(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5054,6 +4779,9 @@ function _listConnectionStrings(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -5068,7 +4796,7 @@ function _listConnectionStrings(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -5110,12 +4838,13 @@ function _listConnectionStrings(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5188,7 +4917,6 @@ function _getDiagnosticLogsConfiguration(resourceGroupName, name, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5214,6 +4942,9 @@ function _getDiagnosticLogsConfiguration(resourceGroupName, name, options, callb if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -5228,7 +4959,7 @@ function _getDiagnosticLogsConfiguration(resourceGroupName, name, options, callb requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -5270,12 +5001,13 @@ function _getDiagnosticLogsConfiguration(resourceGroupName, name, options, callb try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5432,7 +5164,6 @@ function _updateDiagnosticLogsConfig(resourceGroupName, name, siteLogsConfig, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5461,6 +5192,9 @@ function _updateDiagnosticLogsConfig(resourceGroupName, name, siteLogsConfig, op if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -5475,7 +5209,7 @@ function _updateDiagnosticLogsConfig(resourceGroupName, name, siteLogsConfig, op requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -5531,12 +5265,13 @@ function _updateDiagnosticLogsConfig(resourceGroupName, name, siteLogsConfig, op try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5616,7 +5351,6 @@ function _updateMetadata(resourceGroupName, name, metadata, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5645,6 +5379,9 @@ function _updateMetadata(resourceGroupName, name, metadata, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -5659,7 +5396,7 @@ function _updateMetadata(resourceGroupName, name, metadata, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -5715,12 +5452,13 @@ function _updateMetadata(resourceGroupName, name, metadata, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -5793,7 +5531,6 @@ function _listMetadata(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -5819,6 +5556,9 @@ function _listMetadata(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -5833,7 +5573,7 @@ function _listMetadata(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -5875,12 +5615,13 @@ function _listMetadata(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6056,7 +5797,6 @@ function _updateSitePushSettings(resourceGroupName, name, pushSettings, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6085,6 +5825,9 @@ function _updateSitePushSettings(resourceGroupName, name, pushSettings, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -6099,7 +5842,7 @@ function _updateSitePushSettings(resourceGroupName, name, pushSettings, options, requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -6155,12 +5898,13 @@ function _updateSitePushSettings(resourceGroupName, name, pushSettings, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6233,7 +5977,6 @@ function _listSitePushSettings(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6259,6 +6002,9 @@ function _listSitePushSettings(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -6273,7 +6019,7 @@ function _listSitePushSettings(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -6315,12 +6061,13 @@ function _listSitePushSettings(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6396,7 +6143,6 @@ function _listSlotConfigurationNames(resourceGroupName, name, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6422,6 +6168,9 @@ function _listSlotConfigurationNames(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -6436,7 +6185,7 @@ function _listSlotConfigurationNames(resourceGroupName, name, options, callback) requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -6478,12 +6227,13 @@ function _listSlotConfigurationNames(resourceGroupName, name, options, callback) try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6570,7 +6320,6 @@ function _updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6599,6 +6348,9 @@ function _updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -6613,7 +6365,7 @@ function _updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -6669,12 +6421,13 @@ function _updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6710,11 +6463,9 @@ function _updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, } /** - * @summary Gets the configuration of an app, such as platform version and - * bitness, default documents, virtual applications, Always On, etc. + * @summary Gets a Swift Virtual Network connection. * - * Gets the configuration of an app, such as platform version and bitness, - * default documents, virtual applications, Always On, etc. + * Gets a Swift Virtual Network connection. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -6733,13 +6484,13 @@ function _updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, * {Error} 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. + * 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 _getConfiguration(resourceGroupName, name, options, callback) { +function _getSwiftVirtualNetworkConnection(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -6749,7 +6500,6 @@ function _getConfiguration(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -6775,6 +6525,9 @@ function _getConfiguration(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -6784,12 +6537,12 @@ function _getConfiguration(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -6831,12 +6584,13 @@ function _getConfiguration(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -6856,7 +6610,7 @@ function _getConfiguration(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigResource']().mapper(); + let resultMapper = new client.models['SwiftVirtualNetwork']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -6872,212 +6626,32 @@ function _getConfiguration(resourceGroupName, name, options, callback) { } /** - * @summary Updates the configuration of an app. + * @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. * - * Updates the configuration of an app. + * 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} 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 {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 {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 {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. * - * @param {boolean} [siteConfig.localMySqlEnabled] true to enable - * local MySQL; otherwise, false. + * @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 {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. * - * @param {string} [siteConfig.kind] Kind of resource. + * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -7091,13 +6665,13 @@ function _getConfiguration(resourceGroupName, name, 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 SiteConfigResource} for more information. + * 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 _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, options, callback) { +function _createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -7107,7 +6681,6 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7130,12 +6703,15 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, optio if (name === 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 (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.'); } @@ -7145,12 +6721,12 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, optio // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -7179,14 +6755,14 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, optio 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'); + 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(siteConfig, null, 2)}.`); + `payload - ${JSON.stringify(connectionEnvelope, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -7206,12 +6782,13 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, optio try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -7231,7 +6808,7 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, optio parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigResource']().mapper(); + let resultMapper = new client.models['SwiftVirtualNetwork']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -7247,213 +6824,16 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, optio } /** - * @summary Updates the configuration of an app. + * @summary Deletes a Swift Virtual Network connection from an app (or + * deployment slot). * - * Updates the configuration of an app. + * 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} 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 {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 {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 {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. - * - * @param {string} [siteConfig.kind] Kind of resource. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7465,14 +6845,13 @@ function _createOrUpdateConfiguration(resourceGroupName, name, siteConfig, 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 SiteConfigResource} 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 _updateConfiguration(resourceGroupName, name, siteConfig, options, callback) { +function _deleteSwiftVirtualNetwork(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -7482,7 +6861,6 @@ function _updateConfiguration(resourceGroupName, name, siteConfig, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7505,12 +6883,12 @@ function _updateConfiguration(resourceGroupName, name, siteConfig, options, call if (name === 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.'); } @@ -7520,19 +6898,19 @@ function _updateConfiguration(resourceGroupName, name, siteConfig, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web'; + 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(apiVersion)); + queryParameters.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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -7550,28 +6928,14 @@ function _updateConfiguration(resourceGroupName, name, siteConfig, options, call } } } - // 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; + httpRequest.body = null; // 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 !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -7599,40 +6963,39 @@ function _updateConfiguration(resourceGroupName, name, siteConfig, options, call // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @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. * - * Gets a list of web app configuration snapshots identifiers. Each element of - * the list contains a timestamp and the ID of the snapshot. + * 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 @@ -7645,14 +7008,13 @@ function _updateConfiguration(resourceGroupName, name, siteConfig, options, call * {Error} 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. + * 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 _listConfigurationSnapshotInfo(resourceGroupName, name, options, callback) { +function _updateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -7662,7 +7024,6 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7685,9 +7046,15 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callba if (name === 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.'); } @@ -7697,19 +7064,19 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callba // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots'; + 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(apiVersion)); + queryParameters.push('api-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 = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -7727,7 +7094,21 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callba } } } - httpRequest.body = null; + // 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) { @@ -7744,12 +7125,13 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callba try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -7769,7 +7151,7 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callba parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigurationSnapshotInfoCollection']().mapper(); + let resultMapper = new client.models['SwiftVirtualNetwork']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -7785,18 +7167,17 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callba } /** - * @summary Gets a snapshot of the configuration of an app at a previous point - * in time. + * @summary Gets the configuration of an app, such as platform version and + * bitness, default documents, virtual applications, Always On, etc. * - * Gets a snapshot of the configuration of an app at a previous point in time. + * 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} snapshotId The ID of the snapshot to read. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -7815,7 +7196,7 @@ function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callba * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, callback) { +function _getConfiguration(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -7825,7 +7206,6 @@ function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -7848,12 +7228,12 @@ function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, if (name === 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.'); } @@ -7863,13 +7243,12 @@ function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, // 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}'; + 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('{snapshotId}', encodeURIComponent(snapshotId)); 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('&'); } @@ -7911,12 +7290,13 @@ function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -7952,192 +7332,265 @@ function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, } /** - * @summary Reverts the configuration of an app to a previous snapshot. + * @summary Updates the configuration of an app. * - * Reverts the configuration of an app to a previous snapshot. + * 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 {string} snapshotId The ID of the snapshot to read. + * @param {object} siteConfig JSON representation of a SiteConfig object. See + * example. * - * @param {object} [options] Optional Parameters. + * @param {number} [siteConfig.numberOfWorkers] Number of workers. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [siteConfig.defaultDocuments] Default documents. * - * @param {function} callback - The callback. + * @param {string} [siteConfig.netFrameworkVersion] .NET Framework version. * - * @returns {function} callback(err, result, request, response) + * @param {string} [siteConfig.phpVersion] Version of PHP. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {string} [siteConfig.pythonVersion] Version of Python. * - * {null} [result] - The deserialized result object if an error did not occur. + * @param {string} [siteConfig.nodeVersion] Version of Node.js. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {string} [siteConfig.linuxFxVersion] Linux App Framework and version * - * {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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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 + * @param {string} [siteConfig.windowsFxVersion] Xenon App Framework and + * version * - * Gets the last lines of docker logs for the given site + * @param {boolean} [siteConfig.requestTracingEnabled] true if + * request tracing is enabled; otherwise, false. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {date} [siteConfig.requestTracingExpirationTime] Request tracing + * expiration time. * - * @param {string} name Name of web app. + * @param {boolean} [siteConfig.remoteDebuggingEnabled] true if + * remote debugging is enabled; otherwise, false. * - * @param {object} [options] Optional Parameters. + * @param {string} [siteConfig.remoteDebuggingVersion] Remote debugging + * version. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {boolean} [siteConfig.httpLoggingEnabled] true if HTTP + * logging is enabled; otherwise, false. * - * @param {function} callback - The callback. + * @param {number} [siteConfig.logsDirectorySizeLimit] HTTP logs directory size + * limit. * - * @returns {function} callback(err, result, request, response) + * @param {boolean} [siteConfig.detailedErrorLoggingEnabled] true + * if detailed error logging is enabled; otherwise, false. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {string} [siteConfig.publishingUsername] Publishing user name. * - * {object} [result] - The deserialized result object if an error did not occur. + * @param {array} [siteConfig.appSettings] Application settings. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {array} [siteConfig.connectionStrings] Connection strings. * - * {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.'); - } - let apiVersion = '2016-08-01'; - // Validate + * @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.'); @@ -8159,9 +7612,15 @@ function _getWebSiteContainerLogs(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -8171,19 +7630,19 @@ function _getWebSiteContainerLogs(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs'; + 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(apiVersion)); + queryParameters.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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -8201,31 +7660,44 @@ function _getWebSiteContainerLogs(resourceGroupName, name, options, callback) { } } } - httpRequest.body = null; + // 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 - 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}`); + if (statusCode !== 200) { + let error = new Error(responseBody); 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); + parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -8235,22 +7707,261 @@ function _getWebSiteContainerLogs(resourceGroupName, name, options, callback) { } return callback(error); } - // Create Result - let result = response; + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 the ZIP archived docker log files for the given site + * @summary Updates the configuration of an app. * - * Gets the ZIP archived docker log files for the given site + * Updates the configuration of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. + * @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 {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. * @@ -8264,12 +7975,13 @@ function _getWebSiteContainerLogs(resourceGroupName, name, 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 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 _getWebSiteContainerLogsZip(resourceGroupName, name, options, callback) { +function _updateConfiguration(resourceGroupName, name, siteConfig, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -8279,7 +7991,6 @@ function _getWebSiteContainerLogsZip(resourceGroupName, name, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -8302,9 +8013,15 @@ function _getWebSiteContainerLogsZip(resourceGroupName, name, options, callback) if (name === 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.'); } @@ -8314,19 +8031,19 @@ function _getWebSiteContainerLogsZip(resourceGroupName, name, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs/zip/download'; + 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(apiVersion)); + queryParameters.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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -8344,31 +8061,44 @@ function _getWebSiteContainerLogsZip(resourceGroupName, name, options, callback) } } } - httpRequest.body = null; + // 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 - 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}`); + if (statusCode !== 200) { + let error = new Error(responseBody); 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); + parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -8378,23 +8108,43 @@ function _getWebSiteContainerLogsZip(resourceGroupName, name, options, callback) } 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. - * + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 @@ -8407,14 +8157,14 @@ function _getWebSiteContainerLogsZip(resourceGroupName, name, 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 ContinuousWebJobCollection} for more - * information. + * 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 _listContinuousWebJobs(resourceGroupName, name, options, callback) { +function _listConfigurationSnapshotInfo(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -8424,7 +8174,6 @@ function _listContinuousWebJobs(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -8450,6 +8199,9 @@ function _listContinuousWebJobs(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -8459,12 +8211,12 @@ function _listContinuousWebJobs(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -8506,12 +8258,13 @@ function _listContinuousWebJobs(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -8531,7 +8284,7 @@ function _listContinuousWebJobs(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ContinuousWebJobCollection']().mapper(); + let resultMapper = new client.models['SiteConfigurationSnapshotInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -8547,17 +8300,17 @@ function _listContinuousWebJobs(resourceGroupName, name, options, callback) { } /** - * @summary Gets a continuous web job by its ID for an app, or a deployment - * slot. + * @summary Gets a snapshot of the configuration of an app at a previous point + * in time. * - * Gets a continuous web job by its ID for an app, or a deployment slot. + * 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 Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @param {string} snapshotId The ID of the snapshot to read. * * @param {object} [options] Optional Parameters. * @@ -8571,13 +8324,13 @@ function _listContinuousWebJobs(resourceGroupName, name, 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 ContinuousWebJob} for more information. + * 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 _getContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { +function _getConfigurationSnapshot(resourceGroupName, name, snapshotId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -8587,7 +8340,6 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -8610,12 +8362,15 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, options, call if (name === 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 (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.'); } @@ -8625,13 +8380,13 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}'; + 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('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{snapshotId}', encodeURIComponent(snapshotId)); 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('&'); } @@ -8663,7 +8418,7 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, options, call return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -8673,12 +8428,13 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, options, call try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -8698,7 +8454,7 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ContinuousWebJob']().mapper(); + let resultMapper = new client.models['SiteConfigResource']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -8714,17 +8470,16 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, options, call } /** - * @summary Delete a continuous web job by its ID for an app, or a deployment - * slot. + * @summary Reverts the configuration of an app to a previous snapshot. * - * Delete a continuous web job by its ID for an app, or a deployment slot. + * 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 Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @param {string} snapshotId The ID of the snapshot to read. * * @param {object} [options] Optional Parameters. * @@ -8743,7 +8498,7 @@ function _getContinuousWebJob(resourceGroupName, name, webJobName, options, call * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { +function _recoverSiteConfigurationSnapshot(resourceGroupName, name, snapshotId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -8753,7 +8508,6 @@ function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -8776,12 +8530,15 @@ function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, c if (name === 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 (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.'); } @@ -8791,20 +8548,20 @@ function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, c // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}'; + 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('{webJobName}', encodeURIComponent(webJobName)); + requestUrl = requestUrl.replace('{snapshotId}', encodeURIComponent(snapshotId)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -8829,7 +8586,7 @@ function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, c return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -8863,16 +8620,159 @@ function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, c } /** - * @summary Start a continuous web job for an app, or a deployment slot. + * @summary Gets the last lines of docker logs for the given site * - * Start a continuous web job for an app, or a deployment slot. + * 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 Site name. + * @param {string} name Name of web app. * - * @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. + * + * {object} [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. * @@ -8885,13 +8785,13 @@ function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, c * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. + * {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 _startContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { +function _getContainerLogsZip(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -8901,7 +8801,6 @@ function _startContinuousWebJob(resourceGroupName, name, webJobName, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -8924,12 +8823,12 @@ function _startContinuousWebJob(resourceGroupName, name, webJobName, options, ca if (name === 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.'); } @@ -8939,13 +8838,12 @@ function _startContinuousWebJob(resourceGroupName, name, webJobName, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/start'; + 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('{webJobName}', encodeURIComponent(webJobName)); 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('&'); } @@ -8972,20 +8870,22 @@ function _startContinuousWebJob(resourceGroupName, name, webJobName, options, ca } 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(responseBody); + 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 { - parsedErrorResponse = JSON.parse(responseBody); + if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; @@ -9002,26 +8902,23 @@ function _startContinuousWebJob(resourceGroupName, name, webJobName, options, ca } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } /** - * @summary Stop a continuous web job for an app, or a deployment slot. + * @summary List continuous web jobs for an app, or a deployment slot. * - * Stop a continuous web job 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} webJobName Name of Web Job. - * * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the @@ -9033,13 +8930,15 @@ function _startContinuousWebJob(resourceGroupName, name, webJobName, options, ca * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _stopContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { +function _listContinuousWebJobs(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9049,7 +8948,6 @@ function _stopContinuousWebJob(resourceGroupName, name, webJobName, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -9072,12 +8970,12 @@ function _stopContinuousWebJob(resourceGroupName, name, webJobName, options, cal if (name === 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.'); } @@ -9087,20 +8985,19 @@ function _stopContinuousWebJob(resourceGroupName, name, webJobName, options, cal // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/stop'; + 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('{webJobName}', encodeURIComponent(webJobName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -9125,7 +9022,7 @@ function _stopContinuousWebJob(resourceGroupName, name, webJobName, options, cal return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -9135,12 +9032,13 @@ function _stopContinuousWebJob(resourceGroupName, name, webJobName, options, cal try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -9153,20 +9051,40 @@ function _stopContinuousWebJob(resourceGroupName, name, webJobName, 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['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. + * @summary Gets a continuous web job by its ID for an app, or a deployment + * slot. * - * List deployments 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 Name of the app. + * @param {string} name Site name. + * + * @param {string} webJobName Name of Web Job. * * @param {object} [options] Optional Parameters. * @@ -9180,13 +9098,13 @@ function _stopContinuousWebJob(resourceGroupName, name, webJobName, 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 DeploymentCollection} for more information. + * 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 _listDeployments(resourceGroupName, name, options, callback) { +function _getContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9196,7 +9114,6 @@ function _listDeployments(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -9219,9 +9136,15 @@ function _listDeployments(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -9231,12 +9154,13 @@ function _listDeployments(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -9268,7 +9192,7 @@ function _listDeployments(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -9303,7 +9227,7 @@ function _listDeployments(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DeploymentCollection']().mapper(); + let resultMapper = new client.models['ContinuousWebJob']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -9319,16 +9243,17 @@ function _listDeployments(resourceGroupName, name, options, callback) { } /** - * @summary Get a deployment by its ID for an app, or a deployment slot. + * @summary Delete a continuous web job by its ID for an app, or a deployment + * slot. * - * Get a deployment 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 Name of the app. + * @param {string} name Site name. * - * @param {string} id Deployment ID. + * @param {string} webJobName Name of Web Job. * * @param {object} [options] Optional Parameters. * @@ -9341,14 +9266,13 @@ function _listDeployments(resourceGroupName, name, 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 Deployment} 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 _getDeployment(resourceGroupName, name, id, options, callback) { +function _deleteContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9358,7 +9282,6 @@ function _getDeployment(resourceGroupName, name, id, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -9381,12 +9304,15 @@ function _getDeployment(resourceGroupName, name, id, options, callback) { if (name === 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 (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.'); } @@ -9396,20 +9322,20 @@ function _getDeployment(resourceGroupName, name, id, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'; + 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('{id}', encodeURIComponent(id)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -9434,7 +9360,7 @@ function _getDeployment(resourceGroupName, name, id, 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); @@ -9462,64 +9388,22 @@ function _getDeployment(resourceGroupName, name, id, 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['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. + * @summary Start a continuous web job for an app, or a deployment slot. * - * Create a deployment 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 Name of the app. - * - * @param {string} id ID of an existing deployment. - * - * @param {object} deployment Deployment details. - * - * @param {string} [deployment.deploymentId] Identifier for deployment. - * - * @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} name Site name. * - * @param {string} [deployment.kind] Kind of resource. + * @param {string} webJobName Name of Web Job. * * @param {object} [options] Optional Parameters. * @@ -9532,14 +9416,13 @@ function _getDeployment(resourceGroupName, name, id, 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 Deployment} 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 _createDeployment(resourceGroupName, name, id, deployment, options, callback) { +function _startContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9549,7 +9432,6 @@ function _createDeployment(resourceGroupName, name, id, deployment, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -9572,15 +9454,15 @@ function _createDeployment(resourceGroupName, name, id, deployment, options, cal if (name === 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 (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.'); } @@ -9590,20 +9472,20 @@ function _createDeployment(resourceGroupName, name, id, deployment, options, cal // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'; + 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('{id}', encodeURIComponent(id)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -9621,28 +9503,14 @@ function _createDeployment(resourceGroupName, name, id, deployment, options, cal } } } - // 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; + httpRequest.body = null; // 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 !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -9670,39 +9538,22 @@ function _createDeployment(resourceGroupName, name, id, deployment, 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['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. + * @summary Stop a continuous web job for an app, or a deployment slot. * - * Delete a deployment by its ID 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 Name of the app. + * @param {string} name Site name. * - * @param {string} id Deployment ID. + * @param {string} webJobName Name of Web Job. * * @param {object} [options] Optional Parameters. * @@ -9721,7 +9572,7 @@ function _createDeployment(resourceGroupName, name, id, deployment, options, cal * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteDeployment(resourceGroupName, name, id, options, callback) { +function _stopContinuousWebJob(resourceGroupName, name, webJobName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9731,7 +9582,6 @@ function _deleteDeployment(resourceGroupName, name, id, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -9754,12 +9604,15 @@ function _deleteDeployment(resourceGroupName, name, id, options, callback) { if (name === 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 (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.'); } @@ -9769,20 +9622,20 @@ function _deleteDeployment(resourceGroupName, name, id, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}'; + 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('{id}', encodeURIComponent(id)); + requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -9807,7 +9660,7 @@ function _deleteDeployment(resourceGroupName, name, id, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -9841,21 +9694,15 @@ function _deleteDeployment(resourceGroupName, name, id, options, callback) { } /** - * @summary List deployment log for specific deployment for an app, or a - * deployment slot. + * @summary List deployments for an app, or a deployment slot. * - * List deployment log for specific deployment 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} 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 @@ -9868,13 +9715,13 @@ function _deleteDeployment(resourceGroupName, name, id, 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 Deployment} for more information. + * 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 _listDeploymentLog(resourceGroupName, name, id, options, callback) { +function _listDeployments(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -9884,7 +9731,6 @@ function _listDeploymentLog(resourceGroupName, name, id, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -9907,12 +9753,12 @@ function _listDeploymentLog(resourceGroupName, name, id, options, callback) { if (name === 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.'); } @@ -9922,13 +9768,12 @@ function _listDeploymentLog(resourceGroupName, name, id, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}/log'; + 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('{id}', encodeURIComponent(id)); 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('&'); } @@ -9970,12 +9815,13 @@ function _listDeploymentLog(resourceGroupName, name, id, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -9995,7 +9841,7 @@ function _listDeploymentLog(resourceGroupName, name, id, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Deployment']().mapper(); + let resultMapper = new client.models['DeploymentCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10011,15 +9857,17 @@ function _listDeploymentLog(resourceGroupName, name, id, options, callback) { } /** - * @summary Lists ownership identifiers for domain associated with web app. + * @summary Get a deployment by its ID for an app, or a deployment slot. * - * Lists ownership identifiers for domain associated with web app. + * 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 @@ -10032,13 +9880,13 @@ function _listDeploymentLog(resourceGroupName, name, id, 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 IdentifierCollection} for more information. + * 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 _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callback) { +function _getDeployment(resourceGroupName, name, id, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10048,7 +9896,6 @@ function _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -10071,9 +9918,15 @@ function _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callb if (name === 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.'); } @@ -10083,12 +9936,13 @@ function _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -10130,12 +9984,13 @@ function _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callb try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -10155,7 +10010,7 @@ function _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callb parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['IdentifierCollection']().mapper(); + let resultMapper = new client.models['Deployment']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10171,194 +10026,39 @@ function _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callb } /** - * @summary Get domain ownership identifier for web app. + * @summary Create a deployment for an app, or a deployment slot. * - * Get domain ownership identifier for web app. + * 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} 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) + * @param {string} id ID of an existing deployment. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {object} deployment Deployment details. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Identifier} for more information. + * @param {number} [deployment.status] Deployment status. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {string} [deployment.message] Details about deployment status. * - * {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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @param {string} [deployment.author] Who authored the deployment. * - * Creates a domain ownership identifier for web app, or updates an existing - * ownership identifier. + * @param {string} [deployment.deployer] Who performed the deployment. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {string} [deployment.authorEmail] Author email. * - * @param {string} name Name of the app. + * @param {date} [deployment.startTime] Start time. * - * @param {string} domainOwnershipIdentifierName Name of domain ownership - * identifier. + * @param {date} [deployment.endTime] End time. * - * @param {object} domainOwnershipIdentifier A JSON representation of the - * domain ownership properties. + * @param {boolean} [deployment.active] True if deployment is currently active, + * false if completed and null if not started. * - * @param {string} [domainOwnershipIdentifier.identifierId] String - * representation of the identity. + * @param {string} [deployment.details] Details on deployment. * - * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * @param {string} [deployment.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -10372,13 +10072,13 @@ function _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipI * {Error} 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. + * 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 _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options, callback) { +function _createDeployment(resourceGroupName, name, id, deployment, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10388,7 +10088,6 @@ function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domai if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -10411,15 +10110,18 @@ function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domai if (name === 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 (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 (domainOwnershipIdentifier === null || domainOwnershipIdentifier === undefined) { - throw new Error('domainOwnershipIdentifier cannot be null or undefined.'); + 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.'); } @@ -10429,13 +10131,13 @@ function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domai // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; + 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('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); + requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); 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('&'); } @@ -10464,14 +10166,14 @@ function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domai 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'); + 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(domainOwnershipIdentifier, null, 2)}.`); + `payload - ${JSON.stringify(deployment, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -10491,12 +10193,13 @@ function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domai try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -10516,7 +10219,7 @@ function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domai parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Identifier']().mapper(); + let resultMapper = new client.models['Deployment']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10532,17 +10235,16 @@ function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domai } /** - * @summary Deletes a domain ownership identifier for a web app. + * @summary Delete a deployment by its ID for an app, or a deployment slot. * - * Deletes a domain ownership identifier for a web app. + * 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} domainOwnershipIdentifierName Name of domain ownership - * identifier. + * @param {string} id Deployment ID. * * @param {object} [options] Optional Parameters. * @@ -10561,7 +10263,7 @@ function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domai * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, options, callback) { +function _deleteDeployment(resourceGroupName, name, id, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10571,7 +10273,6 @@ function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -10594,12 +10295,15 @@ function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh if (name === 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 (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.'); } @@ -10609,13 +10313,13 @@ function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; + 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('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); + requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); 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('&'); } @@ -10681,27 +10385,20 @@ function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh } /** - * @summary Creates a domain ownership identifier for web app, or updates an - * existing ownership identifier. + * @summary List deployment log for specific deployment for an app, or a + * deployment slot. * - * Creates a domain ownership identifier for web app, or updates an existing - * ownership identifier. + * 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} 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} 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. * @@ -10715,13 +10412,13 @@ function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh * {Error} 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. + * 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 _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options, callback) { +function _listDeploymentLog(resourceGroupName, name, id, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10731,7 +10428,6 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -10754,15 +10450,15 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh if (name === 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 (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.'); } @@ -10772,20 +10468,20 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}'; + 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('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); + requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -10803,21 +10499,7 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -10834,12 +10516,13 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -10859,7 +10542,7 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Identifier']().mapper(); + let resultMapper = new client.models['Deployment']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -10875,14 +10558,58 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh } /** - * @summary Get the status of the last MSDeploy operation. + * @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. * - * Get the status of the last MSDeploy operation. + * 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 web app. + * @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. * @@ -10896,13 +10623,13 @@ function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnersh * {Error} 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. + * 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 _getMSDeployStatus(resourceGroupName, name, options, callback) { +function _discoverBackup(resourceGroupName, name, request, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -10912,7 +10639,6 @@ function _getMSDeployStatus(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -10935,9 +10661,15 @@ function _getMSDeployStatus(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -10947,19 +10679,19 @@ function _getMSDeployStatus(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'; + 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(apiVersion)); + queryParameters.push('api-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 @@ -10977,7 +10709,21 @@ function _getMSDeployStatus(resourceGroupName, name, options, callback) { } } } - httpRequest.body = null; + // 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) { @@ -10994,12 +10740,13 @@ function _getMSDeployStatus(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -11019,7 +10766,7 @@ function _getMSDeployStatus(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MSDeployStatus']().mapper(); + let resultMapper = new client.models['RestoreRequest']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -11034,124 +10781,15 @@ function _getMSDeployStatus(resourceGroupName, name, options, callback) { }); } - /** - * @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. + * @summary Lists ownership identifiers for domain associated with web app. * - * Get the MSDeploy Log for the last MSDeploy operation. + * 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 web app. + * @param {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -11165,13 +10803,13 @@ function _createMSDeployOperation(resourceGroupName, name, mSDeploy, 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 MSDeployLog} for more information. + * 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 _getMSDeployLog(resourceGroupName, name, options, callback) { +function _listDomainOwnershipIdentifiers(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -11181,7 +10819,6 @@ function _getMSDeployLog(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -11207,6 +10844,9 @@ function _getMSDeployLog(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -11216,12 +10856,12 @@ function _getMSDeployLog(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy/log'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -11253,7 +10893,7 @@ function _getMSDeployLog(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -11263,12 +10903,13 @@ function _getMSDeployLog(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -11288,7 +10929,7 @@ function _getMSDeployLog(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MSDeployLog']().mapper(); + let resultMapper = new client.models['IdentifierCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -11304,14 +10945,17 @@ function _getMSDeployLog(resourceGroupName, name, options, callback) { } /** - * @summary List the functions for a web site, or a deployment slot. + * @summary Get domain ownership identifier for web app. * - * List the functions for a web site, or a deployment slot. + * Get domain ownership identifier for web app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @param {string} name Name of the app. + * + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. * * @param {object} [options] Optional Parameters. * @@ -11325,14 +10969,13 @@ function _getMSDeployLog(resourceGroupName, name, 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 FunctionEnvelopeCollection} for more - * information. + * 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 _listFunctions(resourceGroupName, name, options, callback) { +function _getDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -11342,7 +10985,6 @@ function _listFunctions(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -11365,9 +11007,15 @@ function _listFunctions(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -11377,12 +11025,13 @@ function _listFunctions(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -11414,7 +11063,7 @@ function _listFunctions(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -11424,12 +11073,13 @@ function _listFunctions(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -11449,7 +11099,7 @@ function _listFunctions(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionEnvelopeCollection']().mapper(); + let resultMapper = new client.models['Identifier']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -11465,14 +11115,27 @@ function _listFunctions(resourceGroupName, name, options, callback) { } /** - * @summary Fetch a short lived token that can be exchanged for a master key. + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. * - * Fetch a short lived token that can be exchanged for a master key. + * 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 web app. + * @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. * @@ -11485,13 +11148,14 @@ function _listFunctions(resourceGroupName, name, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [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 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 _getFunctionsAdminToken(resourceGroupName, name, options, callback) { +function _createOrUpdateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -11501,7 +11165,6 @@ function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -11524,9 +11187,18 @@ function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -11536,19 +11208,20 @@ function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/admin/token'; + 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(apiVersion)); + queryParameters.push('api-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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -11566,7 +11239,21 @@ function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { } } } - httpRequest.body = null; + // 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) { @@ -11583,12 +11270,13 @@ function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -11608,13 +11296,7 @@ function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; + let resultMapper = new client.models['Identifier']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -11630,17 +11312,17 @@ function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { } /** - * @summary Get function information by its ID for web site, or a deployment - * slot. + * @summary Deletes a domain ownership identifier for a web app. * - * Get function information by its ID for web site, or a deployment slot. + * 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 Site name. + * @param {string} name Name of the app. * - * @param {string} functionName Function name. + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. * * @param {object} [options] Optional Parameters. * @@ -11653,14 +11335,13 @@ function _getFunctionsAdminToken(resourceGroupName, name, 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 FunctionEnvelope} 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 _getFunction(resourceGroupName, name, functionName, options, callback) { +function _deleteDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -11670,7 +11351,6 @@ function _getFunction(resourceGroupName, name, functionName, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -11693,12 +11373,15 @@ function _getFunction(resourceGroupName, name, functionName, options, callback) if (name === 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 (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.'); } @@ -11708,20 +11391,20 @@ function _getFunction(resourceGroupName, name, functionName, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'; + 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('{functionName}', encodeURIComponent(functionName)); + requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -11746,7 +11429,7 @@ function _getFunction(resourceGroupName, name, functionName, options, callback) return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -11774,61 +11457,33 @@ function _getFunction(resourceGroupName, name, functionName, 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['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. + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. * - * Create function for web site, or a deployment slot. + * 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 Site name. - * - * @param {string} functionName Function name. - * - * @param {object} functionEnvelope Function details. - * - * @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 {string} name Name of the app. * - * @param {object} [functionEnvelope.config] Config information. + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. * - * @param {object} [functionEnvelope.files] File list. + * @param {object} domainOwnershipIdentifier A JSON representation of the + * domain ownership properties. * - * @param {string} [functionEnvelope.testData] Test data used when testing via - * the Azure Portal. + * @param {string} [domainOwnershipIdentifier.identifierId] String + * representation of the identity. * - * @param {string} [functionEnvelope.kind] Kind of resource. + * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -11842,94 +11497,13 @@ function _getFunction(resourceGroupName, name, functionName, 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 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. + * 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 _deleteFunction(resourceGroupName, name, functionName, options, callback) { +function _updateDomainOwnershipIdentifier(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -11939,7 +11513,6 @@ function _deleteFunction(resourceGroupName, name, functionName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -11962,12 +11535,18 @@ function _deleteFunction(resourceGroupName, name, functionName, options, callbac if (name === 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 (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.'); } @@ -11977,20 +11556,20 @@ function _deleteFunction(resourceGroupName, name, functionName, options, callbac // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'; + 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('{functionName}', encodeURIComponent(functionName)); + requestUrl = requestUrl.replace('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -12008,14 +11587,28 @@ function _deleteFunction(resourceGroupName, name, functionName, options, callbac } } } - httpRequest.body = null; + // 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 !== 204 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -12025,12 +11618,13 @@ function _deleteFunction(resourceGroupName, name, functionName, options, callbac try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -12043,23 +11637,37 @@ function _deleteFunction(resourceGroupName, name, functionName, 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['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 function secrets for a function in a web site, or a deployment - * slot. + * @summary Get the status of the last MSDeploy operation. * - * Get function secrets for a function in a web site, or a deployment slot. + * Get the status of the last MSDeploy operation. * * @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} name Name of web app. * * @param {object} [options] Optional Parameters. * @@ -12073,13 +11681,13 @@ function _deleteFunction(resourceGroupName, name, functionName, 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 FunctionSecrets} for more information. + * 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 _listFunctionSecrets(resourceGroupName, name, functionName, options, callback) { +function _getMSDeployStatus(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -12089,7 +11697,6 @@ function _listFunctionSecrets(resourceGroupName, name, functionName, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -12112,12 +11719,12 @@ function _listFunctionSecrets(resourceGroupName, name, functionName, options, ca if (name === 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.'); } @@ -12127,20 +11734,19 @@ function _listFunctionSecrets(resourceGroupName, name, functionName, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listsecrets'; + 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('{functionName}', encodeURIComponent(functionName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -12175,12 +11781,13 @@ function _listFunctionSecrets(resourceGroupName, name, functionName, options, ca try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -12200,7 +11807,7 @@ function _listFunctionSecrets(resourceGroupName, name, functionName, options, ca parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionSecrets']().mapper(); + let resultMapper = new client.models['MSDeployStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -12215,15 +11822,44 @@ function _listFunctionSecrets(resourceGroupName, name, functionName, options, ca }); } + /** - * @summary Get hostname bindings for an app or a deployment slot. + * @summary Invoke the MSDeploy web app extension. * - * Get hostname bindings for an app or a deployment slot. + * Invoke the MSDeploy web app extension. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @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. * @@ -12237,14 +11873,93 @@ function _listFunctionSecrets(resourceGroupName, name, functionName, 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 HostNameBindingCollection} for more - * information. + * 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 _listHostNameBindings(resourceGroupName, name, options, callback) { +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') { @@ -12254,7 +11969,6 @@ function _listHostNameBindings(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -12280,6 +11994,9 @@ function _listHostNameBindings(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -12289,12 +12006,12 @@ function _listHostNameBindings(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -12326,7 +12043,7 @@ function _listHostNameBindings(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -12361,7 +12078,7 @@ function _listHostNameBindings(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HostNameBindingCollection']().mapper(); + let resultMapper = new client.models['MSDeployLog']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -12377,18 +12094,14 @@ function _listHostNameBindings(resourceGroupName, name, options, callback) { } /** - * @summary Get the named hostname binding for an app (or deployment slot, if - * specified). + * @summary List the functions for a web site, or a deployment slot. * - * Get the named hostname binding for an app (or deployment slot, if - * specified). + * 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 Name of the app. - * - * @param {string} hostName Hostname in the hostname binding. + * @param {string} name Site name. * * @param {object} [options] Optional Parameters. * @@ -12402,13 +12115,14 @@ function _listHostNameBindings(resourceGroupName, name, 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 HostNameBinding} for more information. + * 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 _getHostNameBinding(resourceGroupName, name, hostName, options, callback) { +function _listFunctions(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -12418,7 +12132,6 @@ function _getHostNameBinding(resourceGroupName, name, hostName, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -12441,12 +12154,12 @@ function _getHostNameBinding(resourceGroupName, name, hostName, options, callbac if (name === 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.'); } @@ -12456,13 +12169,12 @@ function _getHostNameBinding(resourceGroupName, name, hostName, options, callbac // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'; + 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('{hostName}', encodeURIComponent(hostName)); 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('&'); } @@ -12494,7 +12206,7 @@ function _getHostNameBinding(resourceGroupName, name, hostName, options, callbac return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -12529,7 +12241,7 @@ function _getHostNameBinding(resourceGroupName, name, hostName, options, callbac parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HostNameBinding']().mapper(); + let resultMapper = new client.models['FunctionEnvelopeCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -12545,42 +12257,14 @@ function _getHostNameBinding(resourceGroupName, name, hostName, options, callbac } /** - * @summary Creates a hostname binding for an app. + * @summary Fetch a short lived token that can be exchanged for a master key. * - * Creates a hostname binding for an app. + * 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 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} name Name of web app. * * @param {object} [options] Optional Parameters. * @@ -12593,14 +12277,13 @@ function _getHostNameBinding(resourceGroupName, name, hostName, 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 HostNameBinding} for more information. + * {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 _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostNameBinding, options, callback) { +function _getFunctionsAdminToken(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -12610,7 +12293,6 @@ function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostN if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -12633,15 +12315,12 @@ function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostN if (name === 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.'); } @@ -12651,20 +12330,19 @@ function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostN // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'; + 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('{hostName}', encodeURIComponent(hostName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -12682,21 +12360,7 @@ function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostN } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -12713,12 +12377,13 @@ function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostN try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -12738,7 +12403,13 @@ function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostN parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HostNameBinding']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -12754,16 +12425,17 @@ function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostN } /** - * @summary Deletes a hostname binding for an app. + * @summary Get function information by its ID for web site, or a deployment + * slot. * - * Deletes a hostname binding for an app. + * 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 Name of the app. + * @param {string} name Site name. * - * @param {string} hostName Hostname in the hostname binding. + * @param {string} functionName Function name. * * @param {object} [options] Optional Parameters. * @@ -12776,13 +12448,14 @@ function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostN * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteHostNameBinding(resourceGroupName, name, hostName, options, callback) { +function _getFunction(resourceGroupName, name, functionName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -12792,7 +12465,6 @@ function _deleteHostNameBinding(resourceGroupName, name, hostName, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -12815,12 +12487,15 @@ function _deleteHostNameBinding(resourceGroupName, name, hostName, options, call if (name === 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 (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.'); } @@ -12830,20 +12505,20 @@ function _deleteHostNameBinding(resourceGroupName, name, hostName, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}'; + 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('{hostName}', encodeURIComponent(hostName)); + requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -12868,7 +12543,7 @@ function _deleteHostNameBinding(resourceGroupName, name, hostName, options, call return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -12896,25 +12571,63 @@ function _deleteHostNameBinding(resourceGroupName, name, hostName, options, call // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Retrieves a specific Service Bus Hybrid Connection used by this Web - * App. + * @summary Create function for web site, or a deployment slot. * - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * 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 The name of the web app. + * @param {string} name Site name. * - * @param {string} namespaceName The namespace for this hybrid connection. + * @param {string} functionName Function name. * - * @param {string} relayName The relay name for this hybrid connection. + * @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. * @@ -12928,13 +12641,94 @@ function _deleteHostNameBinding(resourceGroupName, name, hostName, options, call * {Error} 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. + * 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 _getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, callback) { +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') { @@ -12944,7 +12738,6 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -12967,15 +12760,15 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, if (name === 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 (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.'); } @@ -12985,21 +12778,20 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, // 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}'; + 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('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -13024,7 +12816,7 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 204 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -13052,69 +12844,23 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @summary Get function secrets for a function in a web site, or a deployment + * slot. * - * Creates a new Hybrid Connection using a Service Bus relay. + * 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 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} name Site name. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} functionName Function name. * * @param {object} [options] Optional Parameters. * @@ -13128,13 +12874,13 @@ function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, * {Error} 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. + * 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 _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, callback) { +function _listFunctionSecrets(resourceGroupName, name, functionName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -13144,7 +12890,6 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -13167,18 +12912,15 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, if (name === 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 (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.'); } @@ -13188,21 +12930,20 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, // 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}'; + 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('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + requestUrl = requestUrl.replace('{functionName}', encodeURIComponent(functionName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -13220,21 +12961,7 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -13251,12 +12978,13 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -13276,7 +13004,7 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HybridConnection']().mapper(); + let resultMapper = new client.models['FunctionSecrets']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -13292,18 +13020,14 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, } /** - * @summary Removes a Hybrid Connection from this site. + * @summary Get hostname bindings for an app or a deployment slot. * - * Removes a Hybrid Connection from this site. + * 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 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} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -13316,13 +13040,15 @@ function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, callback) { +function _listHostNameBindings(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -13332,7 +13058,6 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -13355,15 +13080,12 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa if (name === 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.'); } @@ -13373,21 +13095,19 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa // 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}'; + 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('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -13412,7 +13132,7 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -13422,12 +13142,13 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -13440,52 +13161,41 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Creates a new Hybrid Connection using a Service Bus relay. + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). * - * Creates a new Hybrid Connection using a Service Bus relay. + * 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 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} name Name of the app. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} hostName Hostname in the hostname binding. * * @param {object} [options] Optional Parameters. * @@ -13499,13 +13209,13 @@ function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayNa * {Error} 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. + * 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 _updateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, callback) { +function _getHostNameBinding(resourceGroupName, name, hostName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -13515,7 +13225,6 @@ function _updateHybridConnection(resourceGroupName, name, namespaceName, relayNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -13538,18 +13247,15 @@ function _updateHybridConnection(resourceGroupName, name, namespaceName, relayNa if (name === 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 (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.'); } @@ -13559,21 +13265,20 @@ function _updateHybridConnection(resourceGroupName, name, namespaceName, relayNa // 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}'; + 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('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PATCH'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -13591,21 +13296,7 @@ function _updateHybridConnection(resourceGroupName, name, namespaceName, relayNa } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -13622,12 +13313,13 @@ function _updateHybridConnection(resourceGroupName, name, namespaceName, relayNa try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -13647,7 +13339,7 @@ function _updateHybridConnection(resourceGroupName, name, namespaceName, relayNa parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HybridConnection']().mapper(); + let resultMapper = new client.models['HostNameBinding']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -13663,18 +13355,42 @@ function _updateHybridConnection(resourceGroupName, name, namespaceName, relayNa } /** - * @summary Gets the send key name and value for a Hybrid Connection. + * @summary Creates a hostname binding for an app. * - * Gets the send key name and value for a Hybrid Connection. + * Creates a hostname binding for an 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} name Name of the app. * - * @param {string} namespaceName The namespace for this hybrid connection. + * @param {string} hostName Hostname in the hostname binding. * - * @param {string} relayName The relay name for this hybrid connection. + * @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. * @@ -13688,13 +13404,13 @@ function _updateHybridConnection(resourceGroupName, name, namespaceName, relayNa * {Error} 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. + * 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 _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, callback) { +function _createOrUpdateHostNameBinding(resourceGroupName, name, hostName, hostNameBinding, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -13704,7 +13420,6 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -13727,15 +13442,18 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay if (name === 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 (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 (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 (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.'); } @@ -13745,21 +13463,20 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay // 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'; + 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('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + requestUrl = requestUrl.replace('{hostName}', encodeURIComponent(hostName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -13777,7 +13494,21 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay } } } - httpRequest.body = null; + // 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) { @@ -13794,12 +13525,13 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -13819,7 +13551,7 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HybridConnectionKey']().mapper(); + let resultMapper = new client.models['HostNameBinding']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -13835,14 +13567,16 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay } /** - * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * @summary Deletes a hostname binding for an app. * - * Retrieves all Service Bus Hybrid Connections used by this Web App. + * Deletes a hostname binding for an 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} name Name of the app. + * + * @param {string} hostName Hostname in the hostname binding. * * @param {object} [options] Optional Parameters. * @@ -13855,14 +13589,13 @@ function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relay * * {Error} 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [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) { +function _deleteHostNameBinding(resourceGroupName, name, hostName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -13872,7 +13605,6 @@ function _listHybridConnections(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -13895,9 +13627,15 @@ function _listHybridConnections(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -13907,19 +13645,20 @@ function _listHybridConnections(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays'; + 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(apiVersion)); + queryParameters.push('api-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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -13944,7 +13683,7 @@ function _listHybridConnections(resourceGroupName, name, 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); @@ -13972,39 +13711,25 @@ function _listHybridConnections(resourceGroupName, name, 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['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). + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. * - * Gets hybrid connections configured for an app (or deployment slot, if - * specified). + * 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 Name of the app. + * @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. * @@ -14018,14 +13743,13 @@ function _listHybridConnections(resourceGroupName, name, 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 RelayServiceConnectionEntity} for more - * information. + * 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 _listRelayServiceConnections(resourceGroupName, name, options, callback) { +function _getHybridConnection(resourceGroupName, name, namespaceName, relayName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -14035,7 +13759,6 @@ function _listRelayServiceConnections(resourceGroupName, name, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -14058,9 +13781,18 @@ function _listRelayServiceConnections(resourceGroupName, name, options, callback if (name === 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.'); } @@ -14070,12 +13802,14 @@ function _listRelayServiceConnections(resourceGroupName, name, options, callback // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -14117,12 +13851,13 @@ function _listRelayServiceConnections(resourceGroupName, name, options, callback try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -14142,7 +13877,7 @@ function _listRelayServiceConnections(resourceGroupName, name, options, callback parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); + let resultMapper = new client.models['HybridConnection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -14158,16 +13893,46 @@ function _listRelayServiceConnections(resourceGroupName, name, options, callback } /** - * @summary Gets a hybrid connection configuration by its name. + * @summary Creates a new Hybrid Connection using a Service Bus relay. * - * Gets a hybrid connection configuration by its name. + * 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 Name of the app. + * @param {string} name The name of the web app. * - * @param {string} entityName Name of the hybrid connection. + * @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. * @@ -14181,14 +13946,13 @@ function _listRelayServiceConnections(resourceGroupName, name, 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 RelayServiceConnectionEntity} for more - * information. + * 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 _getRelayServiceConnection(resourceGroupName, name, entityName, options, callback) { +function _createOrUpdateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -14198,7 +13962,6 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -14221,12 +13984,21 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, options if (name === 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 (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.'); } @@ -14236,20 +14008,21 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, options // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'; + 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('{entityName}', encodeURIComponent(entityName)); + 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(apiVersion)); + queryParameters.push('api-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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -14267,7 +14040,21 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, options } } } - httpRequest.body = null; + // 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) { @@ -14284,12 +14071,13 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, options try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -14309,7 +14097,7 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, options parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); + let resultMapper = new client.models['HybridConnection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -14325,37 +14113,18 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, options } /** - * @summary Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). + * @summary Removes a Hybrid Connection from this site. * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). + * Removes a Hybrid Connection from this site. * * @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} name The name of the web app. * - * @param {string} [connectionEnvelope.biztalkUri] + * @param {string} namespaceName The namespace for this hybrid connection. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} relayName The relay name for this hybrid connection. * * @param {object} [options] Optional Parameters. * @@ -14368,15 +14137,13 @@ function _getRelayServiceConnection(resourceGroupName, name, entityName, 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 RelayServiceConnectionEntity} 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 _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, callback) { +function _deleteHybridConnection(resourceGroupName, name, namespaceName, relayName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -14386,7 +14153,6 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -14409,15 +14175,18 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa if (name === 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 (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 (connectionEnvelope === null || connectionEnvelope === undefined) { - throw new Error('connectionEnvelope cannot be null or undefined.'); + 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.'); } @@ -14427,20 +14196,21 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'; + 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('{entityName}', encodeURIComponent(entityName)); + 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(apiVersion)); + queryParameters.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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -14458,28 +14228,14 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa } } } - // 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; + httpRequest.body = null; // 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 !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -14507,39 +14263,52 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @summary Creates a new Hybrid Connection using a Service Bus relay. * - * Deletes a relay service connection by its name. + * 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 Name of the app. + * @param {string} name The name of the web app. * - * @param {string} entityName Name of the hybrid connection configuration. + * @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. * @@ -14552,13 +14321,14 @@ function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityNa * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteRelayServiceConnection(resourceGroupName, name, entityName, options, callback) { +function _updateHybridConnection(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -14568,7 +14338,6 @@ function _deleteRelayServiceConnection(resourceGroupName, name, entityName, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -14591,12 +14360,21 @@ function _deleteRelayServiceConnection(resourceGroupName, name, entityName, opti if (name === 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 (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.'); } @@ -14606,20 +14384,21 @@ function _deleteRelayServiceConnection(resourceGroupName, name, entityName, opti // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'; + 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('{entityName}', encodeURIComponent(entityName)); + 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(apiVersion)); + queryParameters.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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -14637,14 +14416,28 @@ function _deleteRelayServiceConnection(resourceGroupName, name, entityName, opti } } } - httpRequest.body = null; + // 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 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -14654,12 +14447,13 @@ function _deleteRelayServiceConnection(resourceGroupName, name, entityName, opti try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -14672,43 +14466,41 @@ function _deleteRelayServiceConnection(resourceGroupName, name, entityName, opti // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 configuration (PUT), or updates an - * existing one (PATCH). + * @summary Gets the send key name and value for a Hybrid Connection. * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). + * 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 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} name The name of the web app. * - * @param {string} [connectionEnvelope.biztalkUri] + * @param {string} namespaceName The namespace for this hybrid connection. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} relayName The relay name for this hybrid connection. * * @param {object} [options] Optional Parameters. * @@ -14722,14 +14514,13 @@ function _deleteRelayServiceConnection(resourceGroupName, name, entityName, 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 RelayServiceConnectionEntity} for more - * information. + * 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 _updateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, callback) { +function _listHybridConnectionKeys(resourceGroupName, name, namespaceName, relayName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -14739,7 +14530,6 @@ function _updateRelayServiceConnection(resourceGroupName, name, entityName, conn if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -14762,15 +14552,18 @@ function _updateRelayServiceConnection(resourceGroupName, name, entityName, conn if (name === 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 (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 (connectionEnvelope === null || connectionEnvelope === undefined) { - throw new Error('connectionEnvelope cannot be null or undefined.'); + 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.'); } @@ -14780,20 +14573,21 @@ function _updateRelayServiceConnection(resourceGroupName, name, entityName, conn // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}'; + 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('{entityName}', encodeURIComponent(entityName)); + 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(apiVersion)); + queryParameters.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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -14811,21 +14605,7 @@ function _updateRelayServiceConnection(resourceGroupName, name, entityName, conn } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -14842,12 +14622,13 @@ function _updateRelayServiceConnection(resourceGroupName, name, entityName, conn try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -14867,7 +14648,7 @@ function _updateRelayServiceConnection(resourceGroupName, name, entityName, conn parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); + let resultMapper = new client.models['HybridConnectionKey']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -14883,14 +14664,14 @@ function _updateRelayServiceConnection(resourceGroupName, name, entityName, conn } /** - * @summary Gets all scale-out instances of an app. + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. * - * Gets all scale-out instances of an 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 Name of the app. + * @param {string} name The name of the web app. * * @param {object} [options] Optional Parameters. * @@ -14904,14 +14685,13 @@ function _updateRelayServiceConnection(resourceGroupName, name, entityName, conn * {Error} 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. + * 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 _listInstanceIdentifiers(resourceGroupName, name, options, callback) { +function _listHybridConnections(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -14921,7 +14701,6 @@ function _listInstanceIdentifiers(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -14947,6 +14726,9 @@ function _listInstanceIdentifiers(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -14956,12 +14738,12 @@ function _listInstanceIdentifiers(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -15003,12 +14785,13 @@ function _listInstanceIdentifiers(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -15028,7 +14811,7 @@ function _listInstanceIdentifiers(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebAppInstanceCollection']().mapper(); + let resultMapper = new client.models['HybridConnection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -15044,16 +14827,16 @@ function _listInstanceIdentifiers(resourceGroupName, name, options, callback) { } /** - * @summary Get the status of the last MSDeploy operation. + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). * - * Get the status of the last MSDeploy operation. + * 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 web app. - * - * @param {string} instanceId ID of web app instance. + * @param {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -15067,13 +14850,14 @@ function _listInstanceIdentifiers(resourceGroupName, name, 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 MSDeployStatus} for more information. + * 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 _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options, callback) { +function _listRelayServiceConnections(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -15083,7 +14867,6 @@ function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -15106,12 +14889,12 @@ function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options if (name === 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.'); } @@ -15121,13 +14904,12 @@ function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options // 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'; + 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('{instanceId}', encodeURIComponent(instanceId)); 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('&'); } @@ -15169,12 +14951,13 @@ function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -15194,7 +14977,7 @@ function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MSDeployStatus']().mapper(); + let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -15209,128 +14992,17 @@ function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options }); } - /** - * @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. + * @summary Gets a hybrid connection configuration by its name. * - * Get the MSDeploy Log for the last MSDeploy operation. + * 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 web app. + * @param {string} name Name of the app. * - * @param {string} instanceId ID of web app instance. + * @param {string} entityName Name of the hybrid connection. * * @param {object} [options] Optional Parameters. * @@ -15344,13 +15016,14 @@ function _createInstanceMSDeployOperation(resourceGroupName, name, instanceId, m * {Error} 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. + * 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 _getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, callback) { +function _getRelayServiceConnection(resourceGroupName, name, entityName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -15360,7 +15033,6 @@ function _getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -15383,12 +15055,15 @@ function _getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, c if (name === 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 (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.'); } @@ -15398,13 +15073,13 @@ function _getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, c // 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'; + 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('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); 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('&'); } @@ -15436,7 +15111,7 @@ function _getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, c return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -15446,12 +15121,13 @@ function _getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, c try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -15471,7 +15147,7 @@ function _getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, c parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MSDeployLog']().mapper(); + let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -15487,20 +15163,37 @@ function _getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, c } /** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. + * 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 Site name. + * @param {string} name Name of the app. * - * @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 {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. * @@ -15514,13 +15207,14 @@ function _getInstanceMSDeployLog(resourceGroupName, name, 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 ProcessInfoCollection} for more information. + * 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 _listInstanceProcesses(resourceGroupName, name, instanceId, options, callback) { +function _createOrUpdateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -15530,7 +15224,6 @@ function _listInstanceProcesses(resourceGroupName, name, instanceId, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -15553,12 +15246,18 @@ function _listInstanceProcesses(resourceGroupName, name, instanceId, options, ca if (name === 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 (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.'); } @@ -15568,20 +15267,20 @@ function _listInstanceProcesses(resourceGroupName, name, instanceId, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes'; + 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('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -15599,14 +15298,28 @@ function _listInstanceProcesses(resourceGroupName, name, instanceId, options, ca } } } - httpRequest.body = null; + // 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 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -15616,12 +15329,13 @@ function _listInstanceProcesses(resourceGroupName, name, instanceId, options, ca try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -15641,7 +15355,7 @@ function _listInstanceProcesses(resourceGroupName, name, instanceId, options, ca parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfoCollection']().mapper(); + let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -15657,22 +15371,16 @@ function _listInstanceProcesses(resourceGroupName, name, instanceId, options, ca } /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. + * @summary Deletes a relay service connection by its name. * - * Get process information by its ID for a specific scaled-out instance in a - * web site. + * Deletes a relay service connection by its name. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. - * - * @param {string} processId PID. + * @param {string} name Name of the app. * - * @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 {string} entityName Name of the hybrid connection configuration. * * @param {object} [options] Optional Parameters. * @@ -15685,14 +15393,13 @@ function _listInstanceProcesses(resourceGroupName, name, instanceId, 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 ProcessInfo} 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 _getInstanceProcess(resourceGroupName, name, processId, instanceId, options, callback) { +function _deleteRelayServiceConnection(resourceGroupName, name, entityName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -15702,7 +15409,6 @@ function _getInstanceProcess(resourceGroupName, name, processId, instanceId, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -15725,15 +15431,15 @@ function _getInstanceProcess(resourceGroupName, name, processId, instanceId, opt if (name === 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 (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.'); } @@ -15743,21 +15449,20 @@ function _getInstanceProcess(resourceGroupName, name, processId, instanceId, opt // 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}'; + 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('{processId}', encodeURIComponent(processId)); - requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -15810,45 +15515,43 @@ function _getInstanceProcess(resourceGroupName, name, processId, instanceId, opt // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). * - * Terminate a process by its ID for a web site, or a deployment slot, or - * specific scaled-out instance in a web site. + * 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 Site name. + * @param {string} name Name of the app. * - * @param {string} processId PID. + * @param {string} entityName Name of the hybrid connection configuration. * - * @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} 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. * @@ -15861,13 +15564,15 @@ function _getInstanceProcess(resourceGroupName, name, processId, instanceId, opt * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, options, callback) { +function _updateRelayServiceConnection(resourceGroupName, name, entityName, connectionEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -15877,7 +15582,6 @@ function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -15900,15 +15604,18 @@ function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, if (name === 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 (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 (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 (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.'); } @@ -15918,21 +15625,20 @@ function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, // 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}'; + 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('{processId}', encodeURIComponent(processId)); - requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); + requestUrl = requestUrl.replace('{entityName}', encodeURIComponent(entityName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -15950,14 +15656,28 @@ function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, } } } - httpRequest.body = null; + // 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 !== 204 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -15967,12 +15687,13 @@ function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -15985,28 +15706,37 @@ function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Get a memory dump of a process by its ID for a specific scaled-out - * instance in a web site. + * @summary Gets all scale-out instances of an app. * - * Get a memory dump of a process by its ID for a specific scaled-out instance - * in a web site. + * Gets all scale-out instances of an app. * * @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 {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -16020,12 +15750,14 @@ function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, * {Error} 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 _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, options, callback) { +function _listInstanceIdentifiers(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -16035,7 +15767,6 @@ function _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -16058,15 +15789,12 @@ function _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, if (name === 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.'); } @@ -16076,14 +15804,12 @@ function _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, // 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'; + 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('{processId}', encodeURIComponent(processId)); - requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); 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('&'); } @@ -16110,29 +15836,28 @@ function _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, } 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}`); + if (statusCode !== 200) { + let error = new Error(responseBody); 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); + parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -16142,30 +15867,42 @@ function _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, } return callback(error); } - // Create Result - let result = response; + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 List module information for a process by its ID for a specific - * scaled-out instance in a web site. + * @summary Get the status of the last MSDeploy operation. * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. + * Get the status of the last MSDeploy operation. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. - * - * @param {string} processId PID. + * @param {string} name Name of web app. * - * @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 {string} instanceId ID of web app instance. * * @param {object} [options] Optional Parameters. * @@ -16179,14 +15916,13 @@ function _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, * {Error} 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. + * 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 _listInstanceProcessModules(resourceGroupName, name, processId, instanceId, options, callback) { +function _getInstanceMsDeployStatus(resourceGroupName, name, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -16196,7 +15932,6 @@ function _listInstanceProcessModules(resourceGroupName, name, processId, instanc if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -16219,15 +15954,15 @@ function _listInstanceProcessModules(resourceGroupName, name, processId, instanc if (name === 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.'); } @@ -16237,14 +15972,13 @@ function _listInstanceProcessModules(resourceGroupName, name, processId, instanc // 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'; + 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('{processId}', encodeURIComponent(processId)); requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); 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('&'); } @@ -16276,7 +16010,7 @@ function _listInstanceProcessModules(resourceGroupName, name, processId, instanc return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -16286,12 +16020,13 @@ function _listInstanceProcessModules(resourceGroupName, name, processId, instanc try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -16311,7 +16046,7 @@ function _listInstanceProcessModules(resourceGroupName, name, processId, instanc parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); + let resultMapper = new client.models['MSDeployStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -16326,25 +16061,46 @@ function _listInstanceProcessModules(resourceGroupName, name, processId, instanc }); } + /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. + * @summary Invoke the MSDeploy web app extension. * - * Get process information by its ID for a specific scaled-out instance in a - * web site. + * Invoke the MSDeploy web app extension. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @param {string} name Name of web app. * - * @param {string} processId PID. + * @param {string} instanceId ID of web app instance. * - * @param {string} baseAddress Module base address. + * @param {object} mSDeploy Details of MSDeploy operation * - * @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 {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. * @@ -16358,142 +16114,50 @@ function _listInstanceProcessModules(resourceGroupName, name, processId, instanc * {Error} 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. + * 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 _getInstanceProcessModule(resourceGroupName, name, processId, baseAddress, instanceId, options, callback) { +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.'); } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + // Send request + this.beginCreateInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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); + 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; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { + + // Deserialize Response let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfo']().mapper(); + let resultMapper = new client.models['MSDeployStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -16502,29 +16166,23 @@ function _getInstanceProcessModule(resourceGroupName, name, processId, baseAddre deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } - } - return callback(null, result, httpRequest, response); + 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. + * @summary Get the MSDeploy Log for the last MSDeploy operation. * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. + * 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 Site name. - * - * @param {string} processId PID. + * @param {string} name Name of web app. * - * @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 {string} instanceId ID of web app instance. * * @param {object} [options] Optional Parameters. * @@ -16538,14 +16196,13 @@ function _getInstanceProcessModule(resourceGroupName, name, processId, baseAddre * {Error} 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. + * 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 _listInstanceProcessThreads(resourceGroupName, name, processId, instanceId, options, callback) { +function _getInstanceMSDeployLog(resourceGroupName, name, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -16555,7 +16212,6 @@ function _listInstanceProcessThreads(resourceGroupName, name, processId, instanc if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -16578,15 +16234,15 @@ function _listInstanceProcessThreads(resourceGroupName, name, processId, instanc if (name === 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.'); } @@ -16596,14 +16252,13 @@ function _listInstanceProcessThreads(resourceGroupName, name, processId, instanc // 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'; + 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('{processId}', encodeURIComponent(processId)); requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); 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('&'); } @@ -16670,7 +16325,7 @@ function _listInstanceProcessThreads(resourceGroupName, name, processId, instanc parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); + let resultMapper = new client.models['MSDeployLog']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -16686,21 +16341,17 @@ function _listInstanceProcessThreads(resourceGroupName, name, processId, instanc } /** - * @summary Get thread information by Thread ID for a specific process, in a - * specific scaled-out instance in a web site. + * @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 thread information by Thread ID for a specific process, in 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} 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". @@ -16717,13 +16368,13 @@ function _listInstanceProcessThreads(resourceGroupName, name, processId, instanc * {Error} 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. + * 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 _getInstanceProcessThread(resourceGroupName, name, processId, threadId, instanceId, options, callback) { +function _listInstanceProcesses(resourceGroupName, name, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -16733,7 +16384,6 @@ function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -16756,18 +16406,15 @@ function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, if (name === 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.'); } @@ -16777,15 +16424,13 @@ function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, // 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}'; + 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('{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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -16852,7 +16497,7 @@ function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfo']().mapper(); + let resultMapper = new client.models['ProcessInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -16868,16 +16513,22 @@ function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, } /** - * @summary Shows whether an app can be cloned to another resource group or - * subscription. + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. * - * Shows whether an app can be cloned to another resource group or - * subscription. + * 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 Name of the app. + * @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. * @@ -16891,13 +16542,13 @@ function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, * {Error} 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. + * 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 _isCloneable(resourceGroupName, name, options, callback) { +function _getInstanceProcess(resourceGroupName, name, processId, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -16907,7 +16558,6 @@ function _isCloneable(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -16930,9 +16580,18 @@ function _isCloneable(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -16942,19 +16601,21 @@ function _isCloneable(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/iscloneable'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -16979,7 +16640,7 @@ function _isCloneable(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -17014,7 +16675,7 @@ function _isCloneable(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteCloneability']().mapper(); + let resultMapper = new client.models['ProcessInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -17030,14 +16691,22 @@ function _isCloneable(resourceGroupName, name, options, callback) { } /** - * @summary This is to allow calling via powershell and ARM template. + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. * - * This is to allow calling via powershell and ARM template. + * 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 Name of the app. + * @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. * @@ -17050,14 +16719,13 @@ function _isCloneable(resourceGroupName, name, 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 FunctionSecrets} 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 _listSyncFunctionTriggers(resourceGroupName, name, options, callback) { +function _deleteInstanceProcess(resourceGroupName, name, processId, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -17067,7 +16735,6 @@ function _listSyncFunctionTriggers(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -17090,9 +16757,18 @@ function _listSyncFunctionTriggers(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -17102,19 +16778,21 @@ function _listSyncFunctionTriggers(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listsyncfunctiontriggerstatus'; + 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(apiVersion)); + queryParameters.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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -17139,7 +16817,7 @@ function _listSyncFunctionTriggers(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 204 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -17167,38 +16845,28 @@ function _listSyncFunctionTriggers(resourceGroupName, name, 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['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). + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. * - * Gets all metric definitions of an app (or deployment slot, if specified). + * 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 Name of the app. + * @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. * @@ -17212,14 +16880,12 @@ function _listSyncFunctionTriggers(resourceGroupName, name, 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 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) { +function _getInstanceProcessDump(resourceGroupName, name, processId, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -17229,7 +16895,6 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -17252,9 +16917,18 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -17264,12 +16938,14 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/metricdefinitions'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -17296,20 +16972,22 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { } 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) { - let error = new Error(responseBody); + 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 { - parsedErrorResponse = JSON.parse(responseBody); + if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; @@ -17326,51 +17004,32 @@ function _listMetricDefinitions(resourceGroupName, name, options, callback) { } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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); - } - } + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } /** - * @summary Gets performance metrics of an app (or deployment slot, if - * specified). + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. * - * Gets performance metrics of an app (or deployment slot, if specified). + * 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 Name of the app. + * @param {string} name Site name. * - * @param {object} [options] Optional Parameters. + * @param {string} processId PID. * - * @param {boolean} [options.details] Specify "true" to include metric details - * in the response. It is "false" by default. + * @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 {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] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -17382,14 +17041,14 @@ function _listMetricDefinitions(resourceGroupName, name, 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 ResourceMetricCollection} for more + * 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 _listMetrics(resourceGroupName, name, options, callback) { +function _listInstanceProcessModules(resourceGroupName, name, processId, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -17399,9 +17058,6 @@ function _listMetrics(resourceGroupName, name, options, callback) { 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; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -17424,15 +17080,18 @@ function _listMetrics(resourceGroupName, name, options, callback) { if (name === 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 (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 (filter !== null && filter !== undefined && typeof filter.valueOf() !== 'string') { - throw new Error('filter 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.'); } @@ -17442,18 +17101,14 @@ function _listMetrics(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/metrics'; + 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 = []; - 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -17485,7 +17140,7 @@ function _listMetrics(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -17520,7 +17175,7 @@ function _listMetrics(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricCollection']().mapper(); + let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -17535,211 +17190,25 @@ function _listMetrics(resourceGroupName, name, options, callback) { }); } - -/** - * @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. + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. * - * Migrates a local (in-app) MySql database to a remote MySql database. + * 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 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 + * @param {string} name Site name. * - * Returns the status of MySql in app migration, if one is active, and whether - * or not MySql in app is enabled + * @param {string} processId PID. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {string} baseAddress Module base address. * - * @param {string} name Name of web app. + * @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. * @@ -17753,13 +17222,13 @@ function _migrateMySql(resourceGroupName, name, migrationRequestEnvelope, 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 MigrateMySqlStatus} for more information. + * 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 _getMigrateMySqlStatus(resourceGroupName, name, options, callback) { +function _getInstanceProcessModule(resourceGroupName, name, processId, baseAddress, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -17769,7 +17238,6 @@ function _getMigrateMySqlStatus(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -17792,9 +17260,21 @@ function _getMigrateMySqlStatus(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -17804,12 +17284,15 @@ function _getMigrateMySqlStatus(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -17841,7 +17324,7 @@ function _getMigrateMySqlStatus(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -17876,7 +17359,7 @@ function _getMigrateMySqlStatus(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MigrateMySqlStatus']().mapper(); + let resultMapper = new client.models['ProcessModuleInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -17892,19 +17375,22 @@ function _getMigrateMySqlStatus(resourceGroupName, name, options, callback) { } /** - * @summary Gets all network features used by the app (or deployment slot, if - * specified). + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. * - * Gets all network features used by the app (or deployment slot, if - * specified). + * 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 Name of the app. + * @param {string} name Site name. * - * @param {string} view The type of view. This can either be "summary" or - * "detailed". + * @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. * @@ -17918,13 +17404,14 @@ function _getMigrateMySqlStatus(resourceGroupName, name, 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 NetworkFeatures} for more information. + * 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 _listNetworkFeatures(resourceGroupName, name, view, options, callback) { +function _listInstanceProcessThreads(resourceGroupName, name, processId, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -17934,7 +17421,6 @@ function _listNetworkFeatures(resourceGroupName, name, view, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -17957,12 +17443,18 @@ function _listNetworkFeatures(resourceGroupName, name, view, options, callback) if (name === 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 (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.'); } @@ -17972,13 +17464,14 @@ function _listNetworkFeatures(resourceGroupName, name, view, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}'; + 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('{view}', encodeURIComponent(view)); + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -18045,7 +17538,7 @@ function _listNetworkFeatures(resourceGroupName, name, view, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['NetworkFeatures']().mapper(); + let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -18061,24 +17554,26 @@ function _listNetworkFeatures(resourceGroupName, name, view, options, callback) } /** - * @summary Start capturing network packets for the site. + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. * - * Start capturing network packets for the 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 The name of the web app. + * @param {string} name Site name. * - * @param {object} [options] Optional Parameters. + * @param {string} processId PID. * - * @param {number} [options.durationInSeconds] The duration to keep capturing - * in seconds. + * @param {string} threadId TID. * - * @param {number} [options.maxFrameLength] The maximum frame length in bytes - * (Optional). + * @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 {string} [options.sasUrl] The Blob URL to store capture file. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -18089,13 +17584,14 @@ function _listNetworkFeatures(resourceGroupName, name, view, options, callback) * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [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 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 _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { +function _getInstanceProcessThread(resourceGroupName, name, processId, threadId, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -18105,10 +17601,6 @@ function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { 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; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -18131,18 +17623,21 @@ function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { if (name === 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 (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 (maxFrameLength !== null && maxFrameLength !== undefined && typeof maxFrameLength !== 'number') { - throw new Error('maxFrameLength must be of type number.'); + 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 (sasUrl !== null && sasUrl !== undefined && typeof sasUrl.valueOf() !== 'string') { - throw new Error('sasUrl 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.'); } @@ -18152,28 +17647,22 @@ function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/start'; + 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 = []; - 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -18198,7 +17687,7 @@ function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -18233,13 +17722,7 @@ function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; + let resultMapper = new client.models['ProcessThreadInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -18255,14 +17738,16 @@ function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { } /** - * @summary Stop ongoing capturing network packets for the site. + * @summary Shows whether an app can be cloned to another resource group or + * subscription. * - * Stop ongoing capturing network packets for the site. + * 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 The name of the web app. + * @param {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -18275,13 +17760,14 @@ function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [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 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 _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { +function _isCloneable(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -18291,7 +17777,6 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -18317,6 +17802,9 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -18326,12 +17814,12 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/stop'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -18373,12 +17861,13 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -18398,13 +17887,7 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; + let resultMapper = new client.models['SiteCloneability']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -18420,11 +17903,9 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { } /** - * @summary Generates a new publishing password for an app (or deployment slot, - * if specified). + * @summary This is to allow calling via powershell and ARM template. * - * Generates a new publishing password for an app (or deployment slot, if - * specified). + * This is to allow calling via powershell and ARM template. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -18442,162 +17923,14 @@ function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let 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. + * 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 _listPerfMonCounters(resourceGroupName, name, options, callback) { +function _listSyncFunctionTriggers(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -18607,8 +17940,6 @@ function _listPerfMonCounters(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -18631,12 +17962,12 @@ function _listPerfMonCounters(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -18646,22 +17977,19 @@ function _listPerfMonCounters(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/perfcounters'; + 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 = []; - 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -18696,12 +18024,13 @@ function _listPerfMonCounters(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -18721,7 +18050,7 @@ function _listPerfMonCounters(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PerfMonCounterCollection']().mapper(); + let resultMapper = new client.models['FunctionSecrets']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -18737,14 +18066,15 @@ function _listPerfMonCounters(resourceGroupName, name, options, callback) { } /** - * @summary Gets web app's event logs. + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). * - * Gets web app's event logs. + * 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 web app. + * @param {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -18758,13 +18088,14 @@ function _listPerfMonCounters(resourceGroupName, name, 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 SitePhpErrorLogFlag} for more information. + * 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 _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { +function _listMetricDefinitions(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -18774,7 +18105,6 @@ function _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -18800,6 +18130,9 @@ function _getSitePhpErrorLogFlag(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -18809,12 +18142,12 @@ function _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -18856,12 +18189,13 @@ function _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -18881,7 +18215,7 @@ function _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SitePhpErrorLogFlag']().mapper(); + let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -18897,9 +18231,10 @@ function _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { } /** - * @summary Gets the premier add-ons of an app. + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). * - * Gets the premier add-ons of an app. + * Gets performance metrics of an app (or deployment slot, if specified). * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -18908,6 +18243,14 @@ function _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { * * @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 * @@ -18918,13 +18261,14 @@ function _getSitePhpErrorLogFlag(resourceGroupName, name, 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 PremierAddOn} for more information. + * 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 _listPremierAddOns(resourceGroupName, name, options, callback) { +function _listMetrics(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -18934,7 +18278,8 @@ function _listPremierAddOns(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; + 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') { @@ -18957,9 +18302,18 @@ function _listPremierAddOns(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -18969,12 +18323,18 @@ function _listPremierAddOns(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons'; + 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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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('&'); } @@ -19016,12 +18376,13 @@ function _listPremierAddOns(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -19041,7 +18402,7 @@ function _listPremierAddOns(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PremierAddOn']().mapper(); + let resultMapper = new client.models['ResourceMetricCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -19056,17 +18417,35 @@ function _listPremierAddOns(resourceGroupName, name, options, callback) { }); } + /** - * @summary Gets a named add-on of an app. + * @summary Restores a web app. * - * Gets a named add-on of an 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 the app. + * @param {string} name Name of web app. * - * @param {string} premierAddOnName Add-on name. + * @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. * @@ -19080,134 +18459,51 @@ function _listPremierAddOns(resourceGroupName, name, 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 PremierAddOn} for more information. + * 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 _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, callback) { +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.'); } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + // Send request + this.beginMigrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); + 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; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { + + // Deserialize Response let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PremierAddOn']().mapper(); + let resultMapper = new client.models['StorageMigrationResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -19216,50 +18512,116 @@ function _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, ca deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } - } - return callback(null, result, httpRequest, response); + return callback(null, result, httpRequest, response); + }); }); } + /** - * @summary Updates a named add-on of an app. + * @summary Migrates a local (in-app) MySql database to a remote MySql + * database. * - * Updates a named add-on of an app. + * 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 the app. + * @param {string} name Name of web app. * - * @param {string} premierAddOnName Add-on name. + * @param {object} migrationRequestEnvelope MySql migration options. * - * @param {object} premierAddOn A JSON representation of the edited premier - * add-on. + * @param {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. * - * @param {string} [premierAddOn.sku] Premier add on SKU. + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' * - * @param {string} [premierAddOn.product] Premier add on Product. + * @param {string} [migrationRequestEnvelope.kind] Kind of resource. * - * @param {string} [premierAddOn.vendor] Premier add on Vendor. + * @param {object} [options] Optional Parameters. * - * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. + * @param {function} callback - The callback. * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. + * @returns {function} callback(err, result, request, response) * - * @param {string} [premierAddOn.marketplacePublisher] Premier add on - * Marketplace publisher. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {string} [premierAddOn.marketplaceOffer] Premier add on Marketplace - * offer. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Operation} for more information. * - * @param {string} [premierAddOn.kind] Kind of resource. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {string} premierAddOn.location Resource Location. + * {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 * - * @param {object} [premierAddOn.tags] Resource tags. + * 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. * @@ -19273,13 +18635,13 @@ function _getPremierAddOn(resourceGroupName, name, premierAddOnName, 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 PremierAddOn} for more information. + * 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 _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, callback) { +function _getMigrateMySqlStatus(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -19289,7 +18651,6 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -19312,15 +18673,12 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO if (name === 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.'); } @@ -19330,20 +18688,19 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'; + 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('{premierAddOnName}', encodeURIComponent(premierAddOnName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -19361,21 +18718,7 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -19392,12 +18735,13 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -19417,7 +18761,7 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PremierAddOn']().mapper(); + let resultMapper = new client.models['MigrateMySqlStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -19433,16 +18777,19 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO } /** - * @summary Delete a premier add-on from an app. + * @summary Gets all network features used by the app (or deployment slot, if + * specified). * - * Delete a premier add-on from an app. + * 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} premierAddOnName Add-on name. + * @param {string} view The type of view. This can either be "summary" or + * "detailed". * * @param {object} [options] Optional Parameters. * @@ -19455,13 +18802,14 @@ function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddO * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, callback) { +function _listNetworkFeatures(resourceGroupName, name, view, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -19471,7 +18819,6 @@ function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -19494,12 +18841,15 @@ function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, if (name === 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 (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.'); } @@ -19509,20 +18859,20 @@ function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}'; + 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('{premierAddOnName}', encodeURIComponent(premierAddOnName)); + requestUrl = requestUrl.replace('{view}', encodeURIComponent(view)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -19547,7 +18897,7 @@ function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -19575,25 +18925,48 @@ function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, 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['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 Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. + * @summary Start capturing network packets for the site. * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. + * Start capturing network packets for the site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @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 * @@ -19603,14 +18976,13 @@ function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, 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 ProcessInfoCollection} for more information. + * {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 _listProcesses(resourceGroupName, name, options, callback) { +function _startWebSiteNetworkTrace(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -19620,7 +18992,9 @@ function _listProcesses(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; + 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') { @@ -19643,9 +19017,21 @@ function _listProcesses(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -19655,19 +19041,28 @@ function _listProcesses(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes'; + 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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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 = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -19692,7 +19087,7 @@ function _listProcesses(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -19702,12 +19097,13 @@ function _listProcesses(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -19727,7 +19123,13 @@ function _listProcesses(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfoCollection']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -19743,18 +19145,14 @@ function _listProcesses(resourceGroupName, name, options, callback) { } /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. + * @summary Stop ongoing capturing network packets for the site. * - * Get process information by its ID for a specific scaled-out instance in a - * web 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 Site name. - * - * @param {string} processId PID. + * @param {string} name The name of the web app. * * @param {object} [options] Optional Parameters. * @@ -19767,14 +19165,13 @@ function _listProcesses(resourceGroupName, name, 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 ProcessInfo} for more information. + * {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 _getProcess(resourceGroupName, name, processId, options, callback) { +function _stopWebSiteNetworkTrace(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -19784,7 +19181,6 @@ function _getProcess(resourceGroupName, name, processId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -19807,12 +19203,12 @@ function _getProcess(resourceGroupName, name, processId, options, callback) { if (name === 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.'); } @@ -19822,20 +19218,19 @@ function _getProcess(resourceGroupName, name, processId, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'; + 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('{processId}', encodeURIComponent(processId)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -19860,7 +19255,7 @@ function _getProcess(resourceGroupName, name, processId, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -19870,12 +19265,13 @@ function _getProcess(resourceGroupName, name, processId, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -19895,7 +19291,13 @@ function _getProcess(resourceGroupName, name, processId, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfo']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -19911,18 +19313,16 @@ function _getProcess(resourceGroupName, name, processId, options, callback) { } /** - * @summary Terminate a process by its ID for a web site, or a deployment slot, - * or specific scaled-out instance in a web site. + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). * - * Terminate a process by its ID for a web site, or a deployment slot, or - * specific scaled-out instance in a web site. + * 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 Site name. - * - * @param {string} processId PID. + * @param {string} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -19941,7 +19341,7 @@ function _getProcess(resourceGroupName, name, processId, options, callback) { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteProcess(resourceGroupName, name, processId, options, callback) { +function _generateNewSitePublishingPassword(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -19951,7 +19351,6 @@ function _deleteProcess(resourceGroupName, name, processId, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -19974,12 +19373,12 @@ function _deleteProcess(resourceGroupName, name, processId, options, callback) { if (name === 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.'); } @@ -19989,20 +19388,19 @@ function _deleteProcess(resourceGroupName, name, processId, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}'; + 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('{processId}', encodeURIComponent(processId)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -20027,7 +19425,7 @@ function _deleteProcess(resourceGroupName, name, processId, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -20061,21 +19459,22 @@ function _deleteProcess(resourceGroupName, name, processId, options, callback) { } /** - * @summary Get a memory dump of a process by its ID for a specific scaled-out - * instance in a web site. + * @summary Gets perfmon counters for web app. * - * Get a memory dump of a process by its ID for a specific scaled-out instance - * in a web site. + * Gets perfmon counters for web app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. - * - * @param {string} processId PID. + * @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 * @@ -20086,12 +19485,14 @@ function _deleteProcess(resourceGroupName, name, processId, 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 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 _getProcessDump(resourceGroupName, name, processId, options, callback) { +function _listPerfMonCounters(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20101,7 +19502,7 @@ function _getProcessDump(resourceGroupName, name, processId, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; + let filter = (options && options.filter !== undefined) ? options.filter : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -20124,12 +19525,15 @@ function _getProcessDump(resourceGroupName, name, processId, options, callback) if (name === 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 (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.'); } @@ -20139,13 +19543,15 @@ function _getProcessDump(resourceGroupName, name, processId, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/dump'; + 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('{processId}', encodeURIComponent(processId)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (filter !== null && filter !== undefined) { + queryParameters.push('$filter=' + filter); + } + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -20172,29 +19578,28 @@ function _getProcessDump(resourceGroupName, name, processId, options, callback) } 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}`); + if (statusCode !== 200) { + let error = new Error(responseBody); 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); + parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -20204,26 +19609,40 @@ function _getProcessDump(resourceGroupName, name, processId, options, callback) } return callback(error); } - // Create Result - let result = response; + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 List module information for a process by its ID for a specific - * scaled-out instance in a web site. + * @summary Gets web app's event logs. * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. + * Gets web app's event logs. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. - * - * @param {string} processId PID. + * @param {string} name Name of web app. * * @param {object} [options] Optional Parameters. * @@ -20237,14 +19656,13 @@ function _getProcessDump(resourceGroupName, name, processId, 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 ProcessModuleInfoCollection} for more - * information. + * 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 _listProcessModules(resourceGroupName, name, processId, options, callback) { +function _getSitePhpErrorLogFlag(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20254,7 +19672,6 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -20277,12 +19694,12 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba if (name === 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.'); } @@ -20292,13 +19709,12 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules'; + 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('{processId}', encodeURIComponent(processId)); 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('&'); } @@ -20330,7 +19746,7 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -20340,12 +19756,13 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -20365,7 +19782,7 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); + let resultMapper = new client.models['SitePhpErrorLogFlag']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -20381,20 +19798,14 @@ function _listProcessModules(resourceGroupName, name, processId, options, callba } /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. + * @summary Gets the premier add-ons of an app. * - * Get process information by its ID for a specific scaled-out instance in a - * web site. + * Gets the premier add-ons of an app. * * @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} name Name of the app. * * @param {object} [options] Optional Parameters. * @@ -20408,13 +19819,13 @@ function _listProcessModules(resourceGroupName, name, processId, 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 ProcessModuleInfo} for more information. + * 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 _getProcessModule(resourceGroupName, name, processId, baseAddress, options, callback) { +function _listPremierAddOns(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20424,7 +19835,6 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -20447,15 +19857,12 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, opti if (name === 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.'); } @@ -20465,14 +19872,12 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, opti // 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}'; + 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('{processId}', encodeURIComponent(processId)); - requestUrl = requestUrl.replace('{baseAddress}', encodeURIComponent(baseAddress)); 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('&'); } @@ -20504,7 +19909,7 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, opti return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -20514,12 +19919,13 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, opti try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -20539,7 +19945,7 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, opti parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfo']().mapper(); + let resultMapper = new client.models['PremierAddOn']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -20555,18 +19961,16 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, opti } /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. + * @summary Gets a named add-on of an app. * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. + * Gets a named add-on of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @param {string} name Name of the app. * - * @param {string} processId PID. + * @param {string} premierAddOnName Add-on name. * * @param {object} [options] Optional Parameters. * @@ -20580,14 +19984,13 @@ function _getProcessModule(resourceGroupName, name, processId, baseAddress, 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 ProcessThreadInfoCollection} for more - * information. + * 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 _listProcessThreads(resourceGroupName, name, processId, options, callback) { +function _getPremierAddOn(resourceGroupName, name, premierAddOnName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20597,7 +20000,6 @@ function _listProcessThreads(resourceGroupName, name, processId, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -20620,12 +20022,15 @@ function _listProcessThreads(resourceGroupName, name, processId, options, callba if (name === 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 (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.'); } @@ -20635,13 +20040,13 @@ function _listProcessThreads(resourceGroupName, name, processId, options, callba // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads'; + 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('{processId}', encodeURIComponent(processId)); + requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); 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('&'); } @@ -20673,7 +20078,7 @@ function _listProcessThreads(resourceGroupName, name, processId, options, callba return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -20683,12 +20088,13 @@ function _listProcessThreads(resourceGroupName, name, processId, options, callba try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -20708,7 +20114,7 @@ function _listProcessThreads(resourceGroupName, name, processId, options, callba parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); + let resultMapper = new client.models['PremierAddOn']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -20724,20 +20130,37 @@ function _listProcessThreads(resourceGroupName, name, processId, options, callba } /** - * @summary Get thread information by Thread ID for a specific process, in a - * specific scaled-out instance in a web site. + * @summary Updates a named add-on of an app. * - * Get thread information by Thread ID for a specific process, in a specific - * scaled-out instance in a web site. + * Updates a named add-on of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Site name. + * @param {string} name Name of the app. * - * @param {string} processId PID. + * @param {string} premierAddOnName Add-on name. * - * @param {string} threadId TID. + * @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. * @@ -20751,13 +20174,13 @@ function _listProcessThreads(resourceGroupName, name, processId, 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 ProcessThreadInfo} for more information. + * 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 _getProcessThread(resourceGroupName, name, processId, threadId, options, callback) { +function _addPremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20767,7 +20190,6 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -20790,15 +20212,18 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, options if (name === 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 (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 (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 (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.'); } @@ -20808,21 +20233,20 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, options // 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}'; + 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('{processId}', encodeURIComponent(processId)); - requestUrl = requestUrl.replace('{threadId}', encodeURIComponent(threadId)); + requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -20840,14 +20264,28 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, options } } } - httpRequest.body = null; + // 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 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -20857,12 +20295,13 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, options try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -20882,7 +20321,7 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, options parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfo']().mapper(); + let resultMapper = new client.models['PremierAddOn']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -20898,15 +20337,17 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, options } /** - * @summary Get public certificates for an app or a deployment slot. + * @summary Delete a premier add-on from an app. * - * Get public certificates for an app or a deployment slot. + * 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 @@ -20918,15 +20359,13 @@ function _getProcessThread(resourceGroupName, name, processId, threadId, 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 PublicCertificateCollection} 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 _listPublicCertificates(resourceGroupName, name, options, callback) { +function _deletePremierAddOn(resourceGroupName, name, premierAddOnName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -20936,7 +20375,6 @@ function _listPublicCertificates(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -20959,9 +20397,15 @@ function _listPublicCertificates(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -20971,19 +20415,20 @@ function _listPublicCertificates(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates'; + 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(apiVersion)); + queryParameters.push('api-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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -21036,41 +20481,39 @@ function _listPublicCertificates(resourceGroupName, name, 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['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). + * @summary Updates a named add-on of an app. * - * Get the named public certificate for an app (or deployment slot, if - * specified). + * 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} publicCertificateName Public certificate name. + * @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. * @@ -21084,13 +20527,13 @@ function _listPublicCertificates(resourceGroupName, name, 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 PublicCertificate} for more information. + * 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 _getPublicCertificate(resourceGroupName, name, publicCertificateName, options, callback) { +function _updatePremierAddOn(resourceGroupName, name, premierAddOnName, premierAddOn, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21100,7 +20543,6 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -21123,12 +20565,18 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o if (name === 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 (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.'); } @@ -21138,20 +20586,20 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'; + 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('{publicCertificateName}', encodeURIComponent(publicCertificateName)); + requestUrl = requestUrl.replace('{premierAddOnName}', encodeURIComponent(premierAddOnName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -21169,7 +20617,21 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o } } } - httpRequest.body = null; + // 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) { @@ -21186,12 +20648,13 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -21211,7 +20674,7 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PublicCertificate']().mapper(); + let resultMapper = new client.models['PremierAddOn']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -21227,27 +20690,16 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, o } /** - * @summary Creates a hostname binding for an app. + * @summary Gets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Creates a hostname binding for an app. + * 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 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} name The name of the web app. * * @param {object} [options] Optional Parameters. * @@ -21261,13 +20713,13 @@ function _getPublicCertificate(resourceGroupName, name, publicCertificateName, 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 PublicCertificate} for more information. + * 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 _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertificateName, publicCertificate, options, callback) { +function _getPrivateAccess(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21277,7 +20729,6 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -21300,15 +20751,12 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi if (name === 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.'); } @@ -21318,20 +20766,19 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'; + 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('{publicCertificateName}', encodeURIComponent(publicCertificateName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -21349,21 +20796,7 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -21380,12 +20813,13 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -21405,7 +20839,7 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PublicCertificate']().mapper(); + let resultMapper = new client.models['PrivateAccess']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -21421,16 +20855,25 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi } /** - * @summary Deletes a hostname binding for an app. + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Deletes a hostname binding for an app. + * 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 Name of the app. + * @param {string} name The name of the web app. * - * @param {string} publicCertificateName Public certificate name. + * @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. * @@ -21443,13 +20886,14 @@ function _createOrUpdatePublicCertificate(resourceGroupName, name, publicCertifi * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deletePublicCertificate(resourceGroupName, name, publicCertificateName, options, callback) { +function _putPrivateAccessVnet(resourceGroupName, name, access, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21459,7 +20903,6 @@ function _deletePublicCertificate(resourceGroupName, name, publicCertificateName if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -21482,12 +20925,15 @@ function _deletePublicCertificate(resourceGroupName, name, publicCertificateName if (name === 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 (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.'); } @@ -21497,20 +20943,19 @@ function _deletePublicCertificate(resourceGroupName, name, publicCertificateName // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}'; + 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('{publicCertificateName}', encodeURIComponent(publicCertificateName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -21528,14 +20973,28 @@ function _deletePublicCertificate(resourceGroupName, name, publicCertificateName } } } - httpRequest.body = null; + // 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 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -21545,12 +21004,13 @@ function _deletePublicCertificate(resourceGroupName, name, publicCertificateName try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -21563,29 +21023,42 @@ function _deletePublicCertificate(resourceGroupName, name, publicCertificateName // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Gets the publishing profile for an app (or deployment slot, if - * specified). + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. * - * Gets the publishing profile for an app (or deployment slot, if specified). + * 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 Name of the app. + * @param {string} name Site name. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.format] Name of the format. Valid values are: - * FileZilla3 - * WebDeploy -- default - * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -21596,12 +21069,13 @@ function _deletePublicCertificate(resourceGroupName, name, publicCertificateName * {Error} 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 _listPublishingProfileXmlWithSecrets(resourceGroupName, name, options, callback) { +function _listProcesses(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21611,8 +21085,6 @@ function _listPublishingProfileXmlWithSecrets(resourceGroupName, name, options, if (!callback) { throw new Error('callback cannot be null.'); } - let format = (options && options.format !== undefined) ? options.format : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -21638,8 +21110,8 @@ function _listPublishingProfileXmlWithSecrets(resourceGroupName, name, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } - if (format !== null && format !== undefined && typeof format.valueOf() !== 'string') { - throw new Error('format must be of type string.'); + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -21647,27 +21119,22 @@ function _listPublishingProfileXmlWithSecrets(resourceGroupName, name, options, } catch (error) { return callback(error); } - let publishingProfileOptions; - if (format !== null && format !== undefined) { - publishingProfileOptions = new client.models['CsmPublishingProfileOptions'](); - publishingProfileOptions.format = format; - } // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -21685,38 +21152,22 @@ function _listPublishingProfileXmlWithSecrets(resourceGroupName, name, options, } } } - // 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; + 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) { - let error = new Error(`Unexpected status code: ${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 { - if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); + parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; @@ -21733,122 +21184,44 @@ function _listPublishingProfileXmlWithSecrets(resourceGroupName, name, options, } return callback(error); } - // Create Result - let result = response; + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Recovers a web app to a previous snapshot. + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. * - * Recovers a web app to a previous snapshot. + * 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 Name of web app. - * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. - * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. - * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS - * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. - * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. - * - * @param {boolean} [recoveryEntity.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} [recoveryEntity.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 _recover(resourceGroupName, name, recoveryEntity, options, callback) { - /* jshint 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.beginRecover(resourceGroupName, name, recoveryEntity, 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 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 Site name. * - * @param {string} name Name of the app. + * @param {string} processId PID. * * @param {object} [options] Optional Parameters. * @@ -21861,13 +21234,14 @@ function _recover(resourceGroupName, name, recoveryEntity, options, callback) { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _resetProductionSlotConfig(resourceGroupName, name, options, callback) { +function _getProcess(resourceGroupName, name, processId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -21877,7 +21251,6 @@ function _resetProductionSlotConfig(resourceGroupName, name, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -21900,9 +21273,15 @@ function _resetProductionSlotConfig(resourceGroupName, name, options, callback) if (name === 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.'); } @@ -21912,19 +21291,20 @@ function _resetProductionSlotConfig(resourceGroupName, name, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resetSlotConfig'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -21949,7 +21329,7 @@ function _resetProductionSlotConfig(resourceGroupName, name, options, callback) return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -21977,30 +21357,43 @@ function _resetProductionSlotConfig(resourceGroupName, name, 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['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 Restarts an app (or deployment slot, if specified). + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. * - * Restarts an app (or deployment slot, if specified). + * 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 Name of the app. - * - * @param {object} [options] Optional Parameters. + * @param {string} name Site name. * - * @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 {string} processId PID. * - * @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] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -22017,7 +21410,7 @@ function _resetProductionSlotConfig(resourceGroupName, name, options, callback) * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _restart(resourceGroupName, name, options, callback) { +function _deleteProcess(resourceGroupName, name, processId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22027,9 +21420,6 @@ function _restart(resourceGroupName, name, options, callback) { 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; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -22052,15 +21442,15 @@ function _restart(resourceGroupName, name, options, callback) { if (name === 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 (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.'); } @@ -22070,25 +21460,20 @@ function _restart(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restart'; + 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 = []; - 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(apiVersion)); + queryParameters.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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -22113,7 +21498,7 @@ function _restart(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 204 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -22147,15 +21532,19 @@ function _restart(resourceGroupName, name, options, callback) { } /** - * @summary Get list of siteextensions for a web site, or a deployment slot. + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. * - * Get list of siteextensions for a web site, or a deployment slot. + * 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 @@ -22168,14 +21557,12 @@ function _restart(resourceGroupName, name, 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 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) { +function _getProcessDump(resourceGroupName, name, processId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22185,7 +21572,6 @@ function _listSiteExtensions(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -22208,9 +21594,15 @@ function _listSiteExtensions(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -22220,12 +21612,13 @@ function _listSiteExtensions(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -22252,20 +21645,22 @@ function _listSiteExtensions(resourceGroupName, name, options, callback) { } 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(responseBody); + 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 { - parsedErrorResponse = JSON.parse(responseBody); + if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; @@ -22282,44 +21677,26 @@ function _listSiteExtensions(resourceGroupName, name, options, callback) { } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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); - } - } + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } /** - * @summary Get site extension information by its ID for a web site, or a - * deployment slot. + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. * - * Get site extension information by its ID for a web site, or a deployment - * slot. + * 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} siteExtensionId Site extension name. + * @param {string} processId PID. * * @param {object} [options] Optional Parameters. * @@ -22333,13 +21710,14 @@ function _listSiteExtensions(resourceGroupName, name, 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 SiteExtensionInfo} for more information. + * 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 _getSiteExtension(resourceGroupName, name, siteExtensionId, options, callback) { +function _listProcessModules(resourceGroupName, name, processId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22349,7 +21727,6 @@ function _getSiteExtension(resourceGroupName, name, siteExtensionId, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -22372,12 +21749,15 @@ function _getSiteExtension(resourceGroupName, name, siteExtensionId, options, ca if (name === 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 (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.'); } @@ -22387,13 +21767,13 @@ function _getSiteExtension(resourceGroupName, name, siteExtensionId, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'; + 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('{siteExtensionId}', encodeURIComponent(siteExtensionId)); + requestUrl = requestUrl.replace('{processId}', encodeURIComponent(processId)); 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('&'); } @@ -22460,7 +21840,7 @@ function _getSiteExtension(resourceGroupName, name, siteExtensionId, options, ca parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteExtensionInfo']().mapper(); + let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -22475,100 +21855,21 @@ function _getSiteExtension(resourceGroupName, name, siteExtensionId, options, ca }); } - /** - * @summary Install site extension on a web site, or a deployment slot. + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. * - * Install site extension on a web site, or a deployment slot. + * 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} 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} processId PID. * - * @param {string} siteExtensionId Site extension name. + * @param {string} baseAddress Module base address. * * @param {object} [options] Optional Parameters. * @@ -22581,13 +21882,14 @@ function _installSiteExtension(resourceGroupName, name, siteExtensionId, options * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteSiteExtension(resourceGroupName, name, siteExtensionId, options, callback) { +function _getProcessModule(resourceGroupName, name, processId, baseAddress, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22597,7 +21899,6 @@ function _deleteSiteExtension(resourceGroupName, name, siteExtensionId, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -22620,12 +21921,18 @@ function _deleteSiteExtension(resourceGroupName, name, siteExtensionId, options, if (name === 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 (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.'); } @@ -22635,20 +21942,21 @@ function _deleteSiteExtension(resourceGroupName, name, siteExtensionId, options, // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}'; + 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('{siteExtensionId}', encodeURIComponent(siteExtensionId)); + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -22673,7 +21981,7 @@ function _deleteSiteExtension(resourceGroupName, name, siteExtensionId, options, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -22701,20 +22009,41 @@ function _deleteSiteExtension(resourceGroupName, name, siteExtensionId, 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['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 Gets an app's deployment slots. + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. * - * Gets an app's deployment slots. + * 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 Name of the app. + * @param {string} name Site name. + * + * @param {string} processId PID. * * @param {object} [options] Optional Parameters. * @@ -22728,13 +22057,14 @@ function _deleteSiteExtension(resourceGroupName, name, siteExtensionId, 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 WebAppCollection} for more information. + * 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 _listSlots(resourceGroupName, name, options, callback) { +function _listProcessThreads(resourceGroupName, name, processId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22744,7 +22074,6 @@ function _listSlots(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -22767,9 +22096,15 @@ function _listSlots(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -22779,12 +22114,13 @@ function _listSlots(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -22816,7 +22152,7 @@ function _listSlots(resourceGroupName, name, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -22851,7 +22187,7 @@ function _listSlots(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebAppCollection']().mapper(); + let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -22867,17 +22203,20 @@ function _listSlots(resourceGroupName, name, options, callback) { } /** - * @summary Gets the details of a web, mobile, or API app. + * @summary Get thread information by Thread ID for a specific process, in a + * specific scaled-out instance in a web site. * - * Gets the details of a web, mobile, or API app. + * 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 Name of the app. + * @param {string} name Site name. * - * @param {string} slot Name of the deployment slot. By default, this API - * returns the production slot. + * @param {string} processId PID. + * + * @param {string} threadId TID. * * @param {object} [options] Optional Parameters. * @@ -22891,13 +22230,13 @@ function _listSlots(resourceGroupName, name, 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 Site} for more information. + * 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 _getSlot(resourceGroupName, name, slot, options, callback) { +function _getProcessThread(resourceGroupName, name, processId, threadId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -22907,7 +22246,6 @@ function _getSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -22930,12 +22268,18 @@ function _getSlot(resourceGroupName, name, slot, options, callback) { if (name === 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 (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.'); } @@ -22945,13 +22289,14 @@ function _getSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'; + 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('{slot}', encodeURIComponent(slot)); + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -23018,7 +22363,7 @@ function _getSlot(resourceGroupName, name, slot, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Site']().mapper(); + let resultMapper = new client.models['ProcessThreadInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -23033,401 +22378,4290 @@ function _getSlot(resourceGroupName, name, slot, options, callback) { }); } - /** - * @summary Creates a new web, mobile, or API app in an existing resource - * group, or updates an existing app. + * @summary Get public certificates for an app or a deployment slot. * - * Creates a new web, mobile, or API app in an existing resource group, or - * updates an existing app. + * 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 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 {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 {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 {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} name Name of the app. * - * @param {string} [siteEnvelope.siteConfig.loadBalancing] Site load balancing. - * Possible values include: 'WeightedRoundRobin', 'LeastRequests', - * 'LeastResponseTime', 'WeightedTotalTraffic', 'RequestHash' + * @param {object} [options] Optional Parameters. * - * @param {object} [siteEnvelope.siteConfig.experiments] This is work around - * for polymophic types. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} [siteEnvelope.siteConfig.experiments.rampUpRules] List of - * ramp-up rules. + * @param {function} callback - The callback. * - * @param {object} [siteEnvelope.siteConfig.limits] Site limits. + * @returns {function} callback(err, result, request, response) * - * @param {number} [siteEnvelope.siteConfig.limits.maxPercentageCpu] Maximum - * allowed CPU usage percentage. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {number} [siteEnvelope.siteConfig.limits.maxMemoryInMb] Maximum - * allowed memory usage in MB. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PublicCertificateCollection} for more + * information. * - * @param {number} [siteEnvelope.siteConfig.limits.maxDiskSizeInMb] Maximum - * allowed disk size usage in MB. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {boolean} [siteEnvelope.siteConfig.autoHealEnabled] true - * if Auto Heal is enabled; otherwise, false. + * {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). * - * @param {object} [siteEnvelope.siteConfig.autoHealRules] Auto Heal rules. + * Get the named public certificate for an app (or deployment slot, if + * specified). * - * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers] Conditions - * that describe when to execute the auto-heal actions. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {object} [siteEnvelope.siteConfig.autoHealRules.triggers.requests] A - * rule based on total requests. + * @param {string} name Name of the app. * - * @param {number} - * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.count] Request - * Count. + * @param {string} publicCertificateName Public certificate name. * - * @param {string} - * [siteEnvelope.siteConfig.autoHealRules.triggers.requests.timeInterval] Time - * interval. + * @param {object} [options] Optional Parameters. * - * @param {number} - * [siteEnvelope.siteConfig.autoHealRules.triggers.privateBytesInKB] A rule - * based on private bytes. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} [siteEnvelope.siteConfig.autoHealRules.triggers.statusCodes] - * A rule based on status codes. + * @param {function} callback - The callback. * - * @param {object} - * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests] A rule based - * on request execution time. + * @returns {function} callback(err, result, request, response) * - * @param {string} - * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeTaken] Time - * taken. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {number} - * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.count] Request - * Count. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PublicCertificate} for more information. * - * @param {string} - * [siteEnvelope.siteConfig.autoHealRules.triggers.slowRequests.timeInterval] - * Time interval. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions] Actions to - * be executed when a rule is triggered. + * {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. * - * @param {string} [siteEnvelope.siteConfig.autoHealRules.actions.actionType] - * Predefined action to be taken. Possible values include: 'Recycle', - * 'LogEvent', 'CustomAction' + * Creates a hostname binding for an app. * - * @param {object} [siteEnvelope.siteConfig.autoHealRules.actions.customAction] - * Custom action to be taken. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {string} - * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.exe] Executable - * to be run. + * @param {string} name Name of the app. * - * @param {string} - * [siteEnvelope.siteConfig.autoHealRules.actions.customAction.parameters] - * Parameters for the executable. + * @param {string} publicCertificateName Public certificate name. * - * @param {string} - * [siteEnvelope.siteConfig.autoHealRules.actions.minProcessExecutionTime] - * Minimum time the process must execute - * before taking the action + * @param {object} publicCertificate Public certificate details. This is the + * JSON representation of a PublicCertificate object. * - * @param {string} [siteEnvelope.siteConfig.tracingOptions] Tracing options. + * @param {buffer} [publicCertificate.blob] Public Certificate byte array * - * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * @param {string} [publicCertificate.publicCertificateLocation] Public + * Certificate Location. Possible values include: 'CurrentUserMy', + * 'LocalMachineMy', 'Unknown' * - * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing - * (CORS) settings. + * @param {string} [publicCertificate.kind] Kind of resource. * - * @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} [options] Optional Parameters. * - * @param {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a - * flag indicating whether the Push endpoint is enabled. + * @param {function} callback - The callback. * - * @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. + * @returns {function} callback(err, result, request, response) * - * @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. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @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. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link PublicCertificate} for more information. * - * @param {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about + * {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} [options] Optional Parameters. + * + * @param {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} callback - The callback. + * + * @returns {function} callback(err, result, request, 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, options, callback) { + /* jshint 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 format = (options && options.format !== undefined) ? options.format : 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 (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { + throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); + } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } + if (format !== null && format !== undefined && typeof format.valueOf() !== 'string') { + throw new Error('format must be of type string.'); + } + if (this.client.acceptLanguage !== null && this.client.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 publishingProfileOptions; + if (format !== null && format !== undefined) { + publishingProfileOptions = new client.models['CsmPublishingProfileOptions'](); + publishingProfileOptions.format = format; + } + + // 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] 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 {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] 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 {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.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} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot - * name. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] - * true to enable local MySQL; otherwise, false. + * @param {string} name Name of the app. * - * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * @param {object} slotSwapEntity JSON object that contains the target slot + * name. See example. * - * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop - * SCM (KUDU) site when the app is stopped; otherwise, false. The - * default is false. + * @param {string} slotSwapEntity.targetSlot Destination deployment slot during + * swap operation. * - * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service - * Environment to use for the app. + * @param {boolean} slotSwapEntity.preserveVnet true to preserve + * Virtual Network to the slot during swap; otherwise, false. * - * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of - * the App Service Environment. + * @param {string} slot Name of the source slot. If a slot is not specified, + * the production slot is used as the source slot. * - * @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 {object} [options] Optional Parameters. * - * @param {boolean} [siteEnvelope.clientCertEnabled] true to - * enable client certificate authentication (TLS mutual authentication); - * otherwise, false. Default is false. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @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 {function} callback - The callback. * - * @param {number} [siteEnvelope.containerSize] Size of the function container. + * @returns {function} callback(err, result, request, response) * - * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily - * memory-time quota (applicable on dynamic apps only). + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, - * the app is cloned from a source app. + * {null} [result] - The deserialized result object if an error did not occur. * - * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of - * cloning operation. This ID ties multiple cloning operations - * together to use the same snapshot. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to - * overwrite destination app; otherwise, false. + * {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. * - * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] - * true to clone custom hostnames from source app; otherwise, - * false. + * Creates a backup of an app. * - * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] - * true to clone source control from source app; otherwise, - * false. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @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} name Name of the app. * - * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service - * Environment. + * @param {object} request Backup configuration. You can use the JSON response + * from the POST action as input here. * - * @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} [request.enabled] True if the backup schedule is enabled + * (must be included in that case), false if the backup schedule should be + * disabled. * - * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] - * true to configure load balancing for source and destination - * app. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @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 {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. * - * @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 {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 {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. + * @param {array} [request.databases] Databases included in the backup. * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. + * @param {string} [request.kind] Kind of resource. * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS + * @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 {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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 {object} [options] Optional Parameters. * - * @param {boolean} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. + * @param {function} callback - The callback. * - * @param {boolean} [siteEnvelope.snapshotInfo.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. + * @returns {function} callback(err, result, request, response) * - * @param {string} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site - * to accept only https requests. Issues redirect for - * http requests + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackupItem} for more information. * - * @param {object} [siteEnvelope.identity] + * {object} [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. * - * @param {object} [siteEnvelope.identity.type] Type of managed service - * identity. + * Gets a backup of an app by its ID. * - * @param {string} [siteEnvelope.kind] Kind of resource. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {string} siteEnvelope.location Resource Location. + * @param {string} name Name of the app. * - * @param {object} [siteEnvelope.tags] Resource tags. + * @param {string} backupId ID of the backup. * - * @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 {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 {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -23438,50 +26672,141 @@ function _getSlot(resourceGroupName, name, slot, 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 Site} for more information. + * 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 _createOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, options, callback) { +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); + } - // 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; + // 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('&'); + } - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; - - // Deserialize Response + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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(); + let resultMapper = new client.models['BackupItem']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -23490,37 +26815,28 @@ function _createOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, option deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } + } - return callback(null, result, httpRequest, response); - }); + return callback(null, result, httpRequest, response); }); } /** - * @summary Deletes a web, mobile, or API app, or one of the deployment slots. + * @summary Deletes a backup of an app by its ID. * - * Deletes a web, mobile, or API app, or one of the deployment slots. + * 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 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 {string} name Name of the app. * - * @param {boolean} [options.deleteMetrics] If true, web app metrics are also - * deleted. + * @param {string} backupId ID of the backup. * - * @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 {string} slot Name of the deployment slot. If a slot is not + * specified, the API will delete a backup of the production slot. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -23537,7 +26853,7 @@ function _createOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, option * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deleteSlot(resourceGroupName, name, slot, options, callback) { +function _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -23547,10 +26863,6 @@ function _deleteSlot(resourceGroupName, name, slot, options, callback) { 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; - let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -23573,21 +26885,18 @@ function _deleteSlot(resourceGroupName, name, slot, options, callback) { if (name === 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 (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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { - throw new Error('skipDnsRegistration must be of type boolean.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -23597,22 +26906,14 @@ function _deleteSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'; + 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 = []; - if (deleteMetrics !== null && deleteMetrics !== undefined) { - queryParameters.push('deleteMetrics=' + encodeURIComponent(deleteMetrics.toString())); - } - if (deleteEmptyServerFarm !== null && deleteEmptyServerFarm !== undefined) { - queryParameters.push('deleteEmptyServerFarm=' + encodeURIComponent(deleteEmptyServerFarm.toString())); - } - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { - queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -23644,7 +26945,7 @@ function _deleteSlot(resourceGroupName, name, slot, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -23678,389 +26979,365 @@ function _deleteSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary Creates a new web, mobile, or API app in an existing resource - * group, or updates an existing app. + * @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. * - * Creates a new web, mobile, or API app in an existing resource group, or - * updates an existing app. + * 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 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 {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 {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 {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} name Name of web app. * - * @param {string} [siteEnvelope.siteConfig.vnetName] Virtual Network name. + * @param {string} backupId ID of backup. * - * @param {object} [siteEnvelope.siteConfig.cors] Cross-Origin Resource Sharing - * (CORS) settings. + * @param {object} request Information on backup request. * - * @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 {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 {object} [siteEnvelope.siteConfig.push] Push endpoint settings. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @param {boolean} siteEnvelope.siteConfig.push.isPushEnabled Gets or sets a - * flag indicating whether the Push endpoint is enabled. + * @param {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. * - * @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 {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} [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} 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 {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 {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 {string} [siteEnvelope.siteConfig.push.kind] Kind of resource. + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. * - * @param {object} [siteEnvelope.siteConfig.apiDefinition] Information about - * the formal API definition for the app. + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. * - * @param {string} [siteEnvelope.siteConfig.apiDefinition.url] The URL of the - * API definition. + * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [siteEnvelope.siteConfig.autoSwapSlotName] Auto-swap slot - * name. + * @param {string} [request.kind] Kind of resource. * - * @param {boolean} [siteEnvelope.siteConfig.localMySqlEnabled] - * true to enable local MySQL; otherwise, false. + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. * - * @param {array} [siteEnvelope.siteConfig.ipSecurityRestrictions] IP security - * restrictions. + * @param {object} [options] Optional Parameters. * - * @param {boolean} [siteEnvelope.scmSiteAlsoStopped] true to stop - * SCM (KUDU) site when the app is stopped; otherwise, false. The - * default is false. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [siteEnvelope.hostingEnvironmentProfile] App Service - * Environment to use for the app. + * @param {function} callback - The callback. * - * @param {string} [siteEnvelope.hostingEnvironmentProfile.id] Resource ID of - * the App Service Environment. + * @returns {function} callback(err, result, request, response) * - * @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. + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {boolean} [siteEnvelope.clientCertEnabled] true to - * enable client certificate authentication (TLS mutual authentication); - * otherwise, false. Default is false. + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link BackupItem} for more information. * - * @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. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {number} [siteEnvelope.containerSize] Size of the function container. + * {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). * - * @param {number} [siteEnvelope.dailyMemoryTimeQuota] Maximum allowed daily - * memory-time quota (applicable on dynamic apps only). + * Restores a specific backup to another app (or deployment slot, if + * specified). * - * @param {object} [siteEnvelope.cloningInfo] If specified during app creation, - * the app is cloned from a source app. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {uuid} [siteEnvelope.cloningInfo.correlationId] Correlation ID of - * cloning operation. This ID ties multiple cloning operations - * together to use the same snapshot. + * @param {string} name Name of the app. * - * @param {boolean} [siteEnvelope.cloningInfo.overwrite] true to - * overwrite destination app; otherwise, false. + * @param {string} backupId ID of the backup. * - * @param {boolean} [siteEnvelope.cloningInfo.cloneCustomHostNames] - * true to clone custom hostnames from source app; otherwise, - * false. + * @param {object} request Information on restore request . * - * @param {boolean} [siteEnvelope.cloningInfo.cloneSourceControl] - * true to clone source control from source app; otherwise, - * false. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @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} [request.blobName] Name of a blob which contains the backup. * - * @param {string} [siteEnvelope.cloningInfo.hostingEnvironment] App Service - * Environment. + * @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 {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 {string} [request.siteName] Name of an app. * - * @param {boolean} [siteEnvelope.cloningInfo.configureLoadBalancing] - * true to configure load balancing for source and destination - * 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 {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 {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 {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} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS + * @param {string} [request.kind] Kind of resource. * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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 {string} slot Name of the deployment slot. If a slot is not + * specified, the API will restore a backup of the production slot. * - * @param {boolean} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. + * @param {object} [options] Optional Parameters. * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} [siteEnvelope.snapshotInfo.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 {function} callback - The callback. * - * @param {string} [siteEnvelope.snapshotInfo.kind] Kind of resource. + * @returns {function} callback(err, result, request, response) * - * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site - * to accept only https requests. Issues redirect for - * http requests + * {Error} err - The Error object if an error occurred, null otherwise. * - * @param {string} [siteEnvelope.kind] Kind of resource. + * {null} [result] - The deserialized result object if an error did not occur. * - * @param {string} slot Name of the deployment slot to create or update. By - * default, this API attempts to create or modify the production slot. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {object} [options] Optional Parameters. + * {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 * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. + * List the configurations of an app + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. + * @param {string} name Name of the app. * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API will return configuration for the production slot. * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -24072,13 +27349,14 @@ function _deleteSlot(resourceGroupName, name, slot, 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 Site} for more information. + * 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 _updateSlot(resourceGroupName, name, siteEnvelope, slot, options, callback) { +function _listConfigurationsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -24088,11 +27366,6 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, slot, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; - let skipCustomDomainVerification = (options && options.skipCustomDomainVerification !== undefined) ? options.skipCustomDomainVerification : undefined; - let forceDnsRegistration = (options && options.forceDnsRegistration !== undefined) ? options.forceDnsRegistration : undefined; - let ttlInSeconds = (options && options.ttlInSeconds !== undefined) ? options.ttlInSeconds : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -24115,27 +27388,15 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, slot, options, callb if (name === 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 (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { - throw new Error('skipDnsRegistration must be of type boolean.'); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined && typeof skipCustomDomainVerification !== 'boolean') { - throw new Error('skipCustomDomainVerification must be of type boolean.'); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined && typeof forceDnsRegistration !== 'boolean') { - throw new Error('forceDnsRegistration must be of type boolean.'); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined && typeof ttlInSeconds.valueOf() !== 'string') { - throw new Error('ttlInSeconds must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -24145,32 +27406,20 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, slot, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}'; + 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 = []; - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { - queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined) { - queryParameters.push('skipCustomDomainVerification=' + encodeURIComponent(skipCustomDomainVerification.toString())); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined) { - queryParameters.push('forceDnsRegistration=' + encodeURIComponent(forceDnsRegistration.toString())); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined) { - queryParameters.push('ttlInSeconds=' + encodeURIComponent(ttlInSeconds)); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -24188,28 +27437,14 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, slot, options, callb } } } - // 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; + httpRequest.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); @@ -24219,12 +27454,13 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, slot, options, callb try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -24244,7 +27480,7 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, slot, options, callb parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Site']().mapper(); + let resultMapper = new client.models['SiteConfigResourceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -24254,44 +27490,32 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, slot, options, callb 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. + * @summary Replaces the application settings of an app. * - * Analyze a custom hostname. + * 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 web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @param {object} appSettings Application settings of the app. * - * @param {object} [options] Optional Parameters. + * @param {object} [appSettings.properties] Settings. * - * @param {string} [options.hostName] Custom hostname. + * @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 @@ -24303,14 +27527,13 @@ function _updateSlot(resourceGroupName, name, siteEnvelope, slot, 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 CustomHostnameAnalysisResult} for more - * information. + * 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 _analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, callback) { +function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -24320,8 +27543,6 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let hostName = (options && options.hostName !== undefined) ? options.hostName : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -24344,15 +27565,18 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, call if (name === 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 (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.'); } @@ -24362,23 +27586,20 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/analyzeCustomHostname'; + 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 = []; - if (hostName !== null && hostName !== undefined) { - queryParameters.push('hostName=' + encodeURIComponent(hostName)); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -24396,7 +27617,21 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, call } } } - httpRequest.body = null; + // 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) { @@ -24413,12 +27648,13 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, call try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -24438,7 +27674,7 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['CustomHostnameAnalysisResult']().mapper(); + let resultMapper = new client.models['StringDictionary']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -24454,28 +27690,18 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, call } /** - * @summary Applies the configuration settings from the target slot onto the - * current slot. + * @summary Gets the application settings of an app. * - * Applies the configuration settings from the target slot onto the current - * slot. + * 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} 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 {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. * @@ -24488,13 +27714,14 @@ function _analyzeCustomHostnameSlot(resourceGroupName, name, slot, options, call * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, slot, options, callback) { +function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -24504,7 +27731,6 @@ function _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, sl if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -24527,15 +27753,15 @@ function _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, sl if (name === 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.'); } @@ -24545,13 +27771,13 @@ function _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, sl // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/applySlotConfig'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -24576,21 +27802,7 @@ function _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, sl } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -24607,12 +27819,13 @@ function _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, sl try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -24625,63 +27838,186 @@ function _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, sl // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Creates a backup of an app. + * @summary Updates the Authentication / Authorization settings associated with + * web app. * - * Creates a backup of an 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 the app. + * @param {string} name Name of web app. * - * @param {object} request Backup configuration. You can use the JSON response - * from the POST action as input here. + * @param {object} siteAuthSettings Auth settings associated with web app. * - * @param {string} request.backupRequestName Name of the backup. + * @param {boolean} [siteAuthSettings.enabled] true if the + * Authentication / Authorization feature is enabled for the current app; + * otherwise, false. * - * @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} [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} request.storageAccountUrl SAS URL to the container. + * @param {string} [siteAuthSettings.unauthenticatedClientAction] The action to + * take when an unauthenticated client attempts to access the app. Possible + * values include: 'RedirectToLoginPage', 'AllowAnonymous' * - * @param {object} [request.backupSchedule] Schedule for the backup if it is - * executed periodically. + * @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 {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 {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} 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 {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 {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} [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 {number} request.backupSchedule.retentionPeriodInDays After how many - * days backups should be deleted. + * @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 {date} [request.backupSchedule.startTime] When the schedule should - * start working. + * @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 {array} [request.databases] Databases included in the backup. + * @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 {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * @param {boolean} [siteAuthSettings.validateIssuer] Gets a value indicating + * whether the issuer should be a valid HTTPS url and be validated as such. * - * @param {string} [request.kind] Kind of resource. + * @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 {string} slot Name of the deployment slot. If a slot is not - * specified, the API will create a backup for the production slot. + * @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. * @@ -24695,13 +28031,13 @@ function _applySlotConfigurationSlot(resourceGroupName, name, slotSwapEntity, sl * {Error} 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. + * 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 _backupSlot(resourceGroupName, name, request, slot, options, callback) { +function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -24711,7 +28047,6 @@ function _backupSlot(resourceGroupName, name, request, slot, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -24734,8 +28069,8 @@ function _backupSlot(resourceGroupName, name, request, slot, options, callback) if (name === 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 (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.'); @@ -24743,6 +28078,9 @@ function _backupSlot(resourceGroupName, name, request, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -24752,20 +28090,20 @@ function _backupSlot(resourceGroupName, name, request, slot, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup'; + 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(apiVersion)); + queryParameters.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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -24787,14 +28125,14 @@ function _backupSlot(resourceGroupName, name, request, slot, options, callback) 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'); + 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(request, null, 2)}.`); + `payload - ${JSON.stringify(siteAuthSettings, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -24814,12 +28152,13 @@ function _backupSlot(resourceGroupName, name, request, slot, options, callback) try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -24839,7 +28178,7 @@ function _backupSlot(resourceGroupName, name, request, slot, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupItem']().mapper(); + let resultMapper = new client.models['SiteAuthSettings']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -24855,9 +28194,9 @@ function _backupSlot(resourceGroupName, name, request, slot, options, callback) } /** - * @summary Gets existing backups of an app. + * @summary Gets the Authentication/Authorization settings of an app. * - * Gets existing backups of an app. + * Gets the Authentication/Authorization settings of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -24865,7 +28204,7 @@ function _backupSlot(resourceGroupName, name, request, slot, options, callback) * @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. + * specified, the API will get the settings for the production slot. * * @param {object} [options] Optional Parameters. * @@ -24879,13 +28218,13 @@ function _backupSlot(resourceGroupName, name, request, slot, 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 BackupItemCollection} for more information. + * 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 _listBackupsSlot(resourceGroupName, name, slot, options, callback) { +function _getAuthSettingsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -24895,7 +28234,6 @@ function _listBackupsSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -24924,6 +28262,9 @@ function _listBackupsSlot(resourceGroupName, name, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -24933,20 +28274,20 @@ function _listBackupsSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups'; + 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(apiVersion)); + queryParameters.push('api-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 @@ -24981,12 +28322,13 @@ function _listBackupsSlot(resourceGroupName, name, slot, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -25006,7 +28348,7 @@ function _listBackupsSlot(resourceGroupName, name, slot, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupItemCollection']().mapper(); + let resultMapper = new client.models['SiteAuthSettings']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -25022,60 +28364,52 @@ function _listBackupsSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary Discovers an existing app backup that can be restored from a blob - * in Azure storage. + * @summary Updates the backup configuration of an app. * - * Discovers an existing app backup that can be restored from a blob in Azure - * storage. + * 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 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 {object} request Edited backup configuration. * - * @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 {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.siteName] Name of an app. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @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 {object} [request.backupSchedule] Schedule for the backup if it is + * executed periodically. * - * @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 {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 {boolean} [request.ignoreDatabases] Ignore the databases and only - * restore the site content + * @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 {string} [request.appServicePlan] Specify app service plan that will - * own restored site. + * @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 {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * @param {number} request.backupSchedule.retentionPeriodInDays After how many + * days backups should be deleted. * - * @param {boolean} [request.adjustConnectionStrings] true if - * SiteConfig.ConnectionStrings should be set in new app; otherwise, - * false. + * @param {date} [request.backupSchedule.startTime] When the schedule should + * start working. * - * @param {string} [request.hostingEnvironment] App Service Environment name, - * if needed (only when restoring an app to an App Service Environment). + * @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 perform discovery for the production slot. + * specified, the API will update the backup configuration for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -25089,13 +28423,13 @@ function _listBackupsSlot(resourceGroupName, name, slot, 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 RestoreRequest} for more information. + * 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 _discoverRestoreSlot(resourceGroupName, name, request, slot, options, callback) { +function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -25105,7 +28439,6 @@ function _discoverRestoreSlot(resourceGroupName, name, request, slot, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -25137,6 +28470,9 @@ function _discoverRestoreSlot(resourceGroupName, name, request, slot, options, c if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -25146,13 +28482,13 @@ function _discoverRestoreSlot(resourceGroupName, name, request, slot, options, c // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/discover'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -25182,7 +28518,7 @@ function _discoverRestoreSlot(resourceGroupName, name, request, slot, options, c let requestModel = null; try { if (request !== null && request !== undefined) { - let requestModelMapper = new client.models['RestoreRequest']().mapper(); + let requestModelMapper = new client.models['BackupRequest']().mapper(); requestModel = client.serialize(requestModelMapper, request, 'request'); requestContent = JSON.stringify(requestModel); } @@ -25208,12 +28544,13 @@ function _discoverRestoreSlot(resourceGroupName, name, request, slot, options, c try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -25233,7 +28570,7 @@ function _discoverRestoreSlot(resourceGroupName, name, request, slot, options, c parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RestoreRequest']().mapper(); + let resultMapper = new client.models['BackupRequest']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -25249,19 +28586,18 @@ function _discoverRestoreSlot(resourceGroupName, name, request, slot, options, c } /** - * @summary Gets a backup of an app by its ID. + * @summary Deletes the backup configuration of an app. * - * Gets a backup of an app by its ID. + * 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} 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. + * specified, the API will delete the backup configuration for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -25274,14 +28610,13 @@ function _discoverRestoreSlot(resourceGroupName, name, request, slot, 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 BackupItem} 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 _getBackupStatusSlot(resourceGroupName, name, backupId, slot, options, callback) { +function _deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -25291,7 +28626,6 @@ function _getBackupStatusSlot(resourceGroupName, name, backupId, slot, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -25314,15 +28648,15 @@ function _getBackupStatusSlot(resourceGroupName, name, backupId, slot, options, if (name === 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.'); } @@ -25332,21 +28666,20 @@ function _getBackupStatusSlot(resourceGroupName, name, backupId, slot, options, // 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}'; + 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('{backupId}', encodeURIComponent(backupId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -25399,42 +28732,24 @@ function _getBackupStatusSlot(resourceGroupName, name, backupId, slot, 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['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. + * @summary Gets the backup configuration of an app. * - * Deletes a backup of an app by its ID. + * 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} 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. + * specified, the API will get the backup configuration for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -25447,13 +28762,14 @@ function _getBackupStatusSlot(resourceGroupName, name, backupId, slot, options, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, callback) { +function _getBackupConfigurationSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -25463,7 +28779,6 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -25486,15 +28801,15 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, cal if (name === 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.'); } @@ -25504,21 +28819,20 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, cal // 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}'; + 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('{backupId}', encodeURIComponent(backupId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -25543,7 +28857,7 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, cal return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -25553,12 +28867,13 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, slot, options, cal try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -25571,70 +28886,48 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, slot, 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['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 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. + * @summary Replaces the connection strings of an app. * - * 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. + * 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 web app. - * - * @param {string} backupId ID of backup. - * - * @param {object} request Information on backup request. - * - * @param {string} request.backupRequestName 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 {string} name Name of the app. * - * @param {array} [request.databases] Databases included in the backup. + * @param {object} connectionStrings Connection strings of the app or + * deployment slot. See example. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * @param {object} [connectionStrings.properties] Connection strings. * - * @param {string} [request.kind] Kind of resource. + * @param {string} [connectionStrings.kind] Kind of resource. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -25648,13 +28941,14 @@ function _deleteBackupSlot(resourceGroupName, name, backupId, slot, 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 BackupItem} for more information. + * 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 _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request, slot, options, callback) { +function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -25664,7 +28958,6 @@ function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -25687,11 +28980,8 @@ function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request if (name === 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 (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.'); @@ -25699,6 +28989,9 @@ function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -25708,21 +29001,20 @@ function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request // 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'; + 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('{backupId}', encodeURIComponent(backupId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -25744,14 +29036,14 @@ function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, 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'); + 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(request, null, 2)}.`); + `payload - ${JSON.stringify(connectionStrings, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -25771,12 +29063,13 @@ function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -25796,7 +29089,7 @@ function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupItem']().mapper(); + let resultMapper = new client.models['ConnectionStringDictionary']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -25811,138 +29104,10 @@ function _listBackupStatusSecretsSlot(resourceGroupName, name, backupId, request }); } - -/** - * @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' - * - * @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. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} for more information. - * - * {object} [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 - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RestoreResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in 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 + * @summary Gets the connection strings of an app. * - * List the configurations of an app + * Gets the connection strings of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -25950,7 +29115,7 @@ function _restoreSlot(resourceGroupName, name, backupId, request, slot, options, * @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. + * specified, the API will get the connection settings for the production slot. * * @param {object} [options] Optional Parameters. * @@ -25964,14 +29129,14 @@ function _restoreSlot(resourceGroupName, name, backupId, request, slot, 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 SiteConfigResourceCollection} for more + * 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 _listConfigurationsSlot(resourceGroupName, name, slot, options, callback) { +function _listConnectionStringsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -25981,7 +29146,6 @@ function _listConfigurationsSlot(resourceGroupName, name, slot, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -26010,6 +29174,9 @@ function _listConfigurationsSlot(resourceGroupName, name, slot, options, callbac if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -26019,20 +29186,20 @@ function _listConfigurationsSlot(resourceGroupName, name, slot, options, callbac // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config'; + 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(apiVersion)); + queryParameters.push('api-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 @@ -26067,12 +29234,13 @@ function _listConfigurationsSlot(resourceGroupName, name, slot, options, callbac try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -26092,7 +29260,7 @@ function _listConfigurationsSlot(resourceGroupName, name, slot, options, callbac parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigResourceCollection']().mapper(); + let resultMapper = new client.models['ConnectionStringDictionary']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -26108,23 +29276,17 @@ function _listConfigurationsSlot(resourceGroupName, name, slot, options, callbac } /** - * @summary Replaces the application settings of an app. + * @summary Gets the logging configuration of an app. * - * Replaces the application settings 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} 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 + * specified, the API will get the logging configuration for the production * slot. * * @param {object} [options] Optional Parameters. @@ -26139,13 +29301,13 @@ function _listConfigurationsSlot(resourceGroupName, name, slot, 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 StringDictionary} for more information. + * 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 _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, slot, options, callback) { +function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -26155,7 +29317,6 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, sl if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -26178,15 +29339,15 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, sl if (name === 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.'); } @@ -26196,20 +29357,20 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, sl // 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'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -26227,21 +29388,7 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, sl } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -26258,12 +29405,13 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, sl try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -26283,7 +29431,7 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, sl parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['StringDictionary']().mapper(); + let resultMapper = new client.models['SiteLogsConfig']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -26299,17 +29447,101 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, sl } /** - * @summary Gets the application settings of an app. + * @summary Updates the logging configuration of an app. * - * Gets the application settings 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 get the application settings for the production + * specified, the API will update the logging configuration for the production * slot. * * @param {object} [options] Optional Parameters. @@ -26324,13 +29556,13 @@ function _updateApplicationSettingsSlot(resourceGroupName, name, appSettings, sl * {Error} 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. + * 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 _listApplicationSettingsSlot(resourceGroupName, name, slot, options, callback) { +function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -26340,7 +29572,6 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -26363,12 +29594,18 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, ca if (name === 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.'); } @@ -26378,20 +29615,20 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, ca // 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'; + 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(apiVersion)); + queryParameters.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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -26409,7 +29646,21 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, ca } } } - httpRequest.body = null; + // 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) { @@ -26426,12 +29677,13 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, ca try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -26451,7 +29703,7 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, ca parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['StringDictionary']().mapper(); + let resultMapper = new client.models['SiteLogsConfig']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -26467,160 +29719,24 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, options, ca } /** - * @summary Updates the Authentication / Authorization settings associated with - * web app. + * @summary Replaces the metadata of an app. * - * Updates the Authentication / Authorization settings associated with web 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 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 {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} name Name of the app. * - * @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 {object} metadata Edited metadata of the app or deployment slot. See + * example. * - * @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 {object} [metadata.properties] Settings. * - * @param {string} [siteAuthSettings.kind] Kind of resource. + * @param {string} [metadata.kind] Kind of resource. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -26634,13 +29750,13 @@ function _listApplicationSettingsSlot(resourceGroupName, name, slot, 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 SiteAuthSettings} for more information. + * 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 _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot, options, callback) { +function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -26650,7 +29766,6 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -26673,8 +29788,8 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot if (name === 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 (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.'); @@ -26682,6 +29797,9 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -26691,13 +29809,13 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -26726,14 +29844,14 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot 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'); + 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(siteAuthSettings, null, 2)}.`); + `payload - ${JSON.stringify(metadata, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -26753,12 +29871,13 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -26778,7 +29897,7 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteAuthSettings']().mapper(); + let resultMapper = new client.models['StringDictionary']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -26794,9 +29913,9 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot } /** - * @summary Gets the Authentication/Authorization settings of an app. + * @summary Gets the metadata of an app. * - * Gets the Authentication/Authorization settings of an app. + * Gets the metadata of an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -26804,7 +29923,7 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot * @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. + * specified, the API will get the metadata for the production slot. * * @param {object} [options] Optional Parameters. * @@ -26818,13 +29937,13 @@ function _updateAuthSettingsSlot(resourceGroupName, name, siteAuthSettings, slot * {Error} 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. + * 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 _getAuthSettingsSlot(resourceGroupName, name, slot, options, callback) { +function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -26834,7 +29953,6 @@ function _getAuthSettingsSlot(resourceGroupName, name, slot, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -26863,6 +29981,9 @@ function _getAuthSettingsSlot(resourceGroupName, name, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -26872,13 +29993,13 @@ function _getAuthSettingsSlot(resourceGroupName, name, slot, options, callback) // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -26920,12 +30041,13 @@ function _getAuthSettingsSlot(resourceGroupName, name, slot, options, callback) try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -26945,7 +30067,7 @@ function _getAuthSettingsSlot(resourceGroupName, name, slot, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteAuthSettings']().mapper(); + let resultMapper = new client.models['StringDictionary']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -26960,58 +30082,125 @@ function _getAuthSettingsSlot(resourceGroupName, name, slot, options, callback) }); } + /** - * @summary Updates the backup configuration of an app. + * @summary Gets the Git/FTP publishing credentials of an app. * - * Updates the backup configuration 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} request Edited backup configuration. + * @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 {string} request.backupRequestName Name of the backup. + * @param {object} [options] Optional Parameters. * - * @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 {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} request.storageAccountUrl SAS URL to the container. + * @param {function} callback - The callback. * - * @param {object} [request.backupSchedule] Schedule for the backup if it is - * executed periodically. + * @returns {function} callback(err, result, request, response) * - * @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) + * {Error} err - The Error object if an error occurred, null otherwise. * - * @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' + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link User} for more information. * - * @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. + * {object} [request] - The HTTP Request object if an error did not occur. * - * @param {number} request.backupSchedule.retentionPeriodInDays After how many - * days backups should be deleted. + * {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. * - * @param {date} [request.backupSchedule.startTime] When the schedule should - * start working. + * Updates the Push settings associated with web app. * - * @param {array} [request.databases] Databases included in the backup. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * @param {string} name Name of web app. * - * @param {string} [request.kind] Kind of resource. + * @param {object} pushSettings Push settings associated with web app. * - * @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 {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. * @@ -27025,13 +30214,13 @@ function _getAuthSettingsSlot(resourceGroupName, name, slot, 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 BackupRequest} for more information. + * 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 _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, options, callback) { +function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -27041,7 +30230,6 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -27064,8 +30252,8 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, if (name === 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 (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.'); @@ -27073,6 +30261,9 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -27082,13 +30273,13 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -27117,14 +30308,14 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, 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'); + 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(request, null, 2)}.`); + `payload - ${JSON.stringify(pushSettings, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -27144,12 +30335,13 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -27169,7 +30361,7 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupRequest']().mapper(); + let resultMapper = new client.models['PushSettings']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -27185,18 +30377,17 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, } /** - * @summary Deletes the backup configuration of an app. + * @summary Gets the Push settings associated with web app. * - * Deletes the backup configuration of an 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 the app. + * @param {string} name Name of web 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 {string} slot Name of web app slot. If not specified then will + * default to production slot. * * @param {object} [options] Optional Parameters. * @@ -27209,13 +30400,14 @@ function _updateBackupConfigurationSlot(resourceGroupName, name, request, slot, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, callback) { +function _listSitePushSettingsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -27225,7 +30417,6 @@ function _deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -27254,6 +30445,9 @@ function _deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -27263,20 +30457,20 @@ function _deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, // 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'; + 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(apiVersion)); + queryParameters.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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -27311,12 +30505,13 @@ function _deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -27329,15 +30524,32 @@ function _deleteBackupConfigurationSlot(resourceGroupName, name, slot, 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['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 backup configuration of an app. + * @summary Gets a Swift Virtual Network connection. * - * Gets the backup configuration of an app. + * Gets a Swift Virtual Network connection. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -27345,8 +30557,8 @@ function _deleteBackupConfigurationSlot(resourceGroupName, name, slot, options, * @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. + * specified, the API will get a gateway for the production slot's Virtual + * Network. * * @param {object} [options] Optional Parameters. * @@ -27360,13 +30572,13 @@ function _deleteBackupConfigurationSlot(resourceGroupName, name, slot, 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 BackupRequest} for more information. + * 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 _getBackupConfigurationSlot(resourceGroupName, name, slot, options, callback) { +function _getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -27376,7 +30588,6 @@ function _getBackupConfigurationSlot(resourceGroupName, name, slot, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -27405,6 +30616,9 @@ function _getBackupConfigurationSlot(resourceGroupName, name, slot, options, cal if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -27414,20 +30628,20 @@ function _getBackupConfigurationSlot(resourceGroupName, name, slot, options, cal // 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'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -27462,12 +30676,13 @@ function _getBackupConfigurationSlot(resourceGroupName, name, slot, options, cal try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -27487,7 +30702,7 @@ function _getBackupConfigurationSlot(resourceGroupName, name, slot, options, cal parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupRequest']().mapper(); + let resultMapper = new client.models['SwiftVirtualNetwork']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -27503,25 +30718,35 @@ function _getBackupConfigurationSlot(resourceGroupName, name, slot, options, cal } /** - * @summary Replaces the connection strings of an app. + * @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. * - * Replaces the connection strings of an app. + * 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} connectionStrings Connection strings of the app or - * deployment slot. See example. + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. * - * @param {object} [connectionStrings.properties] Connection strings. + * @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 {string} [connectionStrings.kind] Kind of resource. + * @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 update the connection settings for the production - * slot. + * specified, the API will add or update connections for the production slot. * * @param {object} [options] Optional Parameters. * @@ -27535,14 +30760,13 @@ function _getBackupConfigurationSlot(resourceGroupName, name, slot, 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 ConnectionStringDictionary} for more - * information. + * 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 _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings, slot, options, callback) { +function _createOrUpdateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -27552,7 +30776,6 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -27575,8 +30798,8 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings if (name === 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 (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.'); @@ -27584,6 +30807,9 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -27593,13 +30819,13 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -27628,14 +30854,14 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings 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'); + 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(connectionStrings, null, 2)}.`); + `payload - ${JSON.stringify(connectionEnvelope, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -27655,12 +30881,13 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -27680,7 +30907,7 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ConnectionStringDictionary']().mapper(); + let resultMapper = new client.models['SwiftVirtualNetwork']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -27696,9 +30923,10 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings } /** - * @summary Gets the connection strings of an app. + * @summary Deletes a Swift Virtual Network connection from an app (or + * deployment slot). * - * Gets the connection strings of an app. + * 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. @@ -27706,7 +30934,7 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings * @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. + * specified, the API will delete the connection for the production slot. * * @param {object} [options] Optional Parameters. * @@ -27719,15 +30947,13 @@ function _updateConnectionStringsSlot(resourceGroupName, name, connectionStrings * * {Error} 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [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) { +function _deleteSwiftVirtualNetworkSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -27737,7 +30963,6 @@ function _listConnectionStringsSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -27766,6 +30991,9 @@ function _listConnectionStringsSlot(resourceGroupName, name, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -27775,20 +31003,20 @@ function _listConnectionStringsSlot(resourceGroupName, name, slot, options, call // 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'; + 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(apiVersion)); + queryParameters.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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -27813,7 +31041,7 @@ function _listConnectionStringsSlot(resourceGroupName, name, slot, options, call return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -27841,41 +31069,41 @@ function _listConnectionStringsSlot(resourceGroupName, name, slot, options, call // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @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. * - * Gets the logging configuration of an app. + * 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 get the logging configuration for the production - * slot. + * specified, the API will add or update connections for the production slot. * * @param {object} [options] Optional Parameters. * @@ -27889,13 +31117,13 @@ function _listConnectionStringsSlot(resourceGroupName, name, slot, options, call * {Error} 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. + * 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 _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, options, callback) { +function _updateSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -27905,7 +31133,6 @@ function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -27928,12 +31155,18 @@ function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, opti if (name === 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.'); } @@ -27943,20 +31176,20 @@ function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, opti // 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'; + 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(apiVersion)); + queryParameters.push('api-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 = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -27974,7 +31207,21 @@ function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, opti } } } - httpRequest.body = null; + // 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) { @@ -27991,12 +31238,13 @@ function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, opti try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -28016,118 +31264,35 @@ function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, opti parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteLogsConfig']().mapper(); + 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 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. + let deserializationError = new Error(`Error ${error} occurred in 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. * - * @param {object} [siteLogsConfig.detailedErrorMessages] Detailed error - * messages configuration. + * Gets the configuration of an app, such as platform version and bitness, + * default documents, virtual applications, Always On, etc. * - * @param {boolean} [siteLogsConfig.detailedErrorMessages.enabled] True if - * configuration is enabled, false if it is disabled and null if configuration - * is not set. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {string} [siteLogsConfig.kind] Kind of resource. + * @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 logging configuration for the production - * slot. + * specified, the API will return configuration for the production slot. * * @param {object} [options] Optional Parameters. * @@ -28141,13 +31306,13 @@ function _getDiagnosticLogsConfigurationSlot(resourceGroupName, name, slot, 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 SiteLogsConfig} for more information. + * 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 _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig, slot, options, callback) { +function _getConfigurationSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -28157,7 +31322,6 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -28180,15 +31344,15 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig if (name === 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.'); } @@ -28198,20 +31362,20 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig // 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'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -28229,21 +31393,7 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -28260,12 +31410,13 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -28285,7 +31436,7 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteLogsConfig']().mapper(); + let resultMapper = new client.models['SiteConfigResource']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -28301,24 +31452,238 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig } /** - * @summary Replaces the metadata of an app. + * @summary Updates the configuration of an app. * - * Replaces the metadata 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} metadata Edited metadata of the app or deployment slot. See + * @param {object} siteConfig JSON representation of a SiteConfig object. See * example. * - * @param {object} [metadata.properties] Settings. + * @param {number} [siteConfig.numberOfWorkers] Number of workers. * - * @param {string} [metadata.kind] Kind of resource. + * @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 {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 the metadata for the production slot. + * specified, the API will update configuration for the production slot. * * @param {object} [options] Optional Parameters. * @@ -28332,13 +31697,13 @@ function _updateDiagnosticLogsConfigSlot(resourceGroupName, name, siteLogsConfig * {Error} 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. + * 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 _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, callback) { +function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -28348,7 +31713,6 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -28371,8 +31735,8 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, c if (name === 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 (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.'); @@ -28380,6 +31744,9 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, c if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -28389,13 +31756,13 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, c // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -28424,14 +31791,14 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, c 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'); + 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(metadata, null, 2)}.`); + `payload - ${JSON.stringify(siteConfig, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -28451,12 +31818,13 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, c try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -28476,7 +31844,7 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, c parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['StringDictionary']().mapper(); + let resultMapper = new client.models['SiteConfigResource']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -28492,17 +31860,238 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, options, c } /** - * @summary Gets the metadata of an app. + * @summary Updates the configuration of an app. * - * Gets the metadata 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 {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 get the metadata for the production slot. + * specified, the API will update configuration for the production slot. * * @param {object} [options] Optional Parameters. * @@ -28516,13 +32105,13 @@ function _updateMetadataSlot(resourceGroupName, name, metadata, slot, 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 StringDictionary} for more information. + * 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 _listMetadataSlot(resourceGroupName, name, slot, options, callback) { +function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -28532,7 +32121,6 @@ function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -28555,12 +32143,18 @@ function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { if (name === 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.'); } @@ -28570,20 +32164,20 @@ function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { // 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'; + 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(apiVersion)); + queryParameters.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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -28601,7 +32195,21 @@ function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { } } } - httpRequest.body = null; + // 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) { @@ -28618,12 +32226,13 @@ function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -28643,7 +32252,7 @@ function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['StringDictionary']().mapper(); + let resultMapper = new client.models['SiteConfigResource']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -28658,11 +32267,12 @@ function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { }); } - /** - * @summary Gets the Git/FTP publishing credentials of an app. + * @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 the Git/FTP publishing credentials of an app. + * 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. @@ -28670,8 +32280,7 @@ function _listMetadataSlot(resourceGroupName, name, slot, options, callback) { * @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. + * specified, the API will return configuration for the production slot. * * @param {object} [options] Optional Parameters. * @@ -28685,50 +32294,138 @@ function _listMetadataSlot(resourceGroupName, name, slot, 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 User} for more information. + * 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 _listPublishingCredentialsSlot(resourceGroupName, name, slot, options, callback) { +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); + } - // 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; + // 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('&'); + } - httpRequest = pollingResult.request; - response = pollingResult.response; - let responseBody = pollingResult.body; + // Create HTTP transport objects + let httpRequest = new WebResource(); + httpRequest.method = 'GET'; + httpRequest.url = requestUrl; + httpRequest.headers = {}; + // Set Headers + httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; + if (this.client.generateClientRequestId) { + httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); + } + if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { + httpRequest.headers['accept-language'] = this.client.acceptLanguage; + } + if(options) { + for(let headerName in options['customHeaders']) { + if (options['customHeaders'].hasOwnProperty(headerName)) { + httpRequest.headers[headerName] = options['customHeaders'][headerName]; + } + } + } + httpRequest.body = null; + // Send Request + return client.pipeline(httpRequest, (err, response, responseBody) => { + if (err) { + return callback(err); + } + let statusCode = response.statusCode; + if (statusCode !== 200) { + let error = new Error(responseBody); + error.statusCode = response.statusCode; + error.request = msRest.stripRequest(httpRequest); + error.response = msRest.stripResponse(response); if (responseBody === '') responseBody = null; - - // Deserialize Response + let parsedErrorResponse; + try { + parsedErrorResponse = JSON.parse(responseBody); + if (parsedErrorResponse) { + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; + } + if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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(); + let resultMapper = new client.models['SiteConfigurationSnapshotInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -28737,46 +32434,27 @@ function _listPublishingCredentialsSlot(resourceGroupName, name, slot, options, deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } + } - return callback(null, result, httpRequest, response); - }); + return callback(null, result, httpRequest, response); }); } /** - * @summary Updates the Push settings associated with web app. + * @summary Gets a snapshot of the configuration of an app at a previous point + * in time. * - * Updates the Push settings associated with web app. + * 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 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} name Name of the app. * - * @param {string} [pushSettings.kind] Kind of resource. + * @param {string} snapshotId The ID of the snapshot to read. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -28790,13 +32468,13 @@ function _listPublishingCredentialsSlot(resourceGroupName, name, slot, 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 PushSettings} for more information. + * 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 _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, options, callback) { +function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -28806,7 +32484,6 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -28829,8 +32506,8 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot if (name === 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 (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.'); @@ -28838,6 +32515,9 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -28847,20 +32527,21 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot // 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'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -28878,21 +32559,7 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -28909,12 +32576,13 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -28934,7 +32602,7 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PushSettings']().mapper(); + let resultMapper = new client.models['SiteConfigResource']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -28950,17 +32618,19 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot } /** - * @summary Gets the Push settings associated with web app. + * @summary Reverts the configuration of an app to a previous snapshot. * - * Gets the Push settings associated with web app. + * 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 web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -28973,14 +32643,13 @@ function _updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot * * {Error} 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [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) { +function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -28990,7 +32659,6 @@ function _listSitePushSettingsSlot(resourceGroupName, name, slot, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -29013,12 +32681,18 @@ function _listSitePushSettingsSlot(resourceGroupName, name, slot, options, callb if (name === 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.'); } @@ -29028,13 +32702,14 @@ function _listSitePushSettingsSlot(resourceGroupName, name, slot, options, callb // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -29066,7 +32741,7 @@ function _listSitePushSettingsSlot(resourceGroupName, name, slot, options, callb 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); @@ -29094,42 +32769,23 @@ function _listSitePushSettingsSlot(resourceGroupName, name, slot, options, callb // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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 configuration of an app, such as platform version and - * bitness, default documents, virtual applications, Always On, etc. + * @summary Gets the last lines of docker logs for the given site * - * Gets the configuration of an app, such as platform version and bitness, - * default documents, virtual applications, Always On, etc. + * 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 the app. + * @param {string} name Name of web 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 {string} slot Name of web app slot. If not specified then will + * default to production slot. * * @param {object} [options] Optional Parameters. * @@ -29143,13 +32799,12 @@ function _listSitePushSettingsSlot(resourceGroupName, name, slot, 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 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) { +function _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -29159,7 +32814,6 @@ function _getConfigurationSlot(resourceGroupName, name, slot, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -29188,6 +32842,9 @@ function _getConfigurationSlot(resourceGroupName, name, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -29197,20 +32854,20 @@ function _getConfigurationSlot(resourceGroupName, name, slot, options, callback) // 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'; + 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(apiVersion)); + queryParameters.push('api-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 @@ -29230,20 +32887,22 @@ function _getConfigurationSlot(resourceGroupName, name, slot, options, callback) } 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) { - let error = new Error(responseBody); + 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 { - parsedErrorResponse = JSON.parse(responseBody); + if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; @@ -29260,241 +32919,25 @@ function _getConfigurationSlot(resourceGroupName, name, slot, options, callback) } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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); - } - } + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } /** - * @summary Updates the configuration of an app. + * @summary Gets the ZIP archived docker log files for the given site * - * Updates the configuration of an app. + * 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 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 {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 {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 {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. - * - * @param {string} [siteConfig.kind] Kind of resource. + * @param {string} name Name of web app. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will update configuration for the production slot. + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. * * @param {object} [options] Optional Parameters. * @@ -29508,13 +32951,12 @@ function _getConfigurationSlot(resourceGroupName, name, slot, 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 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) { +function _getContainerLogsZipSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -29524,7 +32966,6 @@ function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, s if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -29547,15 +32988,15 @@ function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, s if (name === 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.'); } @@ -29565,20 +33006,20 @@ function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, s // 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'; + 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(apiVersion)); + queryParameters.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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -29596,36 +33037,24 @@ function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, s } } } - // 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; + 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) { - let error = new Error(responseBody); + 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 { - parsedErrorResponse = JSON.parse(responseBody); + if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; @@ -29642,241 +33071,25 @@ function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, s } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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); - } - } + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } /** - * @summary Updates the configuration of an app. + * @summary List continuous web jobs for an app, or a deployment slot. * - * Updates the configuration of an app. + * 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 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 {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 {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 {array} [siteConfig.ipSecurityRestrictions] IP security restrictions. - * - * @param {string} [siteConfig.kind] Kind of resource. + * @param {string} name Site name. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will update configuration for the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -29890,13 +33103,14 @@ function _createOrUpdateConfigurationSlot(resourceGroupName, name, siteConfig, s * {Error} 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. + * 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 _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, options, callback) { +function _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -29906,7 +33120,6 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -29929,15 +33142,15 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, opt if (name === 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.'); } @@ -29947,20 +33160,20 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, opt // 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'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -29978,21 +33191,7 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, opt } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -30009,12 +33208,13 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, opt try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -30034,7 +33234,7 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, opt parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigResource']().mapper(); + let resultMapper = new client.models['ContinuousWebJobCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -30050,19 +33250,20 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, opt } /** - * @summary Gets a list of web app configuration snapshots identifiers. Each - * element of the list contains a timestamp and the ID of the snapshot. + * @summary Gets a continuous web job by its ID for an app, or a deployment + * slot. * - * 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 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 Name of the app. + * @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 will return configuration for the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -30076,14 +33277,13 @@ function _updateConfigurationSlot(resourceGroupName, name, siteConfig, slot, 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 SiteConfigurationSnapshotInfoCollection} for - * more information. + * 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 _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, options, callback) { +function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -30093,7 +33293,6 @@ function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -30116,12 +33315,18 @@ function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, optio if (name === 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.'); } @@ -30131,13 +33336,14 @@ function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, optio // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -30169,7 +33375,7 @@ function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, optio return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -30204,7 +33410,7 @@ function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, optio parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigurationSnapshotInfoCollection']().mapper(); + let resultMapper = new client.models['ContinuousWebJob']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -30220,20 +33426,20 @@ function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, optio } /** - * @summary Gets a snapshot of the configuration of an app at a previous point - * in time. + * @summary Delete a continuous web job by its ID for an app, or a deployment + * slot. * - * Gets a snapshot of the configuration of an app at a previous point in time. + * 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 Name of the app. + * @param {string} name Site name. * - * @param {string} snapshotId The ID of the snapshot to read. + * @param {string} webJobName Name of Web Job. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will return configuration for the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -30246,14 +33452,13 @@ function _listConfigurationSnapshotInfoSlot(resourceGroupName, name, slot, 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 SiteConfigResource} 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 _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot, options, callback) { +function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -30263,7 +33468,6 @@ function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -30286,8 +33490,8 @@ function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot if (name === 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 (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.'); @@ -30295,6 +33499,9 @@ function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -30304,21 +33511,21 @@ function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot // 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}'; + 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('{snapshotId}', encodeURIComponent(snapshotId)); + 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(apiVersion)); + queryParameters.push('api-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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -30343,7 +33550,7 @@ function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot 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); @@ -30371,42 +33578,182 @@ function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = 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 { - 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'); + parsedErrorResponse = JSON.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); }); } /** - * @summary Reverts the configuration of an app to a previous snapshot. + * @summary Stop a continuous web job for an app, or a deployment slot. * - * Reverts the configuration of an app to a previous snapshot. + * 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 Name of the app. + * @param {string} name Site name. * - * @param {string} snapshotId The ID of the snapshot to read. + * @param {string} webJobName Name of Web Job. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will return configuration for the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -30425,7 +33772,7 @@ function _getConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshotId, slot, options, callback) { +function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -30435,7 +33782,6 @@ function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshot if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -30458,8 +33804,8 @@ function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshot if (name === 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 (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.'); @@ -30467,6 +33813,9 @@ function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshot if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -30476,14 +33825,14 @@ function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshot // 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'; + 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('{snapshotId}', encodeURIComponent(snapshotId)); + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -30515,7 +33864,7 @@ function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshot return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -30549,17 +33898,17 @@ function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshot } /** - * @summary Gets the last lines of docker logs for the given site + * @summary List deployments for an app, or a deployment slot. * - * Gets the last lines of docker logs for the given site + * 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 web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -30573,12 +33922,13 @@ function _recoverSiteConfigurationSnapshotSlot(resourceGroupName, name, snapshot * {Error} 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 _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, callback) { +function _listDeploymentsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -30588,7 +33938,6 @@ function _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -30617,6 +33966,9 @@ function _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, ca if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -30626,20 +33978,20 @@ function _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -30659,29 +34011,28 @@ function _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, ca } 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}`); + if (statusCode !== 200) { + let error = new Error(responseBody); 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); + parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -30691,25 +34042,45 @@ function _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, options, ca } return callback(error); } - // Create Result - let result = response; + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Gets the ZIP archived docker log files for the given site + * @summary Get a deployment by its ID for an app, or a deployment slot. * - * Gets the ZIP archived docker log files for the given site + * 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 web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -30723,12 +34094,13 @@ function _getWebSiteContainerLogsSlot(resourceGroupName, name, slot, 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 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 _getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, callback) { +function _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -30738,7 +34110,6 @@ function _getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -30761,12 +34132,18 @@ function _getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, if (name === 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.'); } @@ -30776,20 +34153,21 @@ function _getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, // 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'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -30809,29 +34187,28 @@ function _getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, } 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}`); + if (statusCode !== 200) { + let error = new Error(responseBody); 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); + parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -30841,25 +34218,68 @@ function _getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, } return callback(error); } - // Create Result - let result = response; + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 List continuous web jobs for an app, or a deployment slot. + * @summary Create a deployment for an app, or a deployment slot. * - * List continuous web jobs 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 Site name. + * @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 deletes a deployment for the production slot. + * 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. * @@ -30873,14 +34293,13 @@ function _getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, 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 ContinuousWebJobCollection} for more - * information. + * 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 _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, callback) { +function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -30890,7 +34309,6 @@ function _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -30913,12 +34331,21 @@ function _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, call if (name === 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.'); } @@ -30928,20 +34355,21 @@ function _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs'; + 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(apiVersion)); + queryParameters.push('api-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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -30959,7 +34387,21 @@ function _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, call } } } - httpRequest.body = null; + // 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) { @@ -30976,12 +34418,13 @@ function _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, call try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -31001,7 +34444,7 @@ function _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ContinuousWebJobCollection']().mapper(); + let resultMapper = new client.models['Deployment']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -31017,17 +34460,16 @@ function _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, call } /** - * @summary Gets a continuous web job by its ID for an app, or a deployment - * slot. + * @summary Delete a deployment 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. + * 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 Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @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. @@ -31043,14 +34485,13 @@ function _listContinuousWebJobsSlot(resourceGroupName, name, slot, options, call * * {Error} 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [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) { +function _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -31060,7 +34501,6 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -31083,8 +34523,8 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, opt if (name === 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.'); @@ -31092,6 +34532,9 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, opt if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -31101,21 +34544,21 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, opt // 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}'; + 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('{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(apiVersion)); + queryParameters.push('api-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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -31140,7 +34583,7 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, opt return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -31168,43 +34611,29 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, opt // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @summary List deployment log for specific deployment for an app, or a + * deployment slot. * - * Delete a continuous web job by its ID 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 Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @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 deletes a deployment for the production slot. + * specified, the API returns deployments for the production slot. * * @param {object} [options] Optional Parameters. * @@ -31217,13 +34646,14 @@ function _getContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, opt * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -31233,7 +34663,6 @@ function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -31256,8 +34685,8 @@ function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, if (name === 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.'); @@ -31265,6 +34694,9 @@ function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -31274,21 +34706,21 @@ function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, // 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}'; + 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('{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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -31313,7 +34745,7 @@ function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -31323,12 +34755,13 @@ function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -31341,25 +34774,84 @@ function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Start a continuous web job for an app, or a deployment slot. + * @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. * - * Start a continuous web job for an app, or a deployment slot. + * 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 Site name. + * @param {string} name Name of the app. * - * @param {string} webJobName Name of Web Job. + * @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 deletes a deployment for the production slot. + * specified, the API will perform discovery for the production slot. * * @param {object} [options] Optional Parameters. * @@ -31372,13 +34864,14 @@ function _deleteContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _discoverBackupSlot(resourceGroupName, name, request, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -31388,7 +34881,6 @@ function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -31411,8 +34903,8 @@ function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, o if (name === 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 (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.'); @@ -31420,6 +34912,9 @@ function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, o if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -31429,14 +34924,13 @@ function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, o // 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'; + 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('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -31461,14 +34955,28 @@ function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, o } } } - httpRequest.body = null; + // 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 !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -31478,12 +34986,13 @@ function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, o try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -31496,25 +35005,40 @@ function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, 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['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 Stop a continuous web job for an app, or a deployment slot. + * @summary Lists ownership identifiers for domain associated with web app. * - * Stop a continuous web job for an app, or a deployment slot. + * 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 Site name. - * - * @param {string} webJobName Name of Web Job. + * @param {string} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. + * specified, the API will delete the binding for the production slot. * * @param {object} [options] Optional Parameters. * @@ -31527,13 +35051,14 @@ function _startContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, o * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { +function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -31543,7 +35068,6 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -31566,15 +35090,15 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op if (name === 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.'); } @@ -31584,21 +35108,20 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op // 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'; + 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('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -31623,7 +35146,7 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -31633,12 +35156,13 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -31651,23 +35175,43 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 deployments for an app, or a deployment slot. + * @summary Get domain ownership identifier for web app. * - * List deployments for an app, or a deployment slot. + * 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 returns deployments for the production slot. + * specified, the API will delete the binding for the production slot. * * @param {object} [options] Optional Parameters. * @@ -31681,13 +35225,13 @@ function _stopContinuousWebJobSlot(resourceGroupName, name, webJobName, slot, op * {Error} 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. + * 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 _listDeploymentsSlot(resourceGroupName, name, slot, options, callback) { +function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -31697,7 +35241,6 @@ function _listDeploymentsSlot(resourceGroupName, name, slot, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -31720,12 +35263,18 @@ function _listDeploymentsSlot(resourceGroupName, name, slot, options, callback) if (name === 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.'); } @@ -31735,13 +35284,14 @@ function _listDeploymentsSlot(resourceGroupName, name, slot, options, callback) // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -31783,12 +35333,13 @@ function _listDeploymentsSlot(resourceGroupName, name, slot, options, callback) try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -31808,7 +35359,7 @@ function _listDeploymentsSlot(resourceGroupName, name, slot, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DeploymentCollection']().mapper(); + let resultMapper = new client.models['Identifier']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -31824,19 +35375,30 @@ function _listDeploymentsSlot(resourceGroupName, name, slot, options, callback) } /** - * @summary Get a deployment by its ID for an app, or a deployment slot. + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. * - * Get a deployment by its ID for an app, or a deployment slot. + * 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} id Deployment ID. + * @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 gets a deployment for the production slot. + * specified, the API will delete the binding for the production slot. * * @param {object} [options] Optional Parameters. * @@ -31850,13 +35412,13 @@ function _listDeploymentsSlot(resourceGroupName, name, slot, 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 Deployment} for more information. + * 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 _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback) { +function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -31866,7 +35428,6 @@ function _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -31889,8 +35450,11 @@ function _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback if (name === 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 (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.'); @@ -31898,6 +35462,9 @@ function _getDeploymentSlot(resourceGroupName, name, id, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -31907,21 +35474,21 @@ function _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback // 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}'; + 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('{id}', encodeURIComponent(id)); + 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(apiVersion)); + queryParameters.push('api-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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -31939,7 +35506,21 @@ function _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback } } } - httpRequest.body = null; + // 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) { @@ -31956,12 +35537,13 @@ function _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -31981,7 +35563,7 @@ function _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Deployment']().mapper(); + let resultMapper = new client.models['Identifier']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -31997,44 +35579,20 @@ function _getDeploymentSlot(resourceGroupName, name, id, slot, options, callback } /** - * @summary Create a deployment for an app, or a deployment slot. + * @summary Deletes a domain ownership identifier for a web app. * - * Create a deployment for an app, or a deployment slot. + * 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} id ID of an existing deployment. + * @param {string} domainOwnershipIdentifierName Name of domain ownership + * identifier. * * @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 {string} [deployment.deploymentId] Identifier for deployment. - * - * @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. + * specified, the API will delete the binding for the production slot. * * @param {object} [options] Optional Parameters. * @@ -32047,14 +35605,13 @@ function _getDeploymentSlot(resourceGroupName, name, id, slot, 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 Deployment} 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 _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, options, callback) { +function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -32064,7 +35621,6 @@ function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -32087,18 +35643,18 @@ function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, op if (name === 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 (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 (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.'); } @@ -32108,21 +35664,21 @@ function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, op // 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}'; + 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('{id}', encodeURIComponent(id)); + 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(apiVersion)); + queryParameters.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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -32140,28 +35696,14 @@ function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, op } } } - // 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; + httpRequest.body = null; // 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 !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -32189,42 +35731,36 @@ function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, op // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @summary Creates a domain ownership identifier for web app, or updates an + * existing ownership identifier. * - * Delete a deployment by its ID for an app, or a deployment slot. + * 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} id Deployment ID. + * @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 deletes a deployment for the production slot. + * specified, the API will delete the binding for the production slot. * * @param {object} [options] Optional Parameters. * @@ -32237,13 +35773,14 @@ function _createDeploymentSlot(resourceGroupName, name, id, slot, deployment, op * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callback) { +function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -32253,7 +35790,6 @@ function _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -32276,8 +35812,11 @@ function _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callb if (name === 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 (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.'); @@ -32285,6 +35824,9 @@ function _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callb if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -32294,21 +35836,21 @@ function _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callb // 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}'; + 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('{id}', encodeURIComponent(id)); + 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(apiVersion)); + queryParameters.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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -32326,14 +35868,28 @@ function _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callb } } } - httpRequest.body = null; + // 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 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -32343,12 +35899,13 @@ function _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callb try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -32361,29 +35918,40 @@ function _deleteDeploymentSlot(resourceGroupName, name, id, slot, options, callb // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 List deployment log for specific deployment for an app, or a - * deployment slot. + * @summary Get the status of the last MSDeploy operation. * - * List deployment log for specific deployment for an app, or a deployment - * slot. + * 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 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} name Name of web app. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. * * @param {object} [options] Optional Parameters. * @@ -32397,13 +35965,13 @@ function _deleteDeploymentSlot(resourceGroupName, name, id, slot, 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 Deployment} for more information. + * 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 _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, callback) { +function _getMSDeployStatusSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -32413,7 +35981,6 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -32436,15 +36003,15 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, call if (name === 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.'); } @@ -32454,14 +36021,13 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, call // 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'; + 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('{id}', encodeURIComponent(id)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -32503,12 +36069,13 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, call try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -32528,7 +36095,7 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Deployment']().mapper(); + let resultMapper = new client.models['MSDeployStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -32543,18 +36110,47 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, call }); } + /** - * @summary Lists ownership identifiers for domain associated with web app. + * @summary Invoke the MSDeploy web app extension. * - * Lists ownership identifiers for domain associated with web app. + * Invoke the MSDeploy web app extension. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name Name of web 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} 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. * @@ -32568,13 +36164,96 @@ function _listDeploymentLogSlot(resourceGroupName, name, id, slot, options, call * {Error} 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. + * 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 _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, options, callback) { +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') { @@ -32584,7 +36263,6 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -32613,6 +36291,9 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, opti if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -32622,13 +36303,13 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, opti // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -32660,7 +36341,7 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, opti return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -32695,7 +36376,7 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, opti parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['IdentifierCollection']().mapper(); + let resultMapper = new client.models['MSDeployLog']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -32711,20 +36392,17 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, opti } /** - * @summary Get domain ownership identifier for web app. + * @summary List the functions for a web site, or a deployment slot. * - * Get domain ownership identifier for web app. + * 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 Name of the app. - * - * @param {string} domainOwnershipIdentifierName Name of domain ownership - * identifier. + * @param {string} name Site name. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will delete the binding for the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -32738,13 +36416,14 @@ function _listDomainOwnershipIdentifiersSlot(resourceGroupName, name, slot, 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 Identifier} for more information. + * 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 _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, slot, options, callback) { +function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -32754,7 +36433,6 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -32777,15 +36455,15 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners if (name === 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.'); } @@ -32795,14 +36473,13 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners // 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}'; + 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('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -32834,7 +36511,7 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -32869,7 +36546,7 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Identifier']().mapper(); + let resultMapper = new client.models['FunctionEnvelopeCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -32885,30 +36562,17 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners } /** - * @summary Creates a domain ownership identifier for web app, or updates an - * existing ownership identifier. + * @summary Fetch a short lived token that can be exchanged for a master key. * - * Creates a domain ownership identifier for web app, or updates an existing - * ownership identifier. + * 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 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} name Name of web 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} slot Name of web app slot. If not specified then will + * default to production slot. * * @param {object} [options] Optional Parameters. * @@ -32921,14 +36585,13 @@ function _getDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwners * * {Error} 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. + * {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 _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, options, callback) { +function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -32938,7 +36601,6 @@ function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, d if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -32961,18 +36623,15 @@ function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, d if (name === 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.'); } @@ -32982,21 +36641,20 @@ function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, d // 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}'; + 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('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -33014,21 +36672,7 @@ function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, d } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -33045,12 +36689,13 @@ function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, d try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -33070,7 +36715,13 @@ function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, d parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['Identifier']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -33086,20 +36737,20 @@ function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, d } /** - * @summary Deletes a domain ownership identifier for a web app. + * @summary Get function information by its ID for web site, or a deployment + * slot. * - * Deletes a domain ownership identifier for a web app. + * 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 Name of the app. + * @param {string} name Site name. * - * @param {string} domainOwnershipIdentifierName Name of domain ownership - * identifier. + * @param {string} functionName Function name. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will delete the binding for the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -33112,13 +36763,14 @@ function _createOrUpdateDomainOwnershipIdentifierSlot(resourceGroupName, name, d * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, slot, options, callback) { +function _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -33128,7 +36780,6 @@ function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -33151,8 +36802,8 @@ function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn if (name === 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 (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.'); @@ -33160,6 +36811,9 @@ function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -33169,21 +36823,21 @@ function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn // 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}'; + 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('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -33208,7 +36862,7 @@ function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -33236,36 +36890,66 @@ function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Creates a domain ownership identifier for web app, or updates an - * existing ownership identifier. + * @summary Create function for web site, or a deployment slot. * - * Creates a domain ownership identifier for web app, or updates an existing - * ownership identifier. + * 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 Name of the app. + * @param {string} name Site name. * - * @param {string} domainOwnershipIdentifierName Name of domain ownership - * identifier. + * @param {string} functionName Function name. * - * @param {object} domainOwnershipIdentifier A JSON representation of the - * domain ownership properties. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API deletes a deployment for the production slot. * - * @param {string} [domainOwnershipIdentifier.identifierId] String - * representation of the identity. + * @param {object} functionEnvelope Function details. * - * @param {string} [domainOwnershipIdentifier.kind] Kind of resource. + * @param {string} [functionEnvelope.functionAppId] Function App ID. * - * @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} [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. * @@ -33279,13 +36963,97 @@ function _deleteDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn * {Error} 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. + * 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 _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot, options, callback) { +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') { @@ -33295,7 +37063,6 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -33318,11 +37085,8 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn if (name === 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 (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.'); @@ -33330,6 +37094,9 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -33339,21 +37106,21 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn // 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}'; + 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('{domainOwnershipIdentifierName}', encodeURIComponent(domainOwnershipIdentifierName)); + 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(apiVersion)); + queryParameters.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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -33371,28 +37138,14 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 204 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -33420,40 +37173,26 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @summary Get function secrets for a function in a web site, or a deployment + * slot. * - * Get the status of the last MSDeploy operation. + * 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 Name of web app. + * @param {string} name Site name. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -33467,13 +37206,13 @@ function _updateDomainOwnershipIdentifierSlot(resourceGroupName, name, domainOwn * {Error} 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. + * 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 _getMSDeployStatusSlot(resourceGroupName, name, slot, options, callback) { +function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -33483,7 +37222,6 @@ function _getMSDeployStatusSlot(resourceGroupName, name, slot, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -33506,12 +37244,18 @@ function _getMSDeployStatusSlot(resourceGroupName, name, slot, options, callback if (name === 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.'); } @@ -33521,20 +37265,21 @@ function _getMSDeployStatusSlot(resourceGroupName, name, slot, options, callback // 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'; + 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(apiVersion)); + queryParameters.push('api-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 @@ -33569,12 +37314,13 @@ function _getMSDeployStatusSlot(resourceGroupName, name, slot, options, callback try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -33594,7 +37340,7 @@ function _getMSDeployStatusSlot(resourceGroupName, name, slot, options, callback parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MSDeployStatus']().mapper(); + let resultMapper = new client.models['FunctionSecrets']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -33609,130 +37355,18 @@ function _getMSDeployStatusSlot(resourceGroupName, name, slot, options, callback }); } - -/** - * @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. + * @summary Get hostname bindings for an app or a deployment slot. * - * Get the MSDeploy Log for the last MSDeploy operation. + * 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 web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -33746,13 +37380,14 @@ function _createMSDeployOperationSlot(resourceGroupName, name, slot, mSDeploy, 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 MSDeployLog} for more information. + * 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 _getMSDeployLogSlot(resourceGroupName, name, slot, options, callback) { +function _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -33762,7 +37397,6 @@ function _getMSDeployLogSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -33791,6 +37425,9 @@ function _getMSDeployLogSlot(resourceGroupName, name, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -33800,13 +37437,13 @@ function _getMSDeployLogSlot(resourceGroupName, name, slot, options, callback) { // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -33838,7 +37475,7 @@ function _getMSDeployLogSlot(resourceGroupName, name, slot, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -33848,12 +37485,13 @@ function _getMSDeployLogSlot(resourceGroupName, name, slot, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -33873,7 +37511,7 @@ function _getMSDeployLogSlot(resourceGroupName, name, slot, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MSDeployLog']().mapper(); + let resultMapper = new client.models['HostNameBindingCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -33889,17 +37527,21 @@ function _getMSDeployLogSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary List the functions for a web site, or a deployment slot. + * @summary Get the named hostname binding for an app (or deployment slot, if + * specified). * - * List the functions for a web site, or a deployment slot. + * 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 Site name. + * @param {string} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. + * specified, the API the named binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. * * @param {object} [options] Optional Parameters. * @@ -33913,14 +37555,13 @@ function _getMSDeployLogSlot(resourceGroupName, name, slot, 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 FunctionEnvelopeCollection} for more - * information. + * 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 _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, callback) { +function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -33930,7 +37571,6 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -33956,9 +37596,15 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, call if (slot === 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.'); } @@ -33968,13 +37614,14 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -34006,7 +37653,7 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, call return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -34016,12 +37663,13 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, call try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -34041,7 +37689,7 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionEnvelopeCollection']().mapper(); + let resultMapper = new client.models['HostNameBinding']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -34057,17 +37705,45 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, call } /** - * @summary Fetch a short lived token that can be exchanged for a master key. + * @summary Creates a hostname binding for an app. * - * Fetch a short lived token that can be exchanged for a master key. + * 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 web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -34080,13 +37756,14 @@ function _listInstanceFunctionsSlot(resourceGroupName, name, slot, options, call * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [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 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 _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, callback) { +function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, hostNameBinding, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -34096,7 +37773,6 @@ function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -34119,12 +37795,21 @@ function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, cal if (name === 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.'); } @@ -34134,20 +37819,21 @@ function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, cal // 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'; + 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(apiVersion)); + queryParameters.push('api-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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -34165,7 +37851,21 @@ function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, cal } } } - httpRequest.body = null; + // 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) { @@ -34182,12 +37882,13 @@ function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, cal try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -34207,13 +37908,7 @@ function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, cal parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; + let resultMapper = new client.models['HostNameBinding']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -34229,20 +37924,19 @@ function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, options, cal } /** - * @summary Get function information by its ID for web site, or a deployment - * slot. + * @summary Deletes a hostname binding for an app. * - * Get function information by its ID for web site, or a deployment slot. + * Deletes a hostname binding for an app. * * @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} name Name of the app. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. + * specified, the API will delete the binding for the production slot. + * + * @param {string} hostName Hostname in the hostname binding. * * @param {object} [options] Optional Parameters. * @@ -34255,14 +37949,13 @@ function _getFunctionsAdminTokenSlot(resourceGroupName, name, slot, 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 FunctionEnvelope} 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 _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, callback) { +function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -34272,7 +37965,6 @@ function _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -34295,15 +37987,18 @@ function _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, o if (name === 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 (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.'); } @@ -34313,21 +38008,21 @@ function _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, o // 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}'; + 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('{functionName}', encodeURIComponent(functionName)); 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(apiVersion)); + queryParameters.push('api-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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -34352,7 +38047,7 @@ function _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, o return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 204) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -34380,64 +38075,27 @@ function _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, 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['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. + * @summary Retrieves a specific Service Bus Hybrid Connection used by this Web + * App. * - * Create function for web site, or a deployment slot. + * 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 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.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 {string} name The name of the web app. * - * @param {object} [functionEnvelope.files] File list. + * @param {string} namespaceName The namespace for this hybrid connection. * - * @param {string} [functionEnvelope.testData] Test data used when testing via - * the Azure Portal. + * @param {string} relayName The relay name for this hybrid connection. * - * @param {string} [functionEnvelope.kind] Kind of resource. + * @param {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. * @@ -34451,97 +38109,13 @@ function _getInstanceFunctionSlot(resourceGroupName, name, functionName, slot, 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 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. + * 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 _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot, options, callback) { +function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -34551,7 +38125,6 @@ function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -34574,8 +38147,11 @@ function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot if (name === 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 (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.'); @@ -34583,6 +38159,9 @@ function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -34592,21 +38171,22 @@ function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot // 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}'; + 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('{functionName}', encodeURIComponent(functionName)); + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -34631,7 +38211,7 @@ function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -34641,12 +38221,13 @@ function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -34659,26 +38240,71 @@ function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Get function secrets for a function in a web site, or a deployment - * slot. + * @summary Creates a new Hybrid Connection using a Service Bus relay. * - * Get function secrets for a function in a web site, or a deployment slot. + * 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 Site name. + * @param {string} name The name of the web app. * - * @param {string} functionName Function name. + * @param {string} namespaceName The namespace for this hybrid connection. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. + * @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. * @@ -34692,13 +38318,13 @@ function _deleteInstanceFunctionSlot(resourceGroupName, name, functionName, slot * {Error} 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. + * 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 _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, options, callback) { +function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -34708,7 +38334,6 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -34731,8 +38356,14 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, o if (name === 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 (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.'); @@ -34740,6 +38371,9 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, o if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -34749,21 +38383,22 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, o // 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'; + 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('{functionName}', encodeURIComponent(functionName)); + 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(apiVersion)); + queryParameters.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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -34781,7 +38416,21 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, o } } } - httpRequest.body = null; + // 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) { @@ -34798,12 +38447,13 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, o try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -34823,7 +38473,7 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, o parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionSecrets']().mapper(); + let resultMapper = new client.models['HybridConnection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -34839,17 +38489,20 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, o } /** - * @summary Get hostname bindings for an app or a deployment slot. + * @summary Removes a Hybrid Connection from this site. * - * Get hostname bindings for an app or a deployment slot. + * Removes a Hybrid Connection from this site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name The name of the web 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 {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. * @@ -34862,15 +38515,13 @@ function _listFunctionSecretsSlot(resourceGroupName, name, functionName, slot, 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 HostNameBindingCollection} 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 _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callback) { +function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -34880,7 +38531,6 @@ function _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -34903,12 +38553,21 @@ function _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callb if (name === 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.'); } @@ -34918,20 +38577,22 @@ function _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings'; + 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(apiVersion)); + queryParameters.push('api-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 = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -34956,7 +38617,7 @@ function _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callb return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -34984,44 +38645,54 @@ function _listHostNameBindingsSlot(resourceGroupName, name, slot, options, callb // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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). + * @summary Creates a new Hybrid Connection using a Service Bus relay. * - * Get the named hostname binding for an app (or deployment slot, if - * specified). + * 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 Name of the app. + * @param {string} name The name of the web 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} namespaceName The namespace for this hybrid connection. * - * @param {string} hostName Hostname in the hostname binding. + * @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. * @@ -35035,13 +38706,13 @@ function _listHostNameBindingsSlot(resourceGroupName, name, slot, 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 HostNameBinding} for more information. + * 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 _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, callback) { +function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -35051,7 +38722,6 @@ function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -35074,15 +38744,24 @@ function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, option if (name === 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 (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.'); } @@ -35092,21 +38771,22 @@ function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, option // 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}'; + 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('{hostName}', encodeURIComponent(hostName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -35124,7 +38804,21 @@ function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, option } } } - httpRequest.body = null; + // 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) { @@ -35141,12 +38835,13 @@ function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, option try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -35166,7 +38861,7 @@ function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, option parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HostNameBinding']().mapper(); + let resultMapper = new client.models['HybridConnection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -35182,45 +38877,20 @@ function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, option } /** - * @summary Creates a hostname binding for an app. + * @summary Gets the send key name and value for a Hybrid Connection. * - * Creates a hostname binding for an app. + * 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 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} name The name of the web app. * - * @param {string} [hostNameBinding.thumbprint] SSL certificate thumbprint + * @param {string} namespaceName The namespace for this hybrid connection. * - * @param {string} [hostNameBinding.kind] Kind of resource. + * @param {string} relayName The relay name for this hybrid connection. * - * @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 {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. * @@ -35234,13 +38904,13 @@ function _getHostNameBindingSlot(resourceGroupName, name, slot, hostName, 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 HostNameBinding} for more information. + * 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 _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, hostNameBinding, slot, options, callback) { +function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, relayName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -35250,7 +38920,6 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -35273,11 +38942,11 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h if (name === 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 (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 (hostNameBinding === null || hostNameBinding === undefined) { - throw new Error('hostNameBinding cannot be null or undefined.'); + 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.'); @@ -35285,6 +38954,9 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -35294,21 +38966,22 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h // 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}'; + 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('{hostName}', encodeURIComponent(hostName)); + 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(apiVersion)); + queryParameters.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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -35326,21 +38999,7 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -35357,12 +39016,13 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -35382,7 +39042,7 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HostNameBinding']().mapper(); + let resultMapper = new client.models['HybridConnectionKey']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -35398,19 +39058,16 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h } /** - * @summary Deletes a hostname binding for an app. + * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. * - * Deletes a hostname binding for an 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 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} name The name of the web app. * - * @param {string} hostName Hostname in the hostname binding. + * @param {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. * @@ -35423,13 +39080,14 @@ function _createOrUpdateHostNameBindingSlot(resourceGroupName, name, hostName, h * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, options, callback) { +function _listHybridConnectionsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -35439,7 +39097,6 @@ function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -35465,12 +39122,12 @@ function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, opt if (slot === 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.'); } @@ -35480,21 +39137,20 @@ function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, opt // 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}'; + 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('{hostName}', encodeURIComponent(hostName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -35519,7 +39175,7 @@ function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, opt return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -35529,12 +39185,13 @@ function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, opt try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -35547,27 +39204,42 @@ function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, opt // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Retrieves a specific Service Bus Hybrid Connection used by this Web - * App. + * @summary Gets hybrid connections configured for an app (or deployment slot, + * if specified). * - * Retrieves a specific Service Bus Hybrid Connection used by this Web App. + * 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 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} name Name of the app. * - * @param {string} slot The name of the slot for the web 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. * @@ -35581,13 +39253,14 @@ function _deleteHostNameBindingSlot(resourceGroupName, name, slot, hostName, 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 HybridConnection} for more information. + * 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 _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, callback) { +function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -35597,7 +39270,6 @@ function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayN if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -35620,18 +39292,15 @@ function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayN if (name === 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.'); } @@ -35641,15 +39310,13 @@ function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayN // 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}'; + 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('{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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -35691,12 +39358,13 @@ function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayN try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -35716,7 +39384,7 @@ function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayN parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HybridConnection']().mapper(); + let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -35732,48 +39400,19 @@ function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayN } /** - * @summary Creates a new Hybrid Connection using a Service Bus relay. + * @summary Gets a hybrid connection configuration by its name. * - * Creates a new Hybrid Connection using a Service Bus relay. + * Gets a hybrid connection configuration by its name. * * @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} name Name of the app. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} entityName Name of the hybrid connection. * - * @param {string} slot The name of the slot for the web app. + * @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. * @@ -35787,13 +39426,14 @@ function _getHybridConnectionSlot(resourceGroupName, name, namespaceName, relayN * {Error} 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. + * 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 _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot, options, callback) { +function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -35803,7 +39443,6 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -35826,14 +39465,8 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN if (name === 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 (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.'); @@ -35841,6 +39474,9 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -35850,22 +39486,21 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN // 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}'; + 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('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -35883,21 +39518,7 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -35914,12 +39535,13 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -35939,7 +39561,7 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HybridConnection']().mapper(); + let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -35955,20 +39577,41 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN } /** - * @summary Removes a Hybrid Connection from this site. + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). * - * Removes a Hybrid Connection from this site. + * 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 The name of the web app. + * @param {string} name Name of the app. * - * @param {string} namespaceName The namespace for this hybrid connection. + * @param {string} entityName Name of the hybrid connection configuration. * - * @param {string} relayName The relay name for this hybrid connection. + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. * - * @param {string} slot The name of the slot for the web app. + * @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. * @@ -35981,13 +39624,15 @@ function _createOrUpdateHybridConnectionSlot(resourceGroupName, name, namespaceN * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, relayName, slot, options, callback) { +function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -35997,7 +39642,6 @@ function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, rel if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -36020,11 +39664,11 @@ function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, rel if (name === 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 (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 (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.'); @@ -36032,6 +39676,9 @@ function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, rel if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -36041,22 +39688,21 @@ function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, rel // 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}'; + 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('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + 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(apiVersion)); + queryParameters.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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -36074,14 +39720,28 @@ function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, rel } } } - httpRequest.body = null; + // 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 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -36091,12 +39751,13 @@ function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, rel try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -36109,54 +39770,42 @@ function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, rel // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 using a Service Bus relay. + * @summary Deletes a relay service connection by its name. * - * Creates a new Hybrid Connection using a Service Bus relay. + * Deletes a relay service connection by its name. * * @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} name Name of the app. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} entityName Name of the hybrid connection configuration. * - * @param {string} slot The name of the slot for the web app. + * @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. * @@ -36169,14 +39818,13 @@ function _deleteHybridConnectionSlot(resourceGroupName, name, namespaceName, rel * * {Error} 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [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) { +function _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -36186,7 +39834,6 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -36209,14 +39856,8 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel if (name === 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 (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.'); @@ -36224,6 +39865,9 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -36233,22 +39877,21 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel // 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}'; + 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('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + 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(apiVersion)); + queryParameters.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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -36266,28 +39909,14 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel } } } - // 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; + httpRequest.body = null; // 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 !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -36315,43 +39944,47 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @summary Creates a new hybrid connection configuration (PUT), or updates an + * existing one (PATCH). * - * Gets the send key name and value for a Hybrid Connection. + * 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 The name of the web app. + * @param {string} name Name of the app. * - * @param {string} namespaceName The namespace for this hybrid connection. + * @param {string} entityName Name of the hybrid connection configuration. * - * @param {string} relayName The relay name for this hybrid connection. + * @param {object} connectionEnvelope Details of the hybrid connection + * configuration. * - * @param {string} slot The name of the slot for the web app. + * @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. * @@ -36365,13 +39998,14 @@ function _updateHybridConnectionSlot(resourceGroupName, name, namespaceName, rel * {Error} 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. + * 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 _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, relayName, slot, options, callback) { +function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -36381,7 +40015,6 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -36404,11 +40037,11 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r if (name === 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 (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 (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.'); @@ -36416,6 +40049,9 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -36425,22 +40061,21 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r // 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'; + 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('{namespaceName}', encodeURIComponent(namespaceName)); - requestUrl = requestUrl.replace('{relayName}', encodeURIComponent(relayName)); + 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(apiVersion)); + queryParameters.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.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -36458,7 +40093,21 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r } } } - httpRequest.body = null; + // 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) { @@ -36475,12 +40124,13 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -36500,7 +40150,7 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HybridConnectionKey']().mapper(); + let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -36516,16 +40166,17 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r } /** - * @summary Retrieves all Service Bus Hybrid Connections used by this Web App. + * @summary Gets all scale-out instances of an app. * - * Retrieves all Service Bus Hybrid Connections used by this Web 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 The name of the web app. + * @param {string} name Name of the app. * - * @param {string} slot The name of the slot for the web 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. * @@ -36539,13 +40190,14 @@ function _listHybridConnectionKeysSlot(resourceGroupName, name, namespaceName, r * {Error} 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. + * 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 _listHybridConnectionsSlot(resourceGroupName, name, slot, options, callback) { +function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -36555,7 +40207,6 @@ function _listHybridConnectionsSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -36584,6 +40235,9 @@ function _listHybridConnectionsSlot(resourceGroupName, name, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -36593,13 +40247,13 @@ function _listHybridConnectionsSlot(resourceGroupName, name, slot, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -36641,12 +40295,13 @@ function _listHybridConnectionsSlot(resourceGroupName, name, slot, options, call try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -36666,7 +40321,7 @@ function _listHybridConnectionsSlot(resourceGroupName, name, slot, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HybridConnection']().mapper(); + let resultMapper = new client.models['WebAppInstanceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -36682,19 +40337,19 @@ function _listHybridConnectionsSlot(resourceGroupName, name, slot, options, call } /** - * @summary Gets hybrid connections configured for an app (or deployment slot, - * if specified). + * @summary Get the status of the last MSDeploy operation. * - * Gets hybrid connections configured for an app (or deployment slot, if - * specified). + * 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 the app. + * @param {string} name Name of web 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 {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. * @@ -36708,14 +40363,13 @@ function _listHybridConnectionsSlot(resourceGroupName, name, slot, options, call * {Error} 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. + * 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 _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options, callback) { +function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -36725,7 +40379,6 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -36751,9 +40404,15 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options if (slot === 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.'); } @@ -36763,13 +40422,14 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -36811,12 +40471,13 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -36836,7 +40497,7 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); + let resultMapper = new client.models['MSDeployStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -36851,20 +40512,49 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, options }); } + /** - * @summary Gets a hybrid connection configuration by its name. + * @summary Invoke the MSDeploy web app extension. * - * Gets a hybrid connection configuration by its name. + * Invoke the MSDeploy web app extension. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name Name of web app. * - * @param {string} entityName Name of the hybrid connection. + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. * - * @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 {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. * @@ -36878,14 +40568,98 @@ function _listRelayServiceConnectionsSlot(resourceGroupName, name, slot, 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 RelayServiceConnectionEntity} for more - * information. + * 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 _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, callback) { +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') { @@ -36895,7 +40669,6 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slo if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -36918,15 +40691,18 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slo if (name === 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 (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.'); } @@ -36936,14 +40712,14 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slo // 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}'; + 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('{entityName}', encodeURIComponent(entityName)); 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -36975,7 +40751,7 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slo return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -37010,7 +40786,7 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slo parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); + let resultMapper = new client.models['MSDeployLog']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -37026,41 +40802,23 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slo } /** - * @summary Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). + * 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 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} name Site name. * * @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. + * 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. * @@ -37074,14 +40832,13 @@ function _getRelayServiceConnectionSlot(resourceGroupName, name, entityName, slo * {Error} 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. + * 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 _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, entityName, connectionEnvelope, slot, options, callback) { +function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -37091,7 +40848,6 @@ function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, enti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -37114,18 +40870,18 @@ function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, enti if (name === 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 (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.'); } @@ -37135,21 +40891,21 @@ function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, enti // 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}'; + 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('{entityName}', encodeURIComponent(entityName)); 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -37167,28 +40923,14 @@ function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, enti } } } - // 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; + httpRequest.body = null; // 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 !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -37223,7 +40965,7 @@ function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, enti parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RelayServiceConnectionEntity']().mapper(); + let resultMapper = new client.models['ProcessInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -37239,19 +40981,25 @@ function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, enti } /** - * @summary Deletes a relay service connection by its name. + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. * - * Deletes a relay service connection by its name. + * 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 Name of the app. + * @param {string} name Site name. * - * @param {string} entityName Name of the hybrid connection configuration. + * @param {string} processId PID. * * @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. + * 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. * @@ -37264,13 +41012,14 @@ function _createOrUpdateRelayServiceConnectionSlot(resourceGroupName, name, enti * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, slot, options, callback) { +function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -37280,7 +41029,6 @@ function _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -37303,15 +41051,21 @@ function _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, if (name === 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 (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.'); } @@ -37321,21 +41075,22 @@ function _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, // 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}'; + 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('{entityName}', encodeURIComponent(entityName)); + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -37388,47 +41143,48 @@ function _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Creates a new hybrid connection configuration (PUT), or updates an - * existing one (PATCH). + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. * - * Creates a new hybrid connection configuration (PUT), or updates an existing - * one (PATCH). + * 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 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} name Site name. * - * @param {string} [connectionEnvelope.kind] Kind of resource. + * @param {string} processId PID. * * @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. + * 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. * @@ -37441,15 +41197,13 @@ function _deleteRelayServiceConnectionSlot(resourceGroupName, name, entityName, * * {Error} 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [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) { +function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -37459,7 +41213,6 @@ function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -37482,18 +41235,21 @@ function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, if (name === 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 (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.'); } @@ -37503,21 +41259,22 @@ function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, // 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}'; + 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('{entityName}', encodeURIComponent(entityName)); + 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(apiVersion)); + queryParameters.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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -37535,28 +41292,14 @@ function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 204 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -37584,40 +41327,31 @@ function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @summary Get a memory dump of a process by its ID for a specific scaled-out + * instance in a web site. * - * Gets all scale-out instances of an app. + * 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 Name of the app. + * @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 gets the production slot instances. + * 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. * @@ -37631,14 +41365,12 @@ function _updateRelayServiceConnectionSlot(resourceGroupName, name, entityName, * {Error} 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) { +function _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -37648,7 +41380,6 @@ function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -37671,12 +41402,21 @@ function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, ca if (name === 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.'); } @@ -37686,13 +41426,15 @@ function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, ca // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -37719,20 +41461,22 @@ function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, ca } 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) { - let error = new Error(responseBody); + 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 { - parsedErrorResponse = JSON.parse(responseBody); + if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; @@ -37749,45 +41493,33 @@ function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, options, ca } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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); - } - } + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } /** - * @summary Get the status of the last MSDeploy operation. + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. * - * Get the status of the last MSDeploy operation. + * 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 Name of web app. + * @param {string} name Site name. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @param {string} processId PID. * - * @param {string} instanceId ID of web app instance. + * @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. * @@ -37801,13 +41533,14 @@ function _listInstanceIdentifiersSlot(resourceGroupName, name, slot, 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 MSDeployStatus} for more information. + * 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 _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceId, options, callback) { +function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -37817,7 +41550,6 @@ function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceI if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -37840,6 +41572,9 @@ function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceI if (name === 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.'); } @@ -37849,6 +41584,9 @@ function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceI if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -37858,14 +41596,15 @@ function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceI // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -37897,7 +41636,7 @@ function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceI return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -37932,7 +41671,7 @@ function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceI parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MSDeployStatus']().mapper(); + let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -37947,134 +41686,28 @@ function _getInstanceMsDeployStatusSlot(resourceGroupName, name, slot, instanceI }); } - /** - * @summary Invoke the MSDeploy web app extension. + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. * - * Invoke the MSDeploy web app extension. + * 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 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} name Site name. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {string} processId PID. * - * @param {string} name Name of web app. + * @param {string} baseAddress Module base address. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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 web app instance. + * @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. * @@ -38088,13 +41721,13 @@ function _createInstanceMSDeployOperationSlot(resourceGroupName, name, slot, ins * {Error} 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. + * 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 _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, options, callback) { +function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -38104,7 +41737,6 @@ function _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -38127,6 +41759,12 @@ function _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, if (name === 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.'); } @@ -38136,6 +41774,9 @@ function _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -38145,14 +41786,16 @@ function _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -38219,7 +41862,7 @@ function _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MSDeployLog']().mapper(); + let resultMapper = new client.models['ProcessModuleInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -38235,17 +41878,19 @@ function _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, } /** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. + * @summary List the threads in a process by its ID 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. + * 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. * @@ -38265,13 +41910,14 @@ function _getInstanceMSDeployLogSlot(resourceGroupName, name, slot, instanceId, * {Error} 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. + * 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 _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, options, callback) { +function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -38281,7 +41927,6 @@ function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -38304,6 +41949,9 @@ function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, o if (name === 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.'); } @@ -38313,6 +41961,9 @@ function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, o if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -38322,14 +41973,15 @@ function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, o // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -38396,7 +42048,7 @@ function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, o parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfoCollection']().mapper(); + let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -38412,11 +42064,11 @@ function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, o } /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. + * @summary Get thread information by Thread ID for a specific process, in 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. + * 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. @@ -38425,6 +42077,8 @@ function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, o * * @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. * @@ -38444,13 +42098,13 @@ function _listInstanceProcessesSlot(resourceGroupName, name, slot, instanceId, 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 ProcessInfo} for more information. + * 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 _getInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { +function _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -38460,7 +42114,6 @@ function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, insta if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -38486,6 +42139,9 @@ function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, insta 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.'); } @@ -38495,6 +42151,9 @@ function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, insta if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -38504,15 +42163,16 @@ function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, insta // 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}'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -38579,7 +42239,7 @@ function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, insta parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfo']().mapper(); + let resultMapper = new client.models['ProcessThreadInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -38595,25 +42255,19 @@ function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, insta } /** - * @summary Terminate a process by its ID for a web site, or a deployment slot, - * or specific scaled-out instance in a web site. + * @summary Shows whether an app can be cloned to another resource group or + * subscription. * - * Terminate a process by its ID for a web site, or a deployment slot, or - * specific scaled-out instance in a web site. + * 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 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} name Name of the app. * - * @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 {string} slot Name of the deployment slot. By default, this API + * returns information on the production slot. * * @param {object} [options] Optional Parameters. * @@ -38626,13 +42280,14 @@ function _getInstanceProcessSlot(resourceGroupName, name, processId, slot, insta * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { +function _isCloneableSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -38642,7 +42297,6 @@ function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, in if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -38665,18 +42319,15 @@ function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, in if (name === 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.'); } @@ -38686,22 +42337,20 @@ function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, in // 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}'; + 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('{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(apiVersion)); + queryParameters.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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -38726,7 +42375,7 @@ function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, in return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -38736,12 +42385,13 @@ function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, in try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -38754,31 +42404,40 @@ function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, in // Create Result let result = null; if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 Get a memory dump of a process by its ID for a specific scaled-out - * instance in a web site. + * @summary This is to allow calling via powershell and ARM template. * - * Get a memory dump of a process by its ID for a specific scaled-out instance - * in a web site. + * 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 Site name. - * - * @param {string} processId PID. + * @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 {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". + * specified, the API will restore a backup of the production slot. * * @param {object} [options] Optional Parameters. * @@ -38792,12 +42451,13 @@ function _deleteInstanceProcessSlot(resourceGroupName, name, processId, slot, in * {Error} 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 _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { +function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -38807,7 +42467,6 @@ function _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, i if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -38830,18 +42489,15 @@ function _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, i if (name === 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.'); } @@ -38851,22 +42507,20 @@ function _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, i // 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'; + 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('{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(apiVersion)); + queryParameters.push('api-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 @@ -38886,29 +42540,28 @@ function _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, i } 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}`); + if (statusCode !== 200) { + let error = new Error(responseBody); 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); + parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -38918,33 +42571,44 @@ function _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, i } return callback(error); } - // Create Result - let result = response; + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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 List module information for a process by its ID for a specific - * scaled-out instance in a web site. + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. + * 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 Site name. - * - * @param {string} processId PID. + * @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 {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". + * specified, the API will get metric definitions of the production slot. * * @param {object} [options] Optional Parameters. * @@ -38958,14 +42622,14 @@ function _getInstanceProcessDumpSlot(resourceGroupName, name, processId, slot, i * {Error} 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 + * 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 _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { +function _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -38975,7 +42639,6 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slo if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -38998,18 +42661,15 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slo if (name === 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.'); } @@ -39019,15 +42679,13 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slo // 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'; + 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('{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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -39059,7 +42717,7 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slo return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -39069,12 +42727,13 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slo try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -39094,7 +42753,7 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slo parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); + let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -39110,30 +42769,29 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slo } /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). * - * Get process information by its ID for a specific scaled-out instance in a - * web site. + * 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 Site name. - * - * @param {string} processId PID. - * - * @param {string} baseAddress Module base address. + * @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 {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". + * 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 * @@ -39144,13 +42802,14 @@ function _listInstanceProcessModulesSlot(resourceGroupName, name, processId, slo * {Error} 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. + * 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 _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, instanceId, options, callback) { +function _listMetricsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -39160,7 +42819,8 @@ function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseA if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; + 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') { @@ -39183,21 +42843,21 @@ function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseA if (name === 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 (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.'); } @@ -39207,16 +42867,19 @@ function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseA // 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}'; + 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('{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(apiVersion)); + 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('&'); } @@ -39248,7 +42911,7 @@ function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseA return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -39258,12 +42921,13 @@ function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseA try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -39283,7 +42947,7 @@ function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseA parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfo']().mapper(); + let resultMapper = new client.models['ResourceMetricCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -39299,25 +42963,18 @@ function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseA } /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. + * @summary Returns the status of MySql in app migration, if one is active, and + * whether or not MySql in app is enabled * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. + * 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 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} name Name of web app. * - * @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 {string} slot Name of the deployment slot. * * @param {object} [options] Optional Parameters. * @@ -39331,14 +42988,13 @@ function _getInstanceProcessModuleSlot(resourceGroupName, name, processId, baseA * {Error} 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. + * 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 _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slot, instanceId, options, callback) { +function _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -39348,7 +43004,6 @@ function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slo if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -39371,18 +43026,15 @@ function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slo if (name === 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.'); } @@ -39392,15 +43044,13 @@ function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slo // 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'; + 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('{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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -39432,7 +43082,7 @@ function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slo return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -39442,12 +43092,13 @@ function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slo try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -39467,7 +43118,7 @@ function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slo parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); + let resultMapper = new client.models['MigrateMySqlStatus']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -39483,27 +43134,22 @@ function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slo } /** - * @summary Get thread information by Thread ID for a specific process, in a - * specific scaled-out instance in a web site. + * @summary Gets all network features used by the app (or deployment slot, if + * specified). * - * Get thread information by Thread ID for a specific process, in a specific - * scaled-out instance in a web site. + * 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 Site name. - * - * @param {string} processId PID. + * @param {string} name Name of the app. * - * @param {string} threadId TID. + * @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 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". + * specified, the API will get network features for the production slot. * * @param {object} [options] Optional Parameters. * @@ -39517,13 +43163,13 @@ function _listInstanceProcessThreadsSlot(resourceGroupName, name, processId, slo * {Error} 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. + * 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 _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, instanceId, options, callback) { +function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -39533,7 +43179,6 @@ function _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -39556,21 +43201,18 @@ function _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threa if (name === 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 (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 (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.'); } @@ -39580,16 +43222,14 @@ function _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threa // 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}'; + 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('{processId}', encodeURIComponent(processId)); - requestUrl = requestUrl.replace('{threadId}', encodeURIComponent(threadId)); + requestUrl = requestUrl.replace('{view}', encodeURIComponent(view)); 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -39656,7 +43296,7 @@ function _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threa parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfo']().mapper(); + let resultMapper = new client.models['NetworkFeatures']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -39672,22 +43312,27 @@ function _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threa } /** - * @summary Shows whether an app can be cloned to another resource group or - * subscription. + * @summary Start capturing network packets for the site. * - * Shows whether an app can be cloned to another resource group or - * subscription. + * Start capturing network packets for the site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name The name of the web app. * - * @param {string} slot Name of the deployment slot. By default, this API - * returns information on the production slot. + * @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 * @@ -39697,14 +43342,13 @@ function _getInstanceProcessThreadSlot(resourceGroupName, name, processId, threa * * {Error} 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. + * {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 _isCloneableSlot(resourceGroupName, name, slot, options, callback) { +function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -39714,7 +43358,9 @@ function _isCloneableSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; + 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') { @@ -39737,12 +43383,24 @@ function _isCloneableSlot(resourceGroupName, name, slot, options, callback) { if (name === 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.'); } @@ -39752,13 +43410,22 @@ function _isCloneableSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/iscloneable'; + 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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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('&'); } @@ -39800,12 +43467,13 @@ function _isCloneableSlot(resourceGroupName, name, slot, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -39825,7 +43493,13 @@ function _isCloneableSlot(resourceGroupName, name, slot, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteCloneability']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -39841,17 +43515,16 @@ function _isCloneableSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary This is to allow calling via powershell and ARM template. + * @summary Stop ongoing capturing network packets for the site. * - * This is to allow calling via powershell and ARM template. + * Stop ongoing capturing network packets for the site. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @param {string} name The name of the web 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 {string} slot The name of the slot for this web app. * * @param {object} [options] Optional Parameters. * @@ -39864,14 +43537,13 @@ function _isCloneableSlot(resourceGroupName, name, slot, 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 FunctionSecrets} for more information. + * {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 _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, callback) { +function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -39881,7 +43553,6 @@ function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -39910,6 +43581,9 @@ function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, c if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -39919,13 +43593,13 @@ function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, c // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listsyncfunctiontriggerstatus'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -39967,12 +43641,13 @@ function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, c try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -39992,7 +43667,13 @@ function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, c parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionSecrets']().mapper(); + let resultMapper = { + required: false, + serializedName: 'parsedResponse', + type: { + name: 'String' + } + }; result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -40008,10 +43689,11 @@ function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, c } /** - * @summary Gets all metric definitions of an app (or deployment slot, if - * specified). + * @summary Generates a new publishing password for an app (or deployment slot, + * if specified). * - * Gets all metric definitions of 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. @@ -40019,7 +43701,8 @@ function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, options, c * @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. + * specified, the API generate a new publishing password for the production + * slot. * * @param {object} [options] Optional Parameters. * @@ -40032,15 +43715,13 @@ function _listSyncFunctionTriggersSlot(resourceGroupName, name, slot, 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 ResourceMetricDefinitionCollection} 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 _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, callback) { +function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -40050,7 +43731,6 @@ function _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -40079,6 +43759,9 @@ function _listMetricDefinitionsSlot(resourceGroupName, name, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -40088,20 +43771,20 @@ function _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, call // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/metricdefinitions'; + 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(apiVersion)); + queryParameters.push('api-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 @@ -40126,7 +43809,7 @@ function _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, call 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); @@ -40154,51 +43837,30 @@ function _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, call // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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). + * @summary Gets perfmon counters for web app. * - * Gets performance metrics of an app (or deployment slot, if specified). + * Gets perfmon counters 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} name Name of web 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 {string} slot Name of web app slot. If not specified then will + * default to 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 {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 @@ -40210,14 +43872,14 @@ function _listMetricDefinitionsSlot(resourceGroupName, name, slot, options, call * {Error} 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 + * 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 _listMetricsSlot(resourceGroupName, name, slot, options, callback) { +function _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -40227,9 +43889,7 @@ function _listMetricsSlot(resourceGroupName, name, slot, options, callback) { 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; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -40255,15 +43915,15 @@ function _listMetricsSlot(resourceGroupName, name, slot, options, callback) { if (slot === 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.'); } @@ -40273,19 +43933,16 @@ function _listMetricsSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/metrics'; + 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 (details !== null && details !== undefined) { - queryParameters.push('details=' + encodeURIComponent(details.toString())); - } 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('&'); } @@ -40327,12 +43984,13 @@ function _listMetricsSlot(resourceGroupName, name, slot, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -40352,7 +44010,7 @@ function _listMetricsSlot(resourceGroupName, name, slot, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricCollection']().mapper(); + let resultMapper = new client.models['PerfMonCounterCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -40368,18 +44026,17 @@ function _listMetricsSlot(resourceGroupName, name, slot, options, callback) { } /** - * @summary Returns the status of MySql in app migration, if one is active, and - * whether or not MySql in app is enabled + * @summary Gets web app's event logs. * - * Returns the status of MySql in app migration, if one is active, and whether - * or not MySql in app is enabled + * 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 the deployment slot. + * @param {string} slot Name of web app slot. If not specified then will + * default to production slot. * * @param {object} [options] Optional Parameters. * @@ -40393,13 +44050,13 @@ function _listMetricsSlot(resourceGroupName, name, slot, 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 MigrateMySqlStatus} for more information. + * 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 _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, callback) { +function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -40409,7 +44066,6 @@ function _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -40438,6 +44094,9 @@ function _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -40447,13 +44106,13 @@ function _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, call // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -40495,12 +44154,13 @@ function _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, call try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -40520,7 +44180,7 @@ function _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['MigrateMySqlStatus']().mapper(); + let resultMapper = new client.models['SitePhpErrorLogFlag']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -40536,22 +44196,17 @@ function _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, call } /** - * @summary Gets all network features used by the app (or deployment slot, if - * specified). + * @summary Gets the premier add-ons of an app. * - * Gets all network features used by the app (or deployment slot, if - * specified). + * 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} 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. + * specified, the API will get the premier add-ons for the production slot. * * @param {object} [options] Optional Parameters. * @@ -40565,13 +44220,13 @@ function _getMigrateMySqlStatusSlot(resourceGroupName, name, slot, options, call * {Error} 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. + * 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 _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, callback) { +function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -40581,7 +44236,6 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -40604,15 +44258,15 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, if (name === 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.'); } @@ -40622,14 +44276,13 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, // 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}'; + 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('{view}', encodeURIComponent(view)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -40661,7 +44314,7 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -40671,12 +44324,13 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -40696,7 +44350,7 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['NetworkFeatures']().mapper(); + let resultMapper = new client.models['PremierAddOn']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -40712,26 +44366,21 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, } /** - * @summary Start capturing network packets for the site. + * @summary Gets a named add-on of an app. * - * Start capturing network packets for the site. + * Gets a named add-on of an 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 this web app. - * - * @param {object} [options] Optional Parameters. + * @param {string} name Name of the app. * - * @param {number} [options.durationInSeconds] The duration to keep capturing - * in seconds. + * @param {string} premierAddOnName Add-on name. * - * @param {number} [options.maxFrameLength] The maximum frame length in bytes - * (Optional). + * @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 {string} [options.sasUrl] The Blob URL to store capture file. + * @param {object} [options] Optional Parameters. * * @param {object} [options.customHeaders] Headers that will be added to the * request @@ -40742,13 +44391,14 @@ function _listNetworkFeaturesSlot(resourceGroupName, name, view, slot, options, * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [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 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 _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, callback) { +function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -40758,10 +44408,6 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, c 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; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -40784,21 +44430,18 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, c if (name === 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 (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 (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.'); } @@ -40808,29 +44451,21 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, c // 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'; + 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 = []; - 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -40865,12 +44500,13 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, c try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -40890,13 +44526,7 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, c parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; + let resultMapper = new client.models['PremierAddOn']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -40912,16 +44542,40 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, c } /** - * @summary Stop ongoing capturing network packets for the site. + * @summary Updates a named add-on of an app. * - * Stop ongoing capturing network packets for the site. + * Updates a named add-on of an 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} name Name of the app. * - * @param {string} slot The name of the slot for this web 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. * @@ -40934,13 +44588,14 @@ function _startWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, c * * {Error} err - The Error object if an error occurred, null otherwise. * - * {string} [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 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 _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, callback) { +function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -40950,7 +44605,6 @@ function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -40973,12 +44627,21 @@ function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, ca if (name === 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.'); } @@ -40988,20 +44651,21 @@ function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, ca // 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'; + 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(apiVersion)); + queryParameters.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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -41019,7 +44683,21 @@ function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, ca } } } - httpRequest.body = null; + // 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) { @@ -41036,12 +44714,13 @@ function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, ca try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -41061,13 +44740,7 @@ function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, ca parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'String' - } - }; + let resultMapper = new client.models['PremierAddOn']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -41083,20 +44756,19 @@ function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, ca } /** - * @summary Generates a new publishing password for an app (or deployment slot, - * if specified). + * @summary Delete a premier add-on from an app. * - * Generates a new publishing password for an app (or deployment slot, if - * specified). + * 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 generate a new publishing password for the production - * slot. + * specified, the API will delete the named add-on for the production slot. * * @param {object} [options] Optional Parameters. * @@ -41115,7 +44787,7 @@ function _stopWebSiteNetworkTraceSlot(resourceGroupName, name, slot, options, ca * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, options, callback) { +function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -41125,7 +44797,6 @@ function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -41148,12 +44819,18 @@ function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, o if (name === 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.'); } @@ -41163,20 +44840,21 @@ function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, o // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/newpassword'; + 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(apiVersion)); + queryParameters.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.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -41201,7 +44879,7 @@ function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, o return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -41235,24 +44913,38 @@ function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, o } /** - * @summary Gets perfmon counters for web app. + * @summary Updates a named add-on of an app. * - * Gets perfmon counters for web 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 web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @param {string} premierAddOnName Add-on name. * - * @param {object} [options] Optional Parameters. + * @param {object} premierAddOn A JSON representation of the edited premier + * add-on. * - * @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 {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 @@ -41264,14 +44956,13 @@ function _generateNewSitePublishingPasswordSlot(resourceGroupName, name, slot, 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 PerfMonCounterCollection} for more - * information. + * 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 _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callback) { +function _updatePremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -41281,8 +44972,6 @@ function _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -41305,15 +44994,21 @@ function _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callba if (name === 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 (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.'); } @@ -41323,23 +45018,21 @@ function _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callba // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/perfcounters'; + 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 = []; - 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'PATCH'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -41357,7 +45050,21 @@ function _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callba } } } - httpRequest.body = null; + // 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) { @@ -41374,12 +45081,13 @@ function _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callba try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -41399,7 +45107,7 @@ function _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callba parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PerfMonCounterCollection']().mapper(); + let resultMapper = new client.models['PremierAddOn']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -41415,17 +45123,18 @@ function _listPerfMonCountersSlot(resourceGroupName, name, slot, options, callba } /** - * @summary Gets web app's event logs. + * @summary Gets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Gets web app's event logs. + * 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 Name of web app. + * @param {string} name The name of the web app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @param {string} slot The name of the slot for the web app. * * @param {object} [options] Optional Parameters. * @@ -41439,13 +45148,13 @@ function _listPerfMonCountersSlot(resourceGroupName, name, slot, 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 SitePhpErrorLogFlag} for more information. + * 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 _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, callback) { +function _getPrivateAccessSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -41455,7 +45164,6 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -41484,6 +45192,9 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -41493,13 +45204,13 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/phplogging'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -41541,12 +45252,13 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -41566,7 +45278,7 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SitePhpErrorLogFlag']().mapper(); + let resultMapper = new client.models['PrivateAccess']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -41582,17 +45294,27 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, options, cal } /** - * @summary Gets the premier add-ons of an app. + * @summary Sets data around private site access enablement and authorized + * Virtual Networks that can access the site. * - * Gets the premier add-ons of an app. + * 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 Name of the app. + * @param {string} name The name of the web 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} 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. * @@ -41606,13 +45328,13 @@ function _getSitePhpErrorLogFlagSlot(resourceGroupName, name, slot, 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 PremierAddOn} for more information. + * 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 _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback) { +function _putPrivateAccessVnetSlot(resourceGroupName, name, access, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -41622,7 +45344,6 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -41645,12 +45366,18 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback if (name === 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.'); } @@ -41660,20 +45387,20 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons'; + 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(apiVersion)); + queryParameters.push('api-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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -41691,7 +45418,21 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback } } } - httpRequest.body = null; + // 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) { @@ -41708,12 +45449,13 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -41733,7 +45475,7 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PremierAddOn']().mapper(); + let resultMapper = new client.models['PrivateAccess']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -41749,19 +45491,19 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, options, callback } /** - * @summary Gets a named add-on of an app. + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. * - * Gets a named add-on of an app. + * 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 Name of the app. - * - * @param {string} premierAddOnName Add-on name. + * @param {string} name Site 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. + * specified, the API returns deployments for the production slot. * * @param {object} [options] Optional Parameters. * @@ -41775,13 +45517,13 @@ function _listPremierAddOnsSlot(resourceGroupName, name, slot, 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 PremierAddOn} for more information. + * 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 _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, callback) { +function _listProcessesSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -41791,7 +45533,6 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -41814,15 +45555,15 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, o if (name === 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.'); } @@ -41832,14 +45573,13 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, o // 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}'; + 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('{premierAddOnName}', encodeURIComponent(premierAddOnName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -41871,7 +45611,7 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, o return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -41906,7 +45646,7 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, o parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PremierAddOn']().mapper(); + let resultMapper = new client.models['ProcessInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -41922,46 +45662,21 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, o } /** - * @summary Updates a named add-on of an app. + * @summary Get process information by its ID for a specific scaled-out + * instance in a web site. * - * Updates a named add-on of an app. + * 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 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.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * - * @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 {string} name Site name. * - * @param {object} [premierAddOn.tags] Resource tags. + * @param {string} processId PID. * * @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. + * specified, the API returns deployments for the production slot. * * @param {object} [options] Optional Parameters. * @@ -41975,13 +45690,13 @@ function _getPremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, 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 PremierAddOn} for more information. + * 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 _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premierAddOn, slot, options, callback) { +function _getProcessSlot(resourceGroupName, name, processId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -41991,7 +45706,6 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -42014,11 +45728,8 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier if (name === 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 (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.'); @@ -42026,6 +45737,9 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -42035,21 +45749,21 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier // 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}'; + 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('{premierAddOnName}', encodeURIComponent(premierAddOnName)); + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -42067,28 +45781,14 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier } } } - // 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; + httpRequest.body = null; // 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 !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -42123,7 +45823,7 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PremierAddOn']().mapper(); + let resultMapper = new client.models['ProcessInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -42139,19 +45839,21 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier } /** - * @summary Delete a premier add-on from an app. + * @summary Terminate a process by its ID for a web site, or a deployment slot, + * or specific scaled-out instance in a web site. * - * Delete a premier add-on from an app. + * 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 Name of the app. + * @param {string} name Site name. * - * @param {string} premierAddOnName Add-on name. + * @param {string} processId PID. * * @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. + * specified, the API returns deployments for the production slot. * * @param {object} [options] Optional Parameters. * @@ -42170,7 +45872,7 @@ function _addPremierAddOnSlot(resourceGroupName, name, premierAddOnName, premier * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot, options, callback) { +function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -42180,7 +45882,6 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -42203,8 +45904,8 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot if (name === 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 (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.'); @@ -42212,6 +45913,9 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -42221,14 +45925,14 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot // 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}'; + 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('{premierAddOnName}', encodeURIComponent(premierAddOnName)); + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -42260,7 +45964,7 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 204 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -42294,17 +45998,19 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot } /** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. + * @summary Get a memory dump of a process by its ID 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. + * 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. * @@ -42320,13 +46026,12 @@ function _deletePremierAddOnSlot(resourceGroupName, name, premierAddOnName, slot * {Error} 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) { +function _getProcessDumpSlot(resourceGroupName, name, processId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -42336,7 +46041,6 @@ function _listProcessesSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -42359,12 +46063,18 @@ function _listProcessesSlot(resourceGroupName, name, slot, options, callback) { if (name === 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.'); } @@ -42374,13 +46084,14 @@ function _listProcessesSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -42407,20 +46118,22 @@ function _listProcessesSlot(resourceGroupName, name, slot, options, callback) { } 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(responseBody); + 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 { - parsedErrorResponse = JSON.parse(responseBody); + if (responseBody !== undefined) parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; @@ -42437,37 +46150,19 @@ function _listProcessesSlot(resourceGroupName, name, slot, options, callback) { } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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); - } - } + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. + * @summary List module information for a process 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. + * 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. @@ -42491,13 +46186,14 @@ function _listProcessesSlot(resourceGroupName, name, slot, 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 ProcessInfo} for more information. + * 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 _getProcessSlot(resourceGroupName, name, processId, slot, options, callback) { +function _listProcessModulesSlot(resourceGroupName, name, processId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -42507,7 +46203,6 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -42539,6 +46234,9 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -42548,14 +46246,14 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, options, call // 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}'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -42622,7 +46320,7 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfo']().mapper(); + let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -42638,11 +46336,11 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, options, call } /** - * @summary Terminate a process by its ID for a web site, or a deployment slot, - * or specific scaled-out instance in a web site. + * @summary Get process information by its ID for a 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. + * 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. @@ -42651,6 +46349,8 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, options, call * * @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. * @@ -42665,13 +46365,14 @@ function _getProcessSlot(resourceGroupName, name, processId, slot, options, call * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _deleteProcessSlot(resourceGroupName, name, processId, slot, options, callback) { +function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -42681,7 +46382,6 @@ function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, c if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -42707,12 +46407,18 @@ function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, c 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.'); } @@ -42722,21 +46428,22 @@ function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, c // 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}'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -42761,7 +46468,7 @@ function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, c return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 204 && statusCode !== 404) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -42789,176 +46496,35 @@ function _deleteProcessSlot(resourceGroupName, name, processId, slot, options, c // 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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - 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; + // Deserialize Response + if (statusCode === 200) { + let parsedResponse = null; 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'); + 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 (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); + } catch (error) { + let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); + deserializationError.request = msRest.stripRequest(httpRequest); + deserializationError.response = msRest.stripResponse(response); + return callback(deserializationError); } - 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 + * @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. * @@ -42981,14 +46547,14 @@ function _getProcessDumpSlot(resourceGroupName, name, processId, slot, 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 ProcessModuleInfoCollection} for more + * 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 _listProcessModulesSlot(resourceGroupName, name, processId, slot, options, callback) { +function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -42998,7 +46564,6 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -43030,6 +46595,9 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -43039,14 +46607,14 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -43113,7 +46681,7 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); + let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -43129,11 +46697,11 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio } /** - * @summary Get process information by its ID for a specific scaled-out - * instance in a web site. + * @summary Get thread information by Thread ID for a specific process, in 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. + * 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. @@ -43142,7 +46710,7 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, optio * * @param {string} processId PID. * - * @param {string} baseAddress Module base address. + * @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. @@ -43159,13 +46727,13 @@ function _listProcessModulesSlot(resourceGroupName, name, processId, slot, 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 ProcessModuleInfo} for more information. + * 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 _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, slot, options, callback) { +function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -43175,7 +46743,6 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -43201,8 +46768,8 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, 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 (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.'); @@ -43210,6 +46777,9 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -43219,15 +46789,15 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, // 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}'; + 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('{baseAddress}', encodeURIComponent(baseAddress)); + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -43294,7 +46864,7 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfo']().mapper(); + let resultMapper = new client.models['ProcessThreadInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -43310,21 +46880,17 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, } /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. + * @summary Get public certificates for an app or a deployment slot. * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. + * 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 Site name. - * - * @param {string} processId PID. + * @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. + * specified, the API gets hostname bindings for the production slot. * * @param {object} [options] Optional Parameters. * @@ -43338,14 +46904,14 @@ function _getProcessModuleSlot(resourceGroupName, name, processId, baseAddress, * {Error} 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 + * 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 _listProcessThreadsSlot(resourceGroupName, name, processId, slot, options, callback) { +function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -43355,7 +46921,6 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -43378,15 +46943,15 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio if (name === 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.'); } @@ -43396,14 +46961,13 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio // 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'; + 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('{processId}', encodeURIComponent(processId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -43435,7 +46999,7 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -43445,12 +47009,13 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -43470,7 +47035,7 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); + let resultMapper = new client.models['PublicCertificateCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -43486,23 +47051,21 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, optio } /** - * @summary Get thread information by Thread ID for a specific process, in a - * specific scaled-out instance in a web site. + * @summary Get the named public certificate for an app (or deployment slot, if + * specified). * - * Get thread information by Thread ID for a specific process, in a specific - * scaled-out instance in a web site. + * 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 Site name. - * - * @param {string} processId PID. - * - * @param {string} threadId TID. + * @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. + * specified, the API the named binding for the production slot. + * + * @param {string} publicCertificateName Public certificate name. * * @param {object} [options] Optional Parameters. * @@ -43516,13 +47079,13 @@ function _listProcessThreadsSlot(resourceGroupName, name, processId, slot, 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 ProcessThreadInfo} for more information. + * 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 _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slot, options, callback) { +function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -43532,7 +47095,6 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -43555,18 +47117,18 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo if (name === 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 (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.'); } @@ -43576,15 +47138,14 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo // 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}'; + 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('{processId}', encodeURIComponent(processId)); - requestUrl = requestUrl.replace('{threadId}', encodeURIComponent(threadId)); 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -43616,7 +47177,7 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -43626,12 +47187,13 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -43651,7 +47213,7 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfo']().mapper(); + let resultMapper = new client.models['PublicCertificate']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -43667,17 +47229,30 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo } /** - * @summary Get public certificates for an app or a deployment slot. + * @summary Creates a hostname binding for an app. * - * Get public certificates for an app or a deployment slot. + * 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 gets hostname bindings for the production slot. + * specified, the API will create a binding for the production slot. * * @param {object} [options] Optional Parameters. * @@ -43691,14 +47266,13 @@ function _getProcessThreadSlot(resourceGroupName, name, processId, threadId, slo * {Error} 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. + * 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 _listPublicCertificatesSlot(resourceGroupName, name, slot, options, callback) { +function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCertificateName, publicCertificate, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -43708,7 +47282,6 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -43731,12 +47304,21 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal if (name === 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.'); } @@ -43746,20 +47328,21 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates'; + 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(apiVersion)); + queryParameters.push('api-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 = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -43777,7 +47360,21 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal } } } - httpRequest.body = null; + // 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) { @@ -43794,12 +47391,13 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -43819,7 +47417,7 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PublicCertificateCollection']().mapper(); + let resultMapper = new client.models['PublicCertificate']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -43835,11 +47433,9 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal } /** - * @summary Get the named public certificate for an app (or deployment slot, if - * specified). + * @summary Deletes a hostname binding for an app. * - * Get the named public certificate for an app (or deployment slot, if - * specified). + * Deletes a hostname binding for an app. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -43847,7 +47443,7 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, options, cal * @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. + * specified, the API will delete the binding for the production slot. * * @param {string} publicCertificateName Public certificate name. * @@ -43862,14 +47458,13 @@ function _listPublicCertificatesSlot(resourceGroupName, name, slot, 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 PublicCertificate} 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 _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, options, callback) { +function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -43879,7 +47474,6 @@ function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertific if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -43911,6 +47505,9 @@ function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertific if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -43927,14 +47524,14 @@ function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertific requestUrl = requestUrl.replace('{publicCertificateName}', encodeURIComponent(publicCertificateName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'DELETE'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -43959,7 +47556,7 @@ function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertific 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); @@ -43987,56 +47584,32 @@ function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertific // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @summary Gets the publishing profile for an app (or deployment slot, if + * specified). * - * Creates a hostname binding for an app. + * 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 {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. + * specified, the API will get the publishing profile for the production slot. * * @param {object} [options] Optional Parameters. * + * @param {string} [options.format] Name of the format. Valid values are: + * FileZilla3 + * WebDeploy -- default + * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -44047,13 +47620,12 @@ function _getPublicCertificateSlot(resourceGroupName, name, slot, publicCertific * {Error} 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) { +function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -44063,7 +47635,7 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; + let format = (options && options.format !== undefined) ? options.format : undefined; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -44086,42 +47658,46 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer if (name === 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 (format !== null && format !== undefined && typeof format.valueOf() !== 'string') { + throw new Error('format must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.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 publishingProfileOptions; + if (format !== null && format !== undefined) { + publishingProfileOptions = new client.models['CsmPublishingProfileOptions'](); + publishingProfileOptions.format = format; + } // 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}'; + 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('{publicCertificateName}', encodeURIComponent(publicCertificateName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -44143,39 +47719,42 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer 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'); + 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(publicCertificate, null, 2)}.`); + `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(responseBody); + 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 { - parsedErrorResponse = JSON.parse(responseBody); + 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; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -44185,35 +47764,19 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer } return callback(error); } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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); - } - } + // Create Result + let result = response; return callback(null, result, httpRequest, response); }); } /** - * @summary Deletes a hostname binding for an app. + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * Deletes a hostname binding for an app. + * 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. @@ -44221,9 +47784,7 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer * @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. + * specified, the API resets configuration settings for the production slot. * * @param {object} [options] Optional Parameters. * @@ -44242,7 +47803,7 @@ function _createOrUpdatePublicCertificateSlot(resourceGroupName, name, publicCer * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCertificateName, options, callback) { +function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -44252,7 +47813,6 @@ function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCerti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -44276,14 +47836,14 @@ function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCerti 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.'); + throw new Error('slot cannot be null or undefined and it must be of type string.'); } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -44293,21 +47853,20 @@ function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCerti // 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}'; + 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('{publicCertificateName}', encodeURIComponent(publicCertificateName)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'DELETE'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -44332,7 +47891,7 @@ function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCerti return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 204) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -44366,10 +47925,9 @@ function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCerti } /** - * @summary Gets the publishing profile for an app (or deployment slot, if - * specified). + * @summary Restarts an app (or deployment slot, if specified). * - * Gets the publishing profile for 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. @@ -44377,14 +47935,17 @@ function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCerti * @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 profile for the production slot. + * specified, the API will restart the production slot. * * @param {object} [options] Optional Parameters. * - * @param {string} [options.format] Name of the format. Valid values are: - * FileZilla3 - * WebDeploy -- default - * Ftp. Possible values include: 'FileZilla3', 'WebDeploy', 'Ftp' + * @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 @@ -44395,13 +47956,13 @@ function _deletePublicCertificateSlot(resourceGroupName, name, slot, publicCerti * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [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. */ -function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, options, callback) { +function _restartSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -44411,8 +47972,8 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, if (!callback) { throw new Error('callback cannot be null.'); } - let format = (options && options.format !== undefined) ? options.format : undefined; - let apiVersion = '2016-08-01'; + 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') { @@ -44438,11 +47999,17 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, if (slot === 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 (format !== null && format !== undefined && typeof format.valueOf() !== 'string') { - throw new Error('format must be of type string.'); + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); @@ -44450,21 +48017,22 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, } catch (error) { return callback(error); } - let publishingProfileOptions; - if (format !== null && format !== undefined) { - publishingProfileOptions = new client.models['CsmPublishingProfileOptions'](); - publishingProfileOptions.format = format; - } // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publishxml'; + 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 = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + 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('&'); } @@ -44489,38 +48057,22 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, } } } - // 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; + 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) { - let error = new Error(`Unexpected status code: ${statusCode}`); + let error = new Error(responseBody); 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); + parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; @@ -44537,55 +48089,250 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, } return callback(error); } - // Create Result - let result = response; + let result = null; + if (responseBody === '') responseBody = null; + return callback(null, result, httpRequest, response); }); } /** - * @summary Recovers a web app to a previous snapshot. + * @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. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will * default to production slot. @@ -44607,7 +48354,7 @@ function _listPublishingProfileXmlWithSecretsSlot(resourceGroupName, name, slot, * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, callback) { +function _restoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -44620,7 +48367,7 @@ function _recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, ca } // Send request - this.beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, (err, parsedResult, httpRequest, response) => { + this.beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, (err, parsedResult, httpRequest, response) => { if (err) return callback(err); let initialResult = new msRest.HttpOperationResponse(); @@ -44646,19 +48393,17 @@ function _recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, ca } /** - * @summary Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * @summary Get list of siteextensions for a web site, or a deployment slot. * - * Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * 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 Name of the app. + * @param {string} name Site name. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API resets configuration settings for the production slot. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -44671,13 +48416,15 @@ function _recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, ca * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, callback) { +function _listSiteExtensionsSlot(resourceGroupName, name, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -44687,7 +48434,6 @@ function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, cal if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -44716,6 +48462,9 @@ function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, cal if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -44725,20 +48474,20 @@ function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, cal // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resetSlotConfig'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -44763,7 +48512,7 @@ function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, cal return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -44791,34 +48540,47 @@ function _resetSlotConfigurationSlot(resourceGroupName, name, slot, 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['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 Restarts an app (or deployment slot, if specified). + * @summary Get site extension information by its ID for a web site, or a + * deployment slot. * - * Restarts an app (or deployment slot, if specified). + * 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 Name of the app. + * @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 will restart the production slot. + * specified, the API deletes a deployment for 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 * @@ -44828,13 +48590,14 @@ function _resetSlotConfigurationSlot(resourceGroupName, name, slot, options, cal * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [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 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 _restartSlot(resourceGroupName, name, slot, options, callback) { +function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -44844,9 +48607,6 @@ function _restartSlot(resourceGroupName, name, slot, options, callback) { 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; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -44869,18 +48629,18 @@ function _restartSlot(resourceGroupName, name, slot, options, callback) { if (name === 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 (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.'); } @@ -44890,26 +48650,21 @@ function _restartSlot(resourceGroupName, name, slot, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restart'; + 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 = []; - 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -44934,7 +48689,7 @@ function _restartSlot(resourceGroupName, name, slot, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -44962,21 +48717,41 @@ function _restartSlot(resourceGroupName, name, slot, 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['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 Get list of siteextensions for a web site, or a deployment slot. + * @summary Install site extension on a web site, or a deployment slot. * - * Get list of siteextensions for 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. * @@ -44992,135 +48767,50 @@ function _restartSlot(resourceGroupName, name, slot, 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 SiteExtensionInfoCollection} for more - * information. + * 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 _listSiteExtensionsSlot(resourceGroupName, name, slot, options, callback) { +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.'); } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } + // Send request + this.beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, (err, parsedResult, httpRequest, response) => { + if (err) return callback(err); - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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); + 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; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { + + // Deserialize Response let parsedResponse = null; try { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteExtensionInfoCollection']().mapper(); + let resultMapper = new client.models['SiteExtensionInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -45129,18 +48819,16 @@ function _listSiteExtensionsSlot(resourceGroupName, name, slot, options, callbac deserializationError.response = msRest.stripResponse(response); return callback(deserializationError); } - } - return callback(null, result, httpRequest, response); + return callback(null, result, httpRequest, response); + }); }); } /** - * @summary Get site extension information by its ID for a web site, or a - * deployment slot. + * @summary Remove a site extension from a web site, or a deployment slot. * - * Get site extension information by its ID for 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. @@ -45163,14 +48851,13 @@ function _listSiteExtensionsSlot(resourceGroupName, name, slot, 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 SiteExtensionInfo} 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 _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, callback) { +function _deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -45180,7 +48867,6 @@ function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -45212,263 +48898,8 @@ function _getSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, o if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.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.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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.'); @@ -45486,7 +48917,7 @@ function _deleteSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -45603,7 +49034,6 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -45635,6 +49065,9 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -45650,7 +49083,7 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -45706,12 +49139,13 @@ function _listSlotDifferencesSlot(resourceGroupName, name, slotSwapEntity, slot, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -45864,7 +49298,6 @@ function _listSnapshotsSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -45893,6 +49326,9 @@ function _listSnapshotsSlot(resourceGroupName, name, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -45908,7 +49344,7 @@ function _listSnapshotsSlot(resourceGroupName, name, slot, options, callback) { requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -45950,12 +49386,13 @@ function _listSnapshotsSlot(resourceGroupName, name, slot, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -46032,7 +49469,6 @@ function _getSourceControlSlot(resourceGroupName, name, slot, options, callback) if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -46061,6 +49497,9 @@ function _getSourceControlSlot(resourceGroupName, name, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -46076,7 +49515,7 @@ function _getSourceControlSlot(resourceGroupName, name, slot, options, callback) requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -46108,7 +49547,7 @@ function _getSourceControlSlot(resourceGroupName, name, slot, options, callback) return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -46118,12 +49557,13 @@ function _getSourceControlSlot(resourceGroupName, name, slot, options, callback) try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -46153,6 +49593,40 @@ function _getSourceControlSlot(resourceGroupName, name, slot, options, callback) 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); }); @@ -46306,7 +49780,6 @@ function _deleteSourceControlSlot(resourceGroupName, name, slot, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -46335,6 +49808,9 @@ function _deleteSourceControlSlot(resourceGroupName, name, slot, options, callba if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -46350,7 +49826,7 @@ function _deleteSourceControlSlot(resourceGroupName, name, slot, options, callba requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -46479,7 +49955,6 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -46511,6 +49986,9 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -46526,7 +50004,7 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -46572,7 +50050,7 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -46582,12 +50060,13 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -46634,6 +50113,23 @@ function _updateSourceControlSlot(resourceGroupName, name, siteSourceControl, sl 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); }); @@ -46679,7 +50175,6 @@ function _startSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -46708,6 +50203,9 @@ function _startSlot(resourceGroupName, name, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -46723,7 +50221,7 @@ function _startSlot(resourceGroupName, name, slot, options, callback) { requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -46828,7 +50326,6 @@ function _stopSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -46857,6 +50354,9 @@ function _stopSlot(resourceGroupName, name, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -46872,7 +50372,7 @@ function _stopSlot(resourceGroupName, name, slot, options, callback) { requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -46977,7 +50477,6 @@ function _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -47006,6 +50505,9 @@ function _syncRepositorySlot(resourceGroupName, name, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -47021,7 +50523,7 @@ function _syncRepositorySlot(resourceGroupName, name, slot, options, callback) { requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -47126,7 +50628,6 @@ function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -47155,6 +50656,9 @@ function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callb if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -47170,7 +50674,7 @@ function _syncFunctionTriggersSlot(resourceGroupName, name, slot, options, callb requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -47277,7 +50781,6 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -47306,6 +50809,9 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -47321,7 +50827,7 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -47363,12 +50869,13 @@ function _listTriggeredWebJobsSlot(resourceGroupName, name, slot, options, callb try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -47447,7 +50954,6 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -47479,6 +50985,9 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -47495,7 +51004,7 @@ function _getTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -47620,7 +51129,6 @@ function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -47652,6 +51160,9 @@ function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, o if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -47668,7 +51179,7 @@ function _deleteTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, o requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -47778,7 +51289,6 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -47810,6 +51320,9 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -47826,7 +51339,7 @@ function _listTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, sl requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -47955,7 +51468,6 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -47990,6 +51502,9 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -48007,7 +51522,7 @@ function _getTriggeredWebJobHistorySlot(resourceGroupName, name, webJobName, id, requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -48131,7 +51646,6 @@ function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -48163,6 +51677,9 @@ function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -48179,7 +51696,7 @@ function _runTriggeredWebJobSlot(resourceGroupName, name, webJobName, slot, opti requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -48295,7 +51812,6 @@ function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -48327,6 +51843,9 @@ function _listUsagesSlot(resourceGroupName, name, slot, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -48345,7 +51864,7 @@ function _listUsagesSlot(resourceGroupName, name, slot, 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('&'); } @@ -48387,12 +51906,13 @@ function _listUsagesSlot(resourceGroupName, name, slot, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -48469,7 +51989,6 @@ function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -48498,6 +52017,9 @@ function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callba if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -48513,7 +52035,7 @@ function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callba requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -48555,12 +52077,13 @@ function _listVnetConnectionsSlot(resourceGroupName, name, slot, options, callba try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -48654,7 +52177,6 @@ function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -48686,6 +52208,9 @@ function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -48702,7 +52227,7 @@ function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -48744,12 +52269,13 @@ function _getVnetConnectionSlot(resourceGroupName, name, vnetName, slot, options try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -48844,7 +52370,6 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -48879,6 +52404,9 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -48895,7 +52423,7 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -48951,12 +52479,13 @@ function _createOrUpdateVnetConnectionSlot(resourceGroupName, name, vnetName, co try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -49035,7 +52564,6 @@ function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, opti if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -49067,6 +52595,9 @@ function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, opti if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -49083,7 +52614,7 @@ function _deleteVnetConnectionSlot(resourceGroupName, name, vnetName, slot, opti requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -49208,7 +52739,6 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -49243,6 +52773,9 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -49259,7 +52792,7 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -49315,12 +52848,13 @@ function _updateVnetConnectionSlot(resourceGroupName, name, vnetName, connection try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -49402,7 +52936,6 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -49437,6 +52970,9 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -49454,7 +52990,7 @@ function _getVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gatewa requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -49594,7 +53130,6 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -49632,6 +53167,9 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -49649,7 +53187,7 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -49705,12 +53243,13 @@ function _createOrUpdateVnetConnectionGatewaySlot(resourceGroupName, name, vnetN try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -49803,7 +53342,6 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -49841,6 +53379,9 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -49858,7 +53399,7 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -49914,12 +53455,13 @@ function _updateVnetConnectionGatewaySlot(resourceGroupName, name, vnetName, gat try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -49995,176 +53537,6 @@ function _listWebJobsSlot(resourceGroupName, name, slot, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -50187,15 +53559,15 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call if (name === 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.'); } @@ -50205,14 +53577,13 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call // 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}'; + 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('{webJobName}', encodeURIComponent(webJobName)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -50254,12 +53625,13 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -50279,7 +53651,7 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebJob']().mapper(); + let resultMapper = new client.models['WebJobCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -50295,24 +53667,19 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call } /** - * @summary Get the difference in configuration settings between two web app - * slots. + * @summary Get webjob information for an app, or a deployment slot. * - * Get the difference in configuration settings between two web app slots. + * 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 Name of the app. - * - * @param {object} slotSwapEntity JSON object that contains the target slot - * name. See example. + * @param {string} name Site name. * - * @param {string} slotSwapEntity.targetSlot Destination deployment slot during - * swap operation. + * @param {string} webJobName Name of the web job. * - * @param {boolean} slotSwapEntity.preserveVnet true to preserve - * Virtual Network to the slot during swap; otherwise, false. + * @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. * @@ -50326,14 +53693,13 @@ function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, call * {Error} 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. + * 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 _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEntity, options, callback) { +function _getWebJobSlot(resourceGroupName, name, webJobName, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -50343,7 +53709,6 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -50366,12 +53731,18 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt if (name === 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 (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.'); } @@ -50381,19 +53752,21 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsdiffs'; + 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(apiVersion)); + queryParameters.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.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -50411,21 +53784,7 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt } } } - // 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; + httpRequest.body = null; // Send Request return client.pipeline(httpRequest, (err, response, responseBody) => { if (err) { @@ -50442,12 +53801,13 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -50467,7 +53827,7 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SlotDifferenceCollection']().mapper(); + let resultMapper = new client.models['WebJob']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -50482,11 +53842,11 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt }); } - /** - * @summary Swaps two deployment slots of an app. + * @summary Get the difference in configuration settings between two web app + * slots. * - * Swaps two deployment slots of an app. + * Get the difference in configuration settings between two web app slots. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. @@ -50513,79 +53873,15 @@ function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEnt * * {Error} err - The Error object if an error occurred, null otherwise. * - * {null} [result] - The deserialized result object if an error did not occur. - * - * {object} [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. + * 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 _listSnapshots(resourceGroupName, name, options, callback) { +function _listSlotDifferencesFromProduction(resourceGroupName, name, slotSwapEntity, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -50595,7 +53891,6 @@ function _listSnapshots(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -50618,9 +53913,15 @@ function _listSnapshots(resourceGroupName, name, options, callback) { if (name === 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.'); } @@ -50630,19 +53931,19 @@ function _listSnapshots(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshots'; + 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(apiVersion)); + queryParameters.push('api-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 @@ -50660,7 +53961,21 @@ function _listSnapshots(resourceGroupName, name, options, callback) { } } } - httpRequest.body = null; + // 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) { @@ -50677,12 +53992,13 @@ function _listSnapshots(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -50702,7 +54018,7 @@ function _listSnapshots(resourceGroupName, name, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SnapshotCollection']().mapper(); + let resultMapper = new client.models['SlotDifferenceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -50717,16 +54033,91 @@ function _listSnapshots(resourceGroupName, name, options, callback) { }); } + /** - * @summary Gets the source control configuration of an app. + * @summary Swaps two deployment slots of an app. * - * Gets the source control configuration 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 @@ -50739,13 +54130,13 @@ function _listSnapshots(resourceGroupName, name, 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 SiteSourceControl} for more information. + * 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 _getSourceControl(resourceGroupName, name, options, callback) { +function _listSnapshots(resourceGroupName, name, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -50755,7 +54146,6 @@ function _getSourceControl(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -50781,6 +54171,9 @@ function _getSourceControl(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -50790,12 +54183,12 @@ function _getSourceControl(resourceGroupName, name, options, callback) { // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -50837,12 +54230,176 @@ function _getSourceControl(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); + error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); + } + } catch (defaultError) { + error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + + `- "${responseBody}" for the default response.`; + return callback(error); + } + return callback(error); + } + // Create Result + let result = null; + if (responseBody === '') responseBody = null; + // Deserialize Response + if (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) { @@ -50872,6 +54429,40 @@ function _getSourceControl(resourceGroupName, name, options, callback) { 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); }); @@ -51017,7 +54608,6 @@ function _deleteSourceControl(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -51043,6 +54633,9 @@ function _deleteSourceControl(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -51057,7 +54650,7 @@ function _deleteSourceControl(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -51182,7 +54775,6 @@ function _updateSourceControl(resourceGroupName, name, siteSourceControl, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -51211,6 +54803,9 @@ function _updateSourceControl(resourceGroupName, name, siteSourceControl, option if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -51225,7 +54820,7 @@ function _updateSourceControl(resourceGroupName, name, siteSourceControl, option requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -51271,7 +54866,7 @@ function _updateSourceControl(resourceGroupName, name, siteSourceControl, option return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -51281,12 +54876,13 @@ function _updateSourceControl(resourceGroupName, name, siteSourceControl, option try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -51333,6 +54929,23 @@ function _updateSourceControl(resourceGroupName, name, siteSourceControl, option 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); }); @@ -51375,7 +54988,6 @@ function _start(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -51401,6 +55013,9 @@ function _start(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -51415,7 +55030,7 @@ function _start(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -51517,7 +55132,6 @@ function _stop(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -51543,6 +55157,9 @@ function _stop(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -51557,7 +55174,7 @@ function _stop(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -51659,7 +55276,6 @@ function _syncRepository(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -51685,6 +55301,9 @@ function _syncRepository(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -51699,7 +55318,7 @@ function _syncRepository(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -51801,7 +55420,6 @@ function _syncFunctionTriggers(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -51827,6 +55445,9 @@ function _syncFunctionTriggers(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -51841,7 +55462,7 @@ function _syncFunctionTriggers(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -51945,7 +55566,6 @@ function _listTriggeredWebJobs(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -51971,6 +55591,9 @@ function _listTriggeredWebJobs(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -51985,7 +55608,7 @@ function _listTriggeredWebJobs(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -52027,12 +55650,13 @@ function _listTriggeredWebJobs(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -52108,7 +55732,6 @@ function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -52137,6 +55760,9 @@ function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callb if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -52152,7 +55778,7 @@ function _getTriggeredWebJob(resourceGroupName, name, webJobName, options, callb requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); 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('&'); } @@ -52274,7 +55900,6 @@ function _deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -52303,6 +55928,9 @@ function _deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, ca if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -52318,7 +55946,7 @@ function _deleteTriggeredWebJob(resourceGroupName, name, webJobName, options, ca requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); 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('&'); } @@ -52425,7 +56053,6 @@ function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -52454,6 +56081,9 @@ function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, option if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -52469,7 +56099,7 @@ function _listTriggeredWebJobHistory(resourceGroupName, name, webJobName, option requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); 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('&'); } @@ -52595,7 +56225,6 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -52627,6 +56256,9 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -52643,7 +56275,7 @@ function _getTriggeredWebJobHistory(resourceGroupName, name, webJobName, id, opt requestUrl = requestUrl.replace('{id}', encodeURIComponent(id)); 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('&'); } @@ -52764,7 +56396,6 @@ function _runTriggeredWebJob(resourceGroupName, name, webJobName, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -52793,6 +56424,9 @@ function _runTriggeredWebJob(resourceGroupName, name, webJobName, options, callb if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -52808,7 +56442,7 @@ function _runTriggeredWebJob(resourceGroupName, name, webJobName, options, callb requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); 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('&'); } @@ -52921,7 +56555,6 @@ function _listUsages(resourceGroupName, name, options, callback) { throw new Error('callback cannot be null.'); } let filter = (options && options.filter !== undefined) ? options.filter : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -52950,6 +56583,9 @@ function _listUsages(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -52967,7 +56603,7 @@ function _listUsages(resourceGroupName, name, 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('&'); } @@ -53009,12 +56645,13 @@ function _listUsages(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -53087,7 +56724,6 @@ function _listVnetConnections(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -53113,6 +56749,9 @@ function _listVnetConnections(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -53127,7 +56766,7 @@ function _listVnetConnections(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -53169,12 +56808,13 @@ function _listVnetConnections(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -53264,7 +56904,6 @@ function _getVnetConnection(resourceGroupName, name, vnetName, options, callback if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -53293,6 +56932,9 @@ function _getVnetConnection(resourceGroupName, name, vnetName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -53308,7 +56950,7 @@ function _getVnetConnection(resourceGroupName, name, vnetName, options, callback requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); 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('&'); } @@ -53350,12 +56992,13 @@ function _getVnetConnection(resourceGroupName, name, vnetName, options, callback try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -53447,7 +57090,6 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -53479,6 +57121,9 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -53494,7 +57139,7 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); 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('&'); } @@ -53550,12 +57195,13 @@ function _createOrUpdateVnetConnection(resourceGroupName, name, vnetName, connec try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -53631,7 +57277,6 @@ function _deleteVnetConnection(resourceGroupName, name, vnetName, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -53660,6 +57305,9 @@ function _deleteVnetConnection(resourceGroupName, name, vnetName, options, callb if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -53675,7 +57323,7 @@ function _deleteVnetConnection(resourceGroupName, name, vnetName, options, callb requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); 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('&'); } @@ -53797,7 +57445,6 @@ function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnve if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -53829,6 +57476,9 @@ function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnve if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -53844,7 +57494,7 @@ function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnve requestUrl = requestUrl.replace('{vnetName}', encodeURIComponent(vnetName)); 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('&'); } @@ -53900,12 +57550,13 @@ function _updateVnetConnection(resourceGroupName, name, vnetName, connectionEnve try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -53983,7 +57634,6 @@ function _getVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayNam if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -54015,6 +57665,9 @@ function _getVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayNam if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -54031,7 +57684,7 @@ function _getVnetConnectionGateway(resourceGroupName, name, vnetName, gatewayNam requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); 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('&'); } @@ -54167,7 +57820,6 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -54202,6 +57854,9 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -54218,7 +57873,7 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); 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('&'); } @@ -54274,12 +57929,13 @@ function _createOrUpdateVnetConnectionGateway(resourceGroupName, name, vnetName, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -54368,7 +58024,6 @@ function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gateway if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -54403,6 +58058,9 @@ function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gateway if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -54419,7 +58077,7 @@ function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gateway requestUrl = requestUrl.replace('{gatewayName}', encodeURIComponent(gatewayName)); 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('&'); } @@ -54475,12 +58133,13 @@ function _updateVnetConnectionGateway(resourceGroupName, name, vnetName, gateway try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -54553,7 +58212,6 @@ function _listWebJobs(resourceGroupName, name, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -54579,6 +58237,9 @@ function _listWebJobs(resourceGroupName, name, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -54593,7 +58254,7 @@ function _listWebJobs(resourceGroupName, name, options, callback) { requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); 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('&'); } @@ -54635,12 +58296,13 @@ function _listWebJobs(resourceGroupName, name, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -54715,7 +58377,6 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -54744,6 +58405,9 @@ function _getWebJob(resourceGroupName, name, webJobName, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -54759,7 +58423,7 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { requestUrl = requestUrl.replace('{webJobName}', encodeURIComponent(webJobName)); 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('&'); } @@ -54801,12 +58465,13 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -54871,6 +58536,8 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -54889,6 +58556,9 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { * @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. @@ -55087,9 +58757,29 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { * @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. @@ -55165,51 +58855,17 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests * * @param {object} [siteEnvelope.identity] * - * @param {object} [siteEnvelope.identity.type] Type of managed service - * 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. * @@ -55219,19 +58875,6 @@ function _getWebJob(resourceGroupName, name, webJobName, options, callback) { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -55258,11 +58901,6 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca if (!callback) { throw new Error('callback cannot be null.'); } - let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; - let skipCustomDomainVerification = (options && options.skipCustomDomainVerification !== undefined) ? options.skipCustomDomainVerification : undefined; - let forceDnsRegistration = (options && options.forceDnsRegistration !== undefined) ? options.forceDnsRegistration : undefined; - let ttlInSeconds = (options && options.ttlInSeconds !== undefined) ? options.ttlInSeconds : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -55288,21 +58926,12 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca if (siteEnvelope === null || siteEnvelope === undefined) { throw new Error('siteEnvelope cannot be null or undefined.'); } - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { - throw new Error('skipDnsRegistration must be of type boolean.'); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined && typeof skipCustomDomainVerification !== 'boolean') { - throw new Error('skipCustomDomainVerification must be of type boolean.'); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined && typeof forceDnsRegistration !== 'boolean') { - throw new Error('forceDnsRegistration must be of type boolean.'); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined && typeof ttlInSeconds.valueOf() !== 'string') { - throw new Error('ttlInSeconds must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -55317,19 +58946,7 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca requestUrl = requestUrl.replace('{name}', encodeURIComponent(name)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { - queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined) { - queryParameters.push('skipCustomDomainVerification=' + encodeURIComponent(skipCustomDomainVerification.toString())); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined) { - queryParameters.push('forceDnsRegistration=' + encodeURIComponent(forceDnsRegistration.toString())); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined) { - queryParameters.push('ttlInSeconds=' + encodeURIComponent(ttlInSeconds)); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -55385,12 +59002,13 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -55485,7 +59103,7 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, options, ca * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -55507,8 +59125,7 @@ function _beginCreateOrUpdate(resourceGroupName, name, siteEnvelope, 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 RestoreResponse} 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. * @@ -55524,7 +59141,6 @@ function _beginRestore(resourceGroupName, name, backupId, request, options, call if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -55556,6 +59172,9 @@ function _beginRestore(resourceGroupName, name, backupId, request, 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 (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -55571,7 +59190,7 @@ function _beginRestore(resourceGroupName, name, backupId, request, options, call requestUrl = requestUrl.replace('{backupId}', encodeURIComponent(backupId)); 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('&'); } @@ -55617,7 +59236,7 @@ function _beginRestore(resourceGroupName, name, backupId, request, options, call 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); @@ -55645,6 +59264,152 @@ function _beginRestore(resourceGroupName, name, backupId, request, options, call // 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; @@ -55652,7 +59417,7 @@ function _beginRestore(resourceGroupName, name, backupId, request, options, call parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RestoreResponse']().mapper(); + let resultMapper = new client.models['User']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -55668,14 +59433,42 @@ function _beginRestore(resourceGroupName, name, backupId, request, options, call } /** - * @summary Gets the Git/FTP publishing credentials of an app. + * @summary Invoke the MSDeploy web app extension. * - * Gets the Git/FTP publishing credentials of an app. + * Invoke the MSDeploy web app extension. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of the app. + * @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. * @@ -55689,13 +59482,217 @@ function _beginRestore(resourceGroupName, name, backupId, request, options, call * {Error} 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. + * 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 _beginListPublishingCredentials(resourceGroupName, name, options, callback) { +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') { @@ -55705,7 +59702,6 @@ function _beginListPublishingCredentials(resourceGroupName, name, options, callb if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -55728,9 +59724,18 @@ function _beginListPublishingCredentials(resourceGroupName, name, options, callb if (name === 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.'); } @@ -55740,19 +59745,20 @@ function _beginListPublishingCredentials(resourceGroupName, name, options, callb // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list'; + 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(apiVersion)); + queryParameters.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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -55770,14 +59776,28 @@ function _beginListPublishingCredentials(resourceGroupName, name, options, callb } } } - httpRequest.body = null; + // 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 !== 200) { + if (statusCode !== 201) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -55787,12 +59807,13 @@ function _beginListPublishingCredentials(resourceGroupName, name, options, callb try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -55806,13 +59827,13 @@ function _beginListPublishingCredentials(resourceGroupName, name, options, callb let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 200) { + 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['User']().mapper(); + let resultMapper = new client.models['FunctionEnvelope']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -55837,6 +59858,8 @@ function _beginListPublishingCredentials(resourceGroupName, name, options, callb * * @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 @@ -55883,7 +59906,7 @@ function _beginListPublishingCredentials(resourceGroupName, name, options, callb * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, options, callback) { +function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -55893,7 +59916,6 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -55916,12 +59938,18 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, option if (name === 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.'); } @@ -55931,12 +59959,13 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, option // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -56033,37 +60062,33 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, option } /** - * @summary Create function for web site, or a deployment slot. + * @summary Restores a web app. * - * Create function for web site, or a deployment slot. + * 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 Site name. - * - * @param {string} functionName Function name. - * - * @param {object} functionEnvelope Function details. - * - * @param {string} [functionEnvelope.scriptRootPathHref] Script root path URI. - * - * @param {string} [functionEnvelope.scriptHref] Script URI. - * - * @param {string} [functionEnvelope.configHref] Config URI. + * @param {string} name Name of web app. * - * @param {string} [functionEnvelope.secretsFileHref] Secrets file URI. + * @param {object} migrationOptions Migration migrationOptions. * - * @param {string} [functionEnvelope.href] Function URI. + * @param {string} migrationOptions.azurefilesConnectionString AzureFiles + * connection string. * - * @param {object} [functionEnvelope.config] Config information. + * @param {string} migrationOptions.azurefilesShare AzureFiles share. * - * @param {object} [functionEnvelope.files] File list. + * @param {boolean} [migrationOptions.switchSiteAfterMigration] + * trueif the app should be switched over; otherwise, + * false. * - * @param {string} [functionEnvelope.testData] Test data used when testing via - * the Azure Portal. + * @param {boolean} [migrationOptions.blockWriteAccessToSite] true + * if the app should be read only during copy operation; otherwise, + * false. * - * @param {string} [functionEnvelope.kind] Kind of resource. + * @param {string} [migrationOptions.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -56077,13 +60102,14 @@ function _beginCreateMSDeployOperation(resourceGroupName, name, mSDeploy, 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 FunctionEnvelope} for more information. + * 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 _beginCreateFunction(resourceGroupName, name, functionName, functionEnvelope, options, callback) { +function _beginMigrateStorage(subscriptionName, resourceGroupName, name, migrationOptions, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -56093,9 +60119,11 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // 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.'); } @@ -56116,15 +60144,15 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv if (name === 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 (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.'); } @@ -56134,13 +60162,13 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}'; + 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('{functionName}', encodeURIComponent(functionName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('subscriptionName=' + encodeURIComponent(subscriptionName)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -56169,14 +60197,14 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv 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'); + 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(functionEnvelope, null, 2)}.`); + `payload - ${JSON.stringify(migrationOptions, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -56186,7 +60214,7 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -56196,12 +60224,13 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -56215,13 +60244,13 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (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(); + let resultMapper = new client.models['StorageMigrationResponse']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -56237,44 +60266,26 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv } /** - * @summary Invoke the MSDeploy web app extension. + * @summary Migrates a local (in-app) MySql database to a remote MySql + * database. * - * Invoke the MSDeploy web app extension. + * 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 {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 {object} migrationRequestEnvelope MySql migration options. * - * @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 {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. * - * @param {boolean} [mSDeploy.appOffline] Sets the AppOffline rule while the - * MSDeploy operation executes. - * Setting is false by default. + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' * - * @param {string} [mSDeploy.kind] Kind of resource. + * @param {string} [migrationRequestEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -56288,13 +60299,13 @@ function _beginCreateFunction(resourceGroupName, name, functionName, functionEnv * {Error} 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. + * 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 _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instanceId, mSDeploy, options, callback) { +function _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -56304,7 +60315,6 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -56327,15 +60337,15 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance if (name === 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 (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.'); } @@ -56345,20 +60355,19 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance // 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'; + 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('{instanceId}', encodeURIComponent(instanceId)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -56380,14 +60389,14 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance 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'); + 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(mSDeploy, null, 2)}.`); + `payload - ${JSON.stringify(migrationRequestEnvelope, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -56397,7 +60406,7 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 201 && statusCode !== 409) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -56407,12 +60416,13 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -56426,13 +60436,13 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance let result = null; if (responseBody === '') responseBody = null; // Deserialize Response - if (statusCode === 201) { + if (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(); + let resultMapper = new client.models['Operation']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -56448,33 +60458,54 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance } /** - * @summary Restores a web app. - * - * Restores a web app. + * @summary Restores an app from a backup blob in Azure Storage. * - * @param {string} subscriptionName Azure subscription. + * 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 web app. + * @param {string} name Name of the app. * - * @param {object} migrationOptions Migration migrationOptions. + * @param {object} request Information on restore request . * - * @param {string} migrationOptions.azurefilesConnectionString AzureFiles - * connection string. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @param {string} migrationOptions.azurefilesShare AzureFiles share. + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @param {boolean} [migrationOptions.switchSiteAfterMigration] - * trueif the app should be switched over; otherwise, - * false. + * @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 {boolean} [migrationOptions.blockWriteAccessToSite] true - * if the app should be read only during copy operation; otherwise, + * @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} [migrationOptions.kind] Kind of resource. + * @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. * @@ -56487,15 +60518,13 @@ function _beginCreateInstanceMSDeployOperation(resourceGroupName, name, instance * * {Error} 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [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) { +function _beginRestoreFromBackupBlob(resourceGroupName, name, request, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -56505,12 +60534,8 @@ function _beginMigrateStorage(subscriptionName, resourceGroupName, name, migrati if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // 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.'); } @@ -56531,12 +60556,15 @@ function _beginMigrateStorage(subscriptionName, resourceGroupName, name, migrati if (name === 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 (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.'); } @@ -56546,20 +60574,19 @@ function _beginMigrateStorage(subscriptionName, resourceGroupName, name, migrati // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate'; + 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('subscriptionName=' + encodeURIComponent(subscriptionName)); - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.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.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -56581,14 +60608,14 @@ function _beginMigrateStorage(subscriptionName, resourceGroupName, name, migrati 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'); + 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(migrationOptions, null, 2)}.`); + `payload - ${JSON.stringify(request, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -56598,7 +60625,7 @@ function _beginMigrateStorage(subscriptionName, resourceGroupName, name, migrati 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); @@ -56626,49 +60653,35 @@ function _beginMigrateStorage(subscriptionName, resourceGroupName, name, migrati // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @summary Restores a deleted web app to this web app. * - * Migrates a local (in-app) MySql database to a remote MySql database. + * 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} migrationRequestEnvelope MySql migration options. + * @param {object} restoreRequest Deleted web app restore information. * - * @param {string} migrationRequestEnvelope.connectionString Connection string - * to the remote MySQL database. + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} * - * @param {string} migrationRequestEnvelope.migrationType The type of migration - * operation to be done. Possible values include: 'LocalToRemote', - * 'RemoteToLocal' + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. * - * @param {string} [migrationRequestEnvelope.kind] Kind of resource. + * @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. * @@ -56681,14 +60694,13 @@ function _beginMigrateStorage(subscriptionName, resourceGroupName, name, migrati * * {Error} 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [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) { +function _beginRestoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -56698,7 +60710,6 @@ function _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -56721,12 +60732,15 @@ function _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, o if (name === 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 (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.'); } @@ -56736,12 +60750,12 @@ function _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, o // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -56770,14 +60784,14 @@ function _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, o 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'); + 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(migrationRequestEnvelope, null, 2)}.`); + `payload - ${JSON.stringify(restoreRequest, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -56787,7 +60801,7 @@ function _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, o 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); @@ -56815,69 +60829,53 @@ function _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, 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['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 Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -56896,7 +60894,7 @@ function _beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, o * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginRecover(resourceGroupName, name, recoveryEntity, options, callback) { +function _beginRestoreSnapshot(resourceGroupName, name, restoreRequest, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -56906,7 +60904,6 @@ function _beginRecover(resourceGroupName, name, recoveryEntity, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -56929,12 +60926,15 @@ function _beginRecover(resourceGroupName, name, recoveryEntity, options, callbac if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (recoveryEntity === null || recoveryEntity === undefined) { - throw new Error('recoveryEntity cannot be null or undefined.'); + 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.'); } @@ -56944,12 +60944,12 @@ function _beginRecover(resourceGroupName, name, recoveryEntity, options, callbac // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/recover'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -56978,14 +60978,14 @@ function _beginRecover(resourceGroupName, name, recoveryEntity, options, callbac let requestContent = null; let requestModel = null; try { - if (recoveryEntity !== null && recoveryEntity !== undefined) { - let requestModelMapper = new client.models['SnapshotRecoveryRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, recoveryEntity, 'recoveryEntity'); + 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(recoveryEntity, null, 2)}.`); + `payload - ${JSON.stringify(restoreRequest, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -57068,7 +61068,6 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -57097,6 +61096,9 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -57112,7 +61114,7 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op requestUrl = requestUrl.replace('{siteExtensionId}', encodeURIComponent(siteExtensionId)); 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('&'); } @@ -57241,6 +61243,8 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -57259,6 +61263,9 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op * @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. @@ -57457,9 +61464,29 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op * @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. @@ -57535,51 +61562,17 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests * * @param {object} [siteEnvelope.identity] * - * @param {object} [siteEnvelope.identity.type] Type of managed service - * 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. * @@ -57592,19 +61585,6 @@ function _beginInstallSiteExtension(resourceGroupName, name, siteExtensionId, op * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -57631,11 +61611,6 @@ function _beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, o if (!callback) { throw new Error('callback cannot be null.'); } - let skipDnsRegistration = (options && options.skipDnsRegistration !== undefined) ? options.skipDnsRegistration : undefined; - let skipCustomDomainVerification = (options && options.skipCustomDomainVerification !== undefined) ? options.skipCustomDomainVerification : undefined; - let forceDnsRegistration = (options && options.forceDnsRegistration !== undefined) ? options.forceDnsRegistration : undefined; - let ttlInSeconds = (options && options.ttlInSeconds !== undefined) ? options.ttlInSeconds : undefined; - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -57664,21 +61639,12 @@ function _beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, o if (slot === null || slot === undefined || typeof slot.valueOf() !== 'string') { throw new Error('slot cannot be null or undefined and it must be of type string.'); } - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined && typeof skipDnsRegistration !== 'boolean') { - throw new Error('skipDnsRegistration must be of type boolean.'); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined && typeof skipCustomDomainVerification !== 'boolean') { - throw new Error('skipCustomDomainVerification must be of type boolean.'); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined && typeof forceDnsRegistration !== 'boolean') { - throw new Error('forceDnsRegistration must be of type boolean.'); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined && typeof ttlInSeconds.valueOf() !== 'string') { - throw new Error('ttlInSeconds must be of type string.'); - } if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -57694,19 +61660,7 @@ function _beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, o requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); let queryParameters = []; - if (skipDnsRegistration !== null && skipDnsRegistration !== undefined) { - queryParameters.push('skipDnsRegistration=' + encodeURIComponent(skipDnsRegistration.toString())); - } - if (skipCustomDomainVerification !== null && skipCustomDomainVerification !== undefined) { - queryParameters.push('skipCustomDomainVerification=' + encodeURIComponent(skipCustomDomainVerification.toString())); - } - if (forceDnsRegistration !== null && forceDnsRegistration !== undefined) { - queryParameters.push('forceDnsRegistration=' + encodeURIComponent(forceDnsRegistration.toString())); - } - if (ttlInSeconds !== null && ttlInSeconds !== undefined) { - queryParameters.push('ttlInSeconds=' + encodeURIComponent(ttlInSeconds)); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -57762,12 +61716,13 @@ function _beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, o try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -57862,7 +61817,7 @@ function _beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, o * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -57887,8 +61842,7 @@ function _beginCreateOrUpdateSlot(resourceGroupName, name, siteEnvelope, slot, 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 RestoreResponse} 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. * @@ -57904,7 +61858,6 @@ function _beginRestoreSlot(resourceGroupName, name, backupId, request, slot, opt if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -57939,6 +61892,9 @@ function _beginRestoreSlot(resourceGroupName, name, backupId, request, slot, opt if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -57955,189 +61911,7 @@ function _beginRestoreSlot(resourceGroupName, name, backupId, request, slot, opt requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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]; - } - } - } - // 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['RestoreResponse']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in 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 _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.'); - } - let apiVersion = '2016-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -58162,14 +61936,28 @@ function _beginListPublishingCredentialsSlot(resourceGroupName, name, slot, opti } } } - httpRequest.body = null; + // 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) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -58197,6 +61985,160 @@ function _beginListPublishingCredentialsSlot(resourceGroupName, name, slot, opti // 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; @@ -58288,7 +62230,6 @@ function _beginCreateMSDeployOperationSlot(resourceGroupName, name, slot, mSDepl if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58320,6 +62261,9 @@ function _beginCreateMSDeployOperationSlot(resourceGroupName, name, slot, mSDepl if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -58335,7 +62279,7 @@ function _beginCreateMSDeployOperationSlot(resourceGroupName, name, slot, mSDepl requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -58448,6 +62392,8 @@ function _beginCreateMSDeployOperationSlot(resourceGroupName, name, slot, mSDepl * * @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. @@ -58495,7 +62441,6 @@ function _beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58530,6 +62475,9 @@ function _beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -58546,7 +62494,7 @@ function _beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } @@ -58602,12 +62550,13 @@ function _beginCreateInstanceFunctionSlot(resourceGroupName, name, functionName, try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -58713,7 +62662,6 @@ function _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58748,6 +62696,9 @@ function _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -58764,7 +62715,7 @@ function _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot requestUrl = requestUrl.replace('{instanceId}', encodeURIComponent(instanceId)); 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('&'); } @@ -58861,49 +62812,57 @@ function _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot } /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores an app from a backup blob in Azure Storage. * - * Recovers a web app to a previous snapshot. + * 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 web app. + * @param {string} name Name of the app. * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} request Information on restore request . * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @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} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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 {string} [request.siteName] Name of an app. * - * @param {boolean} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. + * @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} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. + * @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} [recoveryEntity.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 {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * @param {string} [recoveryEntity.kind] Kind of resource. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -58922,7 +62881,7 @@ function _beginCreateInstanceMSDeployOperationSlot(resourceGroupName, name, slot * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, callback) { +function _beginRestoreFromBackupBlobSlot(resourceGroupName, name, request, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -58932,7 +62891,6 @@ function _beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, option if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -58955,8 +62913,8 @@ function _beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, option if (name === null || name === undefined || typeof name.valueOf() !== 'string') { throw new Error('name cannot be null or undefined and it must be of type string.'); } - if (recoveryEntity === null || recoveryEntity === undefined) { - throw new Error('recoveryEntity cannot be null or undefined.'); + 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.'); @@ -58964,6 +62922,9 @@ function _beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, option if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -58973,13 +62934,13 @@ function _beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, option // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/recover'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -59008,14 +62969,14 @@ function _beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, option let requestContent = null; let requestModel = null; try { - if (recoveryEntity !== null && recoveryEntity !== undefined) { - let requestModelMapper = new client.models['SnapshotRecoveryRequest']().mapper(); - requestModel = client.serialize(requestModelMapper, recoveryEntity, 'recoveryEntity'); + 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(recoveryEntity, null, 2)}.`); + `payload - ${JSON.stringify(request, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -59059,19 +63020,32 @@ function _beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, option } /** - * @summary Install site extension on a web site, or a deployment slot. + * @summary Restores a deleted web app to this web app. * - * Install site extension on a web site, or a deployment slot. + * 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 Site name. + * @param {string} name Name of web app. * - * @param {string} siteExtensionId Site extension name. + * @param {object} restoreRequest Deleted web app restore information. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. + * @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. * @@ -59084,14 +63058,13 @@ function _beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, 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 SiteExtensionInfo} 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 _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, callback) { +function _beginRestoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -59101,7 +63074,6 @@ function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -59124,8 +63096,8 @@ function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId if (name === 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 (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.'); @@ -59133,6 +63105,9 @@ function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -59142,21 +63117,20 @@ function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId // 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}'; + 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('{siteExtensionId}', encodeURIComponent(siteExtensionId)); requestUrl = requestUrl.replace('{slot}', encodeURIComponent(slot)); 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('&'); } // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'PUT'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -59174,14 +63148,28 @@ function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId } } } - httpRequest.body = null; + // 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 !== 201 && statusCode !== 429) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -59209,66 +63197,56 @@ function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId // Create Result let result = null; if (responseBody === '') responseBody = null; - // Deserialize Response - if (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. + * @summary Restores a web app from a snapshot. * - * Swaps two deployment slots of an app. + * 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 the app. + * @param {string} name Name of web app. * - * @param {object} slotSwapEntity JSON object that contains the target slot - * name. See example. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} slotSwapEntity.targetSlot Destination deployment slot during - * swap operation. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {boolean} slotSwapEntity.preserveVnet true to preserve - * Virtual Network to the slot during swap; otherwise, false. + * @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} slot Name of the source slot. If a slot is not specified, - * the production slot is used as the source slot. + * @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. * @@ -59287,7 +63265,7 @@ function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, callback) { +function _beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -59297,7 +63275,6 @@ function _beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, optio if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -59320,8 +63297,8 @@ function _beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, optio if (name === 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 (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.'); @@ -59329,6 +63306,9 @@ function _beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, optio if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -59338,13 +63318,13 @@ function _beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, optio // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -59373,14 +63353,14 @@ function _beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, optio 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'); + 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(slotSwapEntity, null, 2)}.`); + `payload - ${JSON.stringify(restoreRequest, null, 2)}.`); return callback(serializationError); } httpRequest.body = requestContent; @@ -59424,40 +63404,19 @@ function _beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, optio } /** - * @summary Updates the source control configuration of an app. + * @summary Install site extension on a web site, or a deployment slot. * - * Updates the source control configuration of an app. + * 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 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} name Site name. * - * @param {string} [siteSourceControl.kind] Kind of resource. + * @param {string} siteExtensionId Site extension name. * * @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. + * specified, the API deletes a deployment for the production slot. * * @param {object} [options] Optional Parameters. * @@ -59471,13 +63430,13 @@ function _beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, 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 SiteSourceControl} for more information. + * 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 _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, callback) { +function _beginInstallSiteExtensionSlot(resourceGroupName, name, siteExtensionId, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -59487,7 +63446,6 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -59510,8 +63468,8 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour if (name === 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 (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.'); @@ -59519,6 +63477,9 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.client.apiVersion === null || this.client.apiVersion === undefined || typeof this.client.apiVersion.valueOf() !== 'string') { + throw new Error('this.client.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { throw new Error('this.client.acceptLanguage must be of type string.'); } @@ -59528,13 +63489,14 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour // 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'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -59559,28 +63521,14 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour } } } - // 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; + httpRequest.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 && statusCode !== 201 && statusCode !== 429) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -59615,7 +63563,7 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteSourceControl']().mapper(); + let resultMapper = new client.models['SiteExtensionInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -59632,7 +63580,7 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteSourceControl']().mapper(); + let resultMapper = new client.models['SiteExtensionInfo']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -59666,6 +63614,9 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour * @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 @@ -59683,7 +63634,7 @@ function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSour * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, callback) { +function _beginSwapSlotSlot(resourceGroupName, name, slotSwapEntity, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -59693,7 +63644,6 @@ function _beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, o if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -59719,9 +63669,15 @@ function _beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, o 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.'); } @@ -59731,12 +63687,13 @@ function _beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, o // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -59847,6 +63804,10 @@ function _beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, o * * @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 @@ -59865,7 +63826,7 @@ function _beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, o * * {stream} [response] - The HTTP Response stream if an error did not occur. */ -function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceControl, options, callback) { +function _beginCreateOrUpdateSourceControlSlot(resourceGroupName, name, siteSourceControl, slot, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -59875,7 +63836,6 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-08-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -59901,9 +63861,15 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo 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.'); } @@ -59913,12 +63879,13 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo // Construct URL let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web'; + 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.client.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -59964,7 +63931,7 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 201) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -59974,12 +63941,13 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -60026,18 +63994,46 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo 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. + * @summary Swaps two deployment slots of an app. * - * Get all apps for a subscription. + * Swaps two deployment slots of an app. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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. * @@ -60050,14 +64046,13 @@ function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceCo * * {Error} 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {object} [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 _beginSwapSlotWithProduction(resourceGroupName, name, slotSwapEntity, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -60069,8 +64064,34 @@ 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 (name === 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.'); @@ -60080,12 +64101,20 @@ 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}/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 = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -60103,14 +64132,28 @@ function _listNext(nextPageLink, options, callback) { } } } - httpRequest.body = null; + // 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) { + if (statusCode !== 200 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -60138,35 +64181,42 @@ function _listNext(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['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. + * @summary Updates the source control configuration of an app. * - * Gets all web, mobile, and API apps in the specified resource group. + * Updates the source control configuration of an app. * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. + * @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. * @@ -60180,13 +64230,13 @@ function _listNext(nextPageLink, 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 WebAppCollection} for more information. + * 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 _listByResourceGroupNext(nextPageLink, options, callback) { +function _beginCreateOrUpdateSourceControl(resourceGroupName, name, siteSourceControl, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -60198,8 +64248,34 @@ 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 (name === 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.'); @@ -60209,12 +64285,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.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.method = 'PUT'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -60232,14 +64316,28 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { } } } - httpRequest.body = null; + // 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) { + if (statusCode !== 200 && statusCode !== 201 && statusCode !== 202) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -60249,12 +64347,13 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -60274,7 +64373,7 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebAppCollection']().mapper(); + let resultMapper = new client.models['SiteSourceControl']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -60284,15 +64383,49 @@ function _listByResourceGroupNext(nextPageLink, options, callback) { 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 Gets existing backups of an app. + * @summary Get all apps for a subscription. * - * Gets existing backups of an app. + * Get all apps for a subscription. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -60309,13 +64442,13 @@ function _listByResourceGroupNext(nextPageLink, 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 BackupItemCollection} for more information. + * 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 _listBackupsNext(nextPageLink, options, callback) { +function _listNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -60378,12 +64511,13 @@ function _listBackupsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -60403,7 +64537,7 @@ function _listBackupsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupItemCollection']().mapper(); + let resultMapper = new client.models['WebAppCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -60419,9 +64553,9 @@ function _listBackupsNext(nextPageLink, options, callback) { } /** - * @summary List the configurations of an app + * @summary Gets all web, mobile, and API apps in the specified resource group. * - * List the configurations of an app + * 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. @@ -60438,14 +64572,13 @@ function _listBackupsNext(nextPageLink, 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 SiteConfigResourceCollection} for more - * information. + * 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 _listConfigurationsNext(nextPageLink, options, callback) { +function _listByResourceGroupNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -60508,12 +64641,13 @@ function _listConfigurationsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -60533,7 +64667,7 @@ function _listConfigurationsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigResourceCollection']().mapper(); + let resultMapper = new client.models['WebAppCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -60549,11 +64683,9 @@ function _listConfigurationsNext(nextPageLink, options, callback) { } /** - * @summary Gets a list of web app configuration snapshots identifiers. Each - * element of the list contains a timestamp and the ID of the snapshot. + * @summary Gets existing backups of an app. * - * Gets a list of web app configuration snapshots identifiers. Each element of - * the list contains a timestamp and the ID of the snapshot. + * Gets existing backups of an app. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -60570,14 +64702,13 @@ function _listConfigurationsNext(nextPageLink, 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 SiteConfigurationSnapshotInfoCollection} for - * more information. + * 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 _listConfigurationSnapshotInfoNext(nextPageLink, options, callback) { +function _listBackupsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -60640,12 +64771,13 @@ function _listConfigurationSnapshotInfoNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -60665,7 +64797,7 @@ function _listConfigurationSnapshotInfoNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigurationSnapshotInfoCollection']().mapper(); + let resultMapper = new client.models['BackupItemCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -60681,9 +64813,9 @@ function _listConfigurationSnapshotInfoNext(nextPageLink, options, callback) { } /** - * @summary List continuous web jobs for an app, or a deployment slot. + * @summary List the configurations of an app * - * List continuous web jobs for an app, or a deployment slot. + * List the configurations of an app * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -60700,14 +64832,14 @@ function _listConfigurationSnapshotInfoNext(nextPageLink, 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 ContinuousWebJobCollection} for more + * 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 _listContinuousWebJobsNext(nextPageLink, options, callback) { +function _listConfigurationsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -60770,12 +64902,13 @@ function _listContinuousWebJobsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -60795,7 +64928,7 @@ function _listContinuousWebJobsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ContinuousWebJobCollection']().mapper(); + let resultMapper = new client.models['SiteConfigResourceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -60811,9 +64944,11 @@ function _listContinuousWebJobsNext(nextPageLink, options, callback) { } /** - * @summary List deployments for an app, or a deployment slot. + * @summary Gets a list of web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. * - * List deployments for an app, or a deployment slot. + * 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. @@ -60830,13 +64965,14 @@ function _listContinuousWebJobsNext(nextPageLink, 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 DeploymentCollection} for more information. + * 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 _listDeploymentsNext(nextPageLink, options, callback) { +function _listConfigurationSnapshotInfoNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -60899,12 +65035,13 @@ function _listDeploymentsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -60924,7 +65061,7 @@ function _listDeploymentsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['DeploymentCollection']().mapper(); + let resultMapper = new client.models['SiteConfigurationSnapshotInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -60940,9 +65077,9 @@ function _listDeploymentsNext(nextPageLink, options, callback) { } /** - * @summary Lists ownership identifiers for domain associated with web app. + * @summary List continuous web jobs for an app, or a deployment slot. * - * Lists ownership identifiers for domain associated with web app. + * List continuous web jobs for an app, or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -60959,13 +65096,14 @@ function _listDeploymentsNext(nextPageLink, 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 IdentifierCollection} for more information. + * 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 _listDomainOwnershipIdentifiersNext(nextPageLink, options, callback) { +function _listContinuousWebJobsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -61028,12 +65166,13 @@ function _listDomainOwnershipIdentifiersNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -61053,7 +65192,7 @@ function _listDomainOwnershipIdentifiersNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['IdentifierCollection']().mapper(); + let resultMapper = new client.models['ContinuousWebJobCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -61069,9 +65208,9 @@ function _listDomainOwnershipIdentifiersNext(nextPageLink, options, callback) { } /** - * @summary List the functions for a web site, or a deployment slot. + * @summary List deployments for an app, or a deployment slot. * - * List the functions for a web site, 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. @@ -61088,14 +65227,13 @@ function _listDomainOwnershipIdentifiersNext(nextPageLink, 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 FunctionEnvelopeCollection} for more - * information. + * 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 _listFunctionsNext(nextPageLink, options, callback) { +function _listDeploymentsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -61148,7 +65286,7 @@ function _listFunctionsNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -61158,12 +65296,13 @@ function _listFunctionsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -61183,7 +65322,7 @@ function _listFunctionsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionEnvelopeCollection']().mapper(); + let resultMapper = new client.models['DeploymentCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -61199,9 +65338,9 @@ function _listFunctionsNext(nextPageLink, options, callback) { } /** - * @summary Get hostname bindings for an app or a deployment slot. + * @summary Lists ownership identifiers for domain associated with web app. * - * Get hostname bindings for an app or a deployment slot. + * Lists ownership identifiers for domain associated with web app. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -61218,14 +65357,13 @@ function _listFunctionsNext(nextPageLink, 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 HostNameBindingCollection} for more - * information. + * 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 _listHostNameBindingsNext(nextPageLink, options, callback) { +function _listDomainOwnershipIdentifiersNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -61288,12 +65426,13 @@ function _listHostNameBindingsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -61313,7 +65452,7 @@ function _listHostNameBindingsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HostNameBindingCollection']().mapper(); + let resultMapper = new client.models['IdentifierCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -61329,9 +65468,9 @@ function _listHostNameBindingsNext(nextPageLink, options, callback) { } /** - * @summary Gets all scale-out instances of an app. + * @summary List the functions for a web site, or a deployment slot. * - * Gets all scale-out instances of an app. + * List the functions for a web site, or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -61348,14 +65487,14 @@ function _listHostNameBindingsNext(nextPageLink, 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 WebAppInstanceCollection} for more + * 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 _listInstanceIdentifiersNext(nextPageLink, options, callback) { +function _listFunctionsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -61408,7 +65547,7 @@ function _listInstanceIdentifiersNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -61443,7 +65582,7 @@ function _listInstanceIdentifiersNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebAppInstanceCollection']().mapper(); + let resultMapper = new client.models['FunctionEnvelopeCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -61459,11 +65598,9 @@ function _listInstanceIdentifiersNext(nextPageLink, options, callback) { } /** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. + * @summary Get hostname bindings for an app or a deployment slot. * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. + * Get hostname bindings for an app or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -61480,13 +65617,14 @@ function _listInstanceIdentifiersNext(nextPageLink, 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 ProcessInfoCollection} for more information. + * 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 _listInstanceProcessesNext(nextPageLink, options, callback) { +function _listHostNameBindingsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -61539,7 +65677,7 @@ function _listInstanceProcessesNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -61549,12 +65687,13 @@ function _listInstanceProcessesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -61574,7 +65713,7 @@ function _listInstanceProcessesNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfoCollection']().mapper(); + let resultMapper = new client.models['HostNameBindingCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -61590,11 +65729,9 @@ function _listInstanceProcessesNext(nextPageLink, options, callback) { } /** - * @summary List module information for a process by its ID for a specific - * scaled-out instance in a web site. + * @summary Gets all scale-out instances of an app. * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. + * Gets all scale-out instances of an app. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -61611,14 +65748,14 @@ function _listInstanceProcessesNext(nextPageLink, 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 ProcessModuleInfoCollection} for more + * 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 _listInstanceProcessModulesNext(nextPageLink, options, callback) { +function _listInstanceIdentifiersNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -61671,7 +65808,7 @@ function _listInstanceProcessModulesNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -61681,12 +65818,13 @@ function _listInstanceProcessModulesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -61706,7 +65844,7 @@ function _listInstanceProcessModulesNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); + let resultMapper = new client.models['WebAppInstanceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -61722,11 +65860,11 @@ function _listInstanceProcessModulesNext(nextPageLink, options, callback) { } /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. + * @summary Get list of processes for a web site, or a deployment slot, or 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. + * 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. @@ -61743,14 +65881,13 @@ function _listInstanceProcessModulesNext(nextPageLink, 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 ProcessThreadInfoCollection} for more - * information. + * 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 _listInstanceProcessThreadsNext(nextPageLink, options, callback) { +function _listInstanceProcessesNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -61838,7 +65975,7 @@ function _listInstanceProcessThreadsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); + let resultMapper = new client.models['ProcessInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -61854,10 +65991,11 @@ function _listInstanceProcessThreadsNext(nextPageLink, options, callback) { } /** - * @summary Gets all metric definitions of an app (or deployment slot, if - * specified). + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. * - * Gets all metric definitions of an app (or deployment slot, if specified). + * 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. @@ -61874,14 +66012,14 @@ function _listInstanceProcessThreadsNext(nextPageLink, 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 ResourceMetricDefinitionCollection} for more + * 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 _listMetricDefinitionsNext(nextPageLink, options, callback) { +function _listInstanceProcessModulesNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -61934,7 +66072,7 @@ function _listMetricDefinitionsNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -61969,7 +66107,7 @@ function _listMetricDefinitionsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); + let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -61985,10 +66123,11 @@ function _listMetricDefinitionsNext(nextPageLink, options, callback) { } /** - * @summary Gets performance metrics of an app (or deployment slot, if - * specified). + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. * - * Gets performance metrics of an app (or deployment slot, if specified). + * 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. @@ -62005,14 +66144,14 @@ function _listMetricDefinitionsNext(nextPageLink, 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 ResourceMetricCollection} for more + * 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 _listMetricsNext(nextPageLink, options, callback) { +function _listInstanceProcessThreadsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -62065,7 +66204,7 @@ function _listMetricsNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -62100,7 +66239,7 @@ function _listMetricsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricCollection']().mapper(); + let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -62116,9 +66255,10 @@ function _listMetricsNext(nextPageLink, options, callback) { } /** - * @summary Gets perfmon counters for web app. + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). * - * Gets perfmon counters for web app. + * 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. @@ -62135,14 +66275,14 @@ function _listMetricsNext(nextPageLink, 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 PerfMonCounterCollection} for more + * 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 _listPerfMonCountersNext(nextPageLink, options, callback) { +function _listMetricDefinitionsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -62205,12 +66345,13 @@ function _listPerfMonCountersNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -62230,138 +66371,7 @@ function _listPerfMonCountersNext(nextPageLink, options, callback) { 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(); + let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -62377,11 +66387,10 @@ function _listProcessesNext(nextPageLink, options, callback) { } /** - * @summary List module information for a process by its ID for a specific - * scaled-out instance in a web site. + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. + * Gets performance metrics of an app (or deployment slot, if specified). * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -62398,14 +66407,14 @@ function _listProcessesNext(nextPageLink, 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 ProcessModuleInfoCollection} for more + * 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 _listProcessModulesNext(nextPageLink, options, callback) { +function _listMetricsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -62458,7 +66467,7 @@ function _listProcessModulesNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -62468,12 +66477,13 @@ function _listProcessModulesNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -62493,7 +66503,7 @@ function _listProcessModulesNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); + let resultMapper = new client.models['ResourceMetricCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -62509,11 +66519,9 @@ function _listProcessModulesNext(nextPageLink, options, callback) { } /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. + * @summary Gets perfmon counters for web app. * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. + * Gets perfmon counters for web app. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -62530,14 +66538,146 @@ function _listProcessModulesNext(nextPageLink, 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 ProcessThreadInfoCollection} for more + * 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 _listProcessThreadsNext(nextPageLink, options, callback) { +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') { @@ -62625,7 +66765,7 @@ function _listProcessThreadsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); + let resultMapper = new client.models['ProcessInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -62641,9 +66781,11 @@ function _listProcessThreadsNext(nextPageLink, options, callback) { } /** - * @summary Get public certificates for an app or a deployment slot. + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. * - * Get public certificates for an app or a deployment slot. + * 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. @@ -62660,14 +66802,14 @@ function _listProcessThreadsNext(nextPageLink, 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 PublicCertificateCollection} for more + * 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 _listPublicCertificatesNext(nextPageLink, options, callback) { +function _listProcessModulesNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -62720,7 +66862,7 @@ function _listPublicCertificatesNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -62755,7 +66897,7 @@ function _listPublicCertificatesNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PublicCertificateCollection']().mapper(); + let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -62771,9 +66913,11 @@ function _listPublicCertificatesNext(nextPageLink, options, callback) { } /** - * @summary Get list of siteextensions for a web site, or a deployment slot. + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. * - * Get list of siteextensions for a web site, or a deployment slot. + * 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. @@ -62790,14 +66934,14 @@ function _listPublicCertificatesNext(nextPageLink, 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 SiteExtensionInfoCollection} for more + * 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 _listSiteExtensionsNext(nextPageLink, options, callback) { +function _listProcessThreadsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -62885,7 +67029,7 @@ function _listSiteExtensionsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteExtensionInfoCollection']().mapper(); + let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -62901,9 +67045,9 @@ function _listSiteExtensionsNext(nextPageLink, options, callback) { } /** - * @summary Gets an app's deployment slots. + * @summary Get public certificates for an app or a deployment slot. * - * Gets an app's deployment slots. + * Get public certificates for an app or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -62920,13 +67064,14 @@ function _listSiteExtensionsNext(nextPageLink, 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 WebAppCollection} for more information. + * 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 _listSlotsNext(nextPageLink, options, callback) { +function _listPublicCertificatesNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -62989,12 +67134,13 @@ function _listSlotsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -63014,7 +67160,7 @@ function _listSlotsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebAppCollection']().mapper(); + let resultMapper = new client.models['PublicCertificateCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -63030,9 +67176,9 @@ function _listSlotsNext(nextPageLink, options, callback) { } /** - * @summary Gets existing backups of an app. + * @summary Get list of siteextensions for a web site, or a deployment slot. * - * Gets existing backups of an app. + * 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. @@ -63049,13 +67195,14 @@ function _listSlotsNext(nextPageLink, 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 BackupItemCollection} for more information. + * 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 _listBackupsSlotNext(nextPageLink, options, callback) { +function _listSiteExtensionsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -63108,7 +67255,7 @@ function _listBackupsSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -63143,7 +67290,7 @@ function _listBackupsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BackupItemCollection']().mapper(); + let resultMapper = new client.models['SiteExtensionInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -63159,9 +67306,9 @@ function _listBackupsSlotNext(nextPageLink, options, callback) { } /** - * @summary List the configurations of an app + * @summary Gets an app's deployment slots. * - * List the configurations of an app + * Gets an app's deployment slots. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -63178,14 +67325,13 @@ function _listBackupsSlotNext(nextPageLink, 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 SiteConfigResourceCollection} for more - * information. + * 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 _listConfigurationsSlotNext(nextPageLink, options, callback) { +function _listSlotsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -63248,12 +67394,13 @@ function _listConfigurationsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -63273,7 +67420,7 @@ function _listConfigurationsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigResourceCollection']().mapper(); + let resultMapper = new client.models['WebAppCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -63289,11 +67436,9 @@ function _listConfigurationsSlotNext(nextPageLink, options, callback) { } /** - * @summary Gets a list of web app configuration snapshots identifiers. Each - * element of the list contains a timestamp and the ID of the snapshot. + * @summary Gets existing backups of an app. * - * Gets a list of web app configuration snapshots identifiers. Each element of - * the list contains a timestamp and the ID of the snapshot. + * Gets existing backups of an app. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -63310,14 +67455,13 @@ function _listConfigurationsSlotNext(nextPageLink, 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 SiteConfigurationSnapshotInfoCollection} for - * more information. + * 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 _listConfigurationSnapshotInfoSlotNext(nextPageLink, options, callback) { +function _listBackupsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -63380,12 +67524,13 @@ function _listConfigurationSnapshotInfoSlotNext(nextPageLink, options, callback) try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -63405,7 +67550,7 @@ function _listConfigurationSnapshotInfoSlotNext(nextPageLink, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteConfigurationSnapshotInfoCollection']().mapper(); + let resultMapper = new client.models['BackupItemCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -63421,9 +67566,9 @@ function _listConfigurationSnapshotInfoSlotNext(nextPageLink, options, callback) } /** - * @summary List continuous web jobs for an app, or a deployment slot. + * @summary List the configurations of an app * - * List continuous web jobs for an app, or a deployment slot. + * List the configurations of an app * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -63440,14 +67585,14 @@ function _listConfigurationSnapshotInfoSlotNext(nextPageLink, 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 ContinuousWebJobCollection} for more + * 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 _listContinuousWebJobsSlotNext(nextPageLink, options, callback) { +function _listConfigurationsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -63510,12 +67655,13 @@ function _listContinuousWebJobsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -63535,7 +67681,7 @@ function _listContinuousWebJobsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ContinuousWebJobCollection']().mapper(); + let resultMapper = new client.models['SiteConfigResourceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -63551,9 +67697,11 @@ function _listContinuousWebJobsSlotNext(nextPageLink, options, callback) { } /** - * @summary List deployments for an app, or a deployment slot. + * @summary Gets a list of web app configuration snapshots identifiers. Each + * element of the list contains a timestamp and the ID of the snapshot. * - * List deployments for an app, or a deployment slot. + * 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. @@ -63570,13 +67718,14 @@ function _listContinuousWebJobsSlotNext(nextPageLink, 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 DeploymentCollection} for more information. + * 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 _listDeploymentsSlotNext(nextPageLink, options, callback) { +function _listConfigurationSnapshotInfoSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -63639,12 +67788,13 @@ function _listDeploymentsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -63664,136 +67814,7 @@ function _listDeploymentsSlotNext(nextPageLink, options, callback) { 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) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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(); + let resultMapper = new client.models['SiteConfigurationSnapshotInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -63809,9 +67830,9 @@ function _listDomainOwnershipIdentifiersSlotNext(nextPageLink, options, callback } /** - * @summary List the functions for a web site, or a deployment slot. + * @summary List continuous web jobs for an app, or a deployment slot. * - * List the functions for a web site, 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. @@ -63828,14 +67849,14 @@ function _listDomainOwnershipIdentifiersSlotNext(nextPageLink, 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 FunctionEnvelopeCollection} for more + * 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 _listInstanceFunctionsSlotNext(nextPageLink, options, callback) { +function _listContinuousWebJobsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -63888,7 +67909,7 @@ function _listInstanceFunctionsSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -63898,12 +67919,13 @@ function _listInstanceFunctionsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -63923,7 +67945,7 @@ function _listInstanceFunctionsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['FunctionEnvelopeCollection']().mapper(); + let resultMapper = new client.models['ContinuousWebJobCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -63939,9 +67961,9 @@ function _listInstanceFunctionsSlotNext(nextPageLink, options, callback) { } /** - * @summary Get hostname bindings for an app or a deployment slot. + * @summary List deployments for an app, or a deployment slot. * - * Get hostname bindings 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. @@ -63958,14 +67980,13 @@ function _listInstanceFunctionsSlotNext(nextPageLink, 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 HostNameBindingCollection} for more - * information. + * 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 _listHostNameBindingsSlotNext(nextPageLink, options, callback) { +function _listDeploymentsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -64028,12 +68049,13 @@ function _listHostNameBindingsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -64053,7 +68075,7 @@ function _listHostNameBindingsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['HostNameBindingCollection']().mapper(); + let resultMapper = new client.models['DeploymentCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -64069,9 +68091,9 @@ function _listHostNameBindingsSlotNext(nextPageLink, options, callback) { } /** - * @summary Gets all scale-out instances of an app. + * @summary Lists ownership identifiers for domain associated with web app. * - * Gets all scale-out instances of an app. + * Lists ownership identifiers for domain associated with web app. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -64088,14 +68110,13 @@ function _listHostNameBindingsSlotNext(nextPageLink, 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 WebAppInstanceCollection} for more - * information. + * 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 _listInstanceIdentifiersSlotNext(nextPageLink, options, callback) { +function _listDomainOwnershipIdentifiersSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -64158,12 +68179,13 @@ function _listInstanceIdentifiersSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -64183,7 +68205,7 @@ function _listInstanceIdentifiersSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebAppInstanceCollection']().mapper(); + let resultMapper = new client.models['IdentifierCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -64199,11 +68221,9 @@ function _listInstanceIdentifiersSlotNext(nextPageLink, options, callback) { } /** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. + * @summary List the functions for a web site, or a deployment slot. * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. + * List the functions for a web site, or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -64220,13 +68240,14 @@ function _listInstanceIdentifiersSlotNext(nextPageLink, 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 ProcessInfoCollection} for more information. + * 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 _listInstanceProcessesSlotNext(nextPageLink, options, callback) { +function _listInstanceFunctionsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -64314,7 +68335,7 @@ function _listInstanceProcessesSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfoCollection']().mapper(); + let resultMapper = new client.models['FunctionEnvelopeCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -64330,11 +68351,9 @@ function _listInstanceProcessesSlotNext(nextPageLink, options, callback) { } /** - * @summary List module information for a process by its ID for a specific - * scaled-out instance in a web site. + * @summary Get hostname bindings for an app or a deployment slot. * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. + * Get hostname bindings for an app or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -64351,14 +68370,14 @@ function _listInstanceProcessesSlotNext(nextPageLink, 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 ProcessModuleInfoCollection} for more + * 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 _listInstanceProcessModulesSlotNext(nextPageLink, options, callback) { +function _listHostNameBindingsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -64411,7 +68430,7 @@ function _listInstanceProcessModulesSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -64421,12 +68440,13 @@ function _listInstanceProcessModulesSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -64446,7 +68466,7 @@ function _listInstanceProcessModulesSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); + let resultMapper = new client.models['HostNameBindingCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -64462,11 +68482,9 @@ function _listInstanceProcessModulesSlotNext(nextPageLink, options, callback) { } /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. + * @summary Gets all scale-out instances of an app. * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. + * Gets all scale-out instances of an app. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -64483,14 +68501,14 @@ function _listInstanceProcessModulesSlotNext(nextPageLink, 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 ProcessThreadInfoCollection} for more + * 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 _listInstanceProcessThreadsSlotNext(nextPageLink, options, callback) { +function _listInstanceIdentifiersSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -64543,7 +68561,7 @@ function _listInstanceProcessThreadsSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -64553,12 +68571,13 @@ function _listInstanceProcessThreadsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -64578,7 +68597,7 @@ function _listInstanceProcessThreadsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); + let resultMapper = new client.models['WebAppInstanceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -64594,10 +68613,11 @@ function _listInstanceProcessThreadsSlotNext(nextPageLink, options, callback) { } /** - * @summary Gets all metric definitions of an app (or deployment slot, if - * specified). + * @summary Get list of processes for a web site, or a deployment slot, or for + * a specific scaled-out instance in a web site. * - * Gets all metric definitions of an app (or deployment slot, if specified). + * 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. @@ -64614,14 +68634,13 @@ function _listInstanceProcessThreadsSlotNext(nextPageLink, 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 ResourceMetricDefinitionCollection} for more - * information. + * 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 _listMetricDefinitionsSlotNext(nextPageLink, options, callback) { +function _listInstanceProcessesSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -64674,7 +68693,7 @@ function _listMetricDefinitionsSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -64709,7 +68728,7 @@ function _listMetricDefinitionsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); + let resultMapper = new client.models['ProcessInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -64725,10 +68744,11 @@ function _listMetricDefinitionsSlotNext(nextPageLink, options, callback) { } /** - * @summary Gets performance metrics of an app (or deployment slot, if - * specified). + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. * - * Gets performance metrics of an app (or deployment slot, if specified). + * 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. @@ -64745,14 +68765,14 @@ function _listMetricDefinitionsSlotNext(nextPageLink, 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 ResourceMetricCollection} for more + * 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 _listMetricsSlotNext(nextPageLink, options, callback) { +function _listInstanceProcessModulesSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -64805,7 +68825,7 @@ function _listMetricsSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -64840,7 +68860,7 @@ function _listMetricsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ResourceMetricCollection']().mapper(); + let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -64856,9 +68876,11 @@ function _listMetricsSlotNext(nextPageLink, options, callback) { } /** - * @summary Gets perfmon counters for web app. + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. * - * Gets perfmon counters for web app. + * 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. @@ -64875,14 +68897,14 @@ function _listMetricsSlotNext(nextPageLink, 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 PerfMonCounterCollection} for more + * 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 _listPerfMonCountersSlotNext(nextPageLink, options, callback) { +function _listInstanceProcessThreadsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -64935,7 +68957,7 @@ function _listPerfMonCountersSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -64970,7 +68992,7 @@ function _listPerfMonCountersSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PerfMonCounterCollection']().mapper(); + let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -64986,11 +69008,10 @@ function _listPerfMonCountersSlotNext(nextPageLink, options, callback) { } /** - * @summary Get list of processes for a web site, or a deployment slot, or for - * a specific scaled-out instance in a web site. + * @summary Gets all metric definitions of an app (or deployment slot, if + * specified). * - * Get list of processes for a web site, or a deployment slot, or for a - * specific scaled-out instance in a web site. + * 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. @@ -65007,13 +69028,14 @@ function _listPerfMonCountersSlotNext(nextPageLink, 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 ProcessInfoCollection} for more information. + * 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 _listProcessesSlotNext(nextPageLink, options, callback) { +function _listMetricDefinitionsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -65066,7 +69088,7 @@ function _listProcessesSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -65076,12 +69098,13 @@ function _listProcessesSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -65101,7 +69124,7 @@ function _listProcessesSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessInfoCollection']().mapper(); + let resultMapper = new client.models['ResourceMetricDefinitionCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -65117,11 +69140,10 @@ function _listProcessesSlotNext(nextPageLink, options, callback) { } /** - * @summary List module information for a process by its ID for a specific - * scaled-out instance in a web site. + * @summary Gets performance metrics of an app (or deployment slot, if + * specified). * - * List module information for a process by its ID for a specific scaled-out - * instance in a web site. + * Gets performance metrics of an app (or deployment slot, if specified). * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -65138,14 +69160,14 @@ function _listProcessesSlotNext(nextPageLink, 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 ProcessModuleInfoCollection} for more + * 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 _listProcessModulesSlotNext(nextPageLink, options, callback) { +function _listMetricsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -65198,7 +69220,7 @@ function _listProcessModulesSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -65208,12 +69230,13 @@ function _listProcessModulesSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -65233,7 +69256,7 @@ function _listProcessModulesSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); + let resultMapper = new client.models['ResourceMetricCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -65249,11 +69272,9 @@ function _listProcessModulesSlotNext(nextPageLink, options, callback) { } /** - * @summary List the threads in a process by its ID for a specific scaled-out - * instance in a web site. + * @summary Gets perfmon counters for web app. * - * List the threads in a process by its ID for a specific scaled-out instance - * in a web site. + * Gets perfmon counters for web app. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -65270,14 +69291,146 @@ function _listProcessModulesSlotNext(nextPageLink, 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 ProcessThreadInfoCollection} for more + * 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 _listProcessThreadsSlotNext(nextPageLink, options, callback) { +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') { @@ -65365,7 +69518,7 @@ function _listProcessThreadsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); + let resultMapper = new client.models['ProcessInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -65381,9 +69534,11 @@ function _listProcessThreadsSlotNext(nextPageLink, options, callback) { } /** - * @summary Get public certificates for an app or a deployment slot. + * @summary List module information for a process by its ID for a specific + * scaled-out instance in a web site. * - * Get public certificates for an app or a deployment slot. + * 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. @@ -65400,14 +69555,14 @@ function _listProcessThreadsSlotNext(nextPageLink, 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 PublicCertificateCollection} for more + * 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 _listPublicCertificatesSlotNext(nextPageLink, options, callback) { +function _listProcessModulesSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -65460,7 +69615,7 @@ function _listPublicCertificatesSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -65495,7 +69650,7 @@ function _listPublicCertificatesSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['PublicCertificateCollection']().mapper(); + let resultMapper = new client.models['ProcessModuleInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -65511,9 +69666,11 @@ function _listPublicCertificatesSlotNext(nextPageLink, options, callback) { } /** - * @summary Get list of siteextensions for a web site, or a deployment slot. + * @summary List the threads in a process by its ID for a specific scaled-out + * instance in a web site. * - * Get list of siteextensions for a web site, or a deployment slot. + * 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. @@ -65530,14 +69687,14 @@ function _listPublicCertificatesSlotNext(nextPageLink, 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 SiteExtensionInfoCollection} for more + * 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 _listSiteExtensionsSlotNext(nextPageLink, options, callback) { +function _listProcessThreadsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -65625,7 +69782,7 @@ function _listSiteExtensionsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SiteExtensionInfoCollection']().mapper(); + let resultMapper = new client.models['ProcessThreadInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -65641,10 +69798,9 @@ function _listSiteExtensionsSlotNext(nextPageLink, options, callback) { } /** - * @summary Get the difference in configuration settings between two web app - * slots. + * @summary Get public certificates for an app or a deployment slot. * - * Get the difference in configuration settings between two web app slots. + * Get public certificates for an app or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -65661,14 +69817,14 @@ function _listSiteExtensionsSlotNext(nextPageLink, 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 SlotDifferenceCollection} for more + * 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 _listSlotDifferencesSlotNext(nextPageLink, options, callback) { +function _listPublicCertificatesSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -65696,7 +69852,7 @@ function _listSlotDifferencesSlotNext(nextPageLink, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -65731,12 +69887,13 @@ function _listSlotDifferencesSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -65756,7 +69913,7 @@ function _listSlotDifferencesSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SlotDifferenceCollection']().mapper(); + let resultMapper = new client.models['PublicCertificateCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -65772,9 +69929,9 @@ function _listSlotDifferencesSlotNext(nextPageLink, options, callback) { } /** - * @summary Returns all Snapshots to the user. + * @summary Get list of siteextensions for a web site, or a deployment slot. * - * Returns all Snapshots to the user. + * 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. @@ -65791,13 +69948,14 @@ function _listSlotDifferencesSlotNext(nextPageLink, 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 SnapshotCollection} for more information. + * 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 _listSnapshotsSlotNext(nextPageLink, options, callback) { +function _listSiteExtensionsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -65850,7 +70008,7 @@ function _listSnapshotsSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -65885,7 +70043,7 @@ function _listSnapshotsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SnapshotCollection']().mapper(); + let resultMapper = new client.models['SiteExtensionInfoCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -65901,9 +70059,10 @@ function _listSnapshotsSlotNext(nextPageLink, options, callback) { } /** - * @summary List triggered web jobs for an app, or a deployment slot. + * @summary Get the difference in configuration settings between two web app + * slots. * - * List triggered web jobs for an app, or a deployment slot. + * Get the difference in configuration settings between two web app slots. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -65920,14 +70079,14 @@ function _listSnapshotsSlotNext(nextPageLink, 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 TriggeredWebJobCollection} for more + * 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 _listTriggeredWebJobsSlotNext(nextPageLink, options, callback) { +function _listSlotDifferencesSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -65955,7 +70114,7 @@ function _listTriggeredWebJobsSlotNext(nextPageLink, options, callback) { // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'GET'; + httpRequest.method = 'POST'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -65990,12 +70149,13 @@ function _listTriggeredWebJobsSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -66015,7 +70175,7 @@ function _listTriggeredWebJobsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TriggeredWebJobCollection']().mapper(); + let resultMapper = new client.models['SlotDifferenceCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -66031,10 +70191,9 @@ function _listTriggeredWebJobsSlotNext(nextPageLink, options, callback) { } /** - * @summary List a triggered web job's history for an app, or a deployment - * slot. + * @summary Returns all Snapshots to the user. * - * List a triggered web job's history for an app, or a deployment slot. + * Returns all Snapshots to the user. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -66051,14 +70210,13 @@ function _listTriggeredWebJobsSlotNext(nextPageLink, 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 TriggeredJobHistoryCollection} for more - * information. + * 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 _listTriggeredWebJobHistorySlotNext(nextPageLink, options, callback) { +function _listSnapshotsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -66111,7 +70269,7 @@ function _listTriggeredWebJobHistorySlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -66121,12 +70279,13 @@ function _listTriggeredWebJobHistorySlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -66146,7 +70305,7 @@ function _listTriggeredWebJobHistorySlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TriggeredJobHistoryCollection']().mapper(); + let resultMapper = new client.models['SnapshotCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -66162,11 +70321,9 @@ function _listTriggeredWebJobHistorySlotNext(nextPageLink, options, callback) { } /** - * @summary Gets the quota usage information of an app (or deployment slot, if - * specified). + * @summary List triggered web jobs for an app, or a deployment slot. * - * Gets the quota usage information of an app (or deployment slot, if - * specified). + * List triggered web jobs for an app, or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -66183,14 +70340,14 @@ function _listTriggeredWebJobHistorySlotNext(nextPageLink, 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 CsmUsageQuotaCollection} for more + * 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 _listUsagesSlotNext(nextPageLink, options, callback) { +function _listTriggeredWebJobsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -66253,12 +70410,13 @@ function _listUsagesSlotNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -66278,7 +70436,7 @@ function _listUsagesSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['CsmUsageQuotaCollection']().mapper(); + let resultMapper = new client.models['TriggeredWebJobCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -66294,9 +70452,10 @@ function _listUsagesSlotNext(nextPageLink, options, callback) { } /** - * @summary List webjobs for an app, or a deployment slot. + * @summary List a triggered web job's history for an app, or a deployment + * slot. * - * List webjobs 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. @@ -66313,13 +70472,14 @@ function _listUsagesSlotNext(nextPageLink, 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 WebJobCollection} for more information. + * 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 _listWebJobsSlotNext(nextPageLink, options, callback) { +function _listTriggeredWebJobHistorySlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -66372,7 +70532,7 @@ function _listWebJobsSlotNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -66407,7 +70567,7 @@ function _listWebJobsSlotNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['WebJobCollection']().mapper(); + let resultMapper = new client.models['TriggeredJobHistoryCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -66423,10 +70583,11 @@ function _listWebJobsSlotNext(nextPageLink, options, callback) { } /** - * @summary Get the difference in configuration settings between two web app - * slots. + * @summary Gets the quota usage information of an app (or deployment slot, if + * specified). * - * Get the difference in configuration settings between two web app slots. + * 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. @@ -66443,14 +70604,14 @@ function _listWebJobsSlotNext(nextPageLink, 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 SlotDifferenceCollection} for more + * 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 _listSlotDifferencesFromProductionNext(nextPageLink, options, callback) { +function _listUsagesSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -66478,7 +70639,7 @@ function _listSlotDifferencesFromProductionNext(nextPageLink, options, callback) // Create HTTP transport objects let httpRequest = new WebResource(); - httpRequest.method = 'POST'; + httpRequest.method = 'GET'; httpRequest.url = requestUrl; httpRequest.headers = {}; // Set Headers @@ -66513,12 +70674,13 @@ function _listSlotDifferencesFromProductionNext(nextPageLink, options, callback) try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -66538,7 +70700,7 @@ function _listSlotDifferencesFromProductionNext(nextPageLink, options, callback) parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SlotDifferenceCollection']().mapper(); + let resultMapper = new client.models['CsmUsageQuotaCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -66554,9 +70716,9 @@ function _listSlotDifferencesFromProductionNext(nextPageLink, options, callback) } /** - * @summary Returns all Snapshots to the user. + * @summary List webjobs for an app, or a deployment slot. * - * Returns all Snapshots to the user. + * List webjobs for an app, or a deployment slot. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -66573,13 +70735,13 @@ function _listSlotDifferencesFromProductionNext(nextPageLink, 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 SnapshotCollection} for more information. + * 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 _listSnapshotsNext(nextPageLink, options, callback) { +function _listWebJobsSlotNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -66642,12 +70804,13 @@ function _listSnapshotsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -66667,7 +70830,7 @@ function _listSnapshotsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['SnapshotCollection']().mapper(); + let resultMapper = new client.models['WebJobCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -66683,9 +70846,10 @@ function _listSnapshotsNext(nextPageLink, options, callback) { } /** - * @summary List triggered web jobs for an app, or a deployment slot. + * @summary Get the difference in configuration settings between two web app + * slots. * - * List triggered web jobs for an app, or a deployment slot. + * Get the difference in configuration settings between two web app slots. * * @param {string} nextPageLink The NextLink from the previous successful call * to List operation. @@ -66702,14 +70866,144 @@ function _listSnapshotsNext(nextPageLink, 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 TriggeredWebJobCollection} for more + * 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 _listTriggeredWebJobsNext(nextPageLink, options, callback) { +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') { @@ -66772,12 +71066,13 @@ function _listTriggeredWebJobsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -66797,7 +71092,7 @@ function _listTriggeredWebJobsNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TriggeredWebJobCollection']().mapper(); + let resultMapper = new client.models['SnapshotCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -66813,10 +71108,9 @@ function _listTriggeredWebJobsNext(nextPageLink, options, callback) { } /** - * @summary List a triggered web job's history for an app, or a deployment - * slot. + * @summary List triggered web jobs for an app, or a deployment slot. * - * List a triggered web job's history 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. @@ -66833,14 +71127,14 @@ function _listTriggeredWebJobsNext(nextPageLink, 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 TriggeredJobHistoryCollection} for more + * 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 _listTriggeredWebJobHistoryNext(nextPageLink, options, callback) { +function _listTriggeredWebJobsNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -66893,7 +71187,7 @@ function _listTriggeredWebJobHistoryNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200 && statusCode !== 404) { + if (statusCode !== 200) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -66903,12 +71197,13 @@ function _listTriggeredWebJobHistoryNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -66928,7 +71223,7 @@ function _listTriggeredWebJobHistoryNext(nextPageLink, options, callback) { parsedResponse = JSON.parse(responseBody); result = JSON.parse(responseBody); if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['TriggeredJobHistoryCollection']().mapper(); + let resultMapper = new client.models['TriggeredWebJobCollection']().mapper(); result = client.deserialize(resultMapper, parsedResponse, 'result'); } } catch (error) { @@ -66944,11 +71239,10 @@ function _listTriggeredWebJobHistoryNext(nextPageLink, options, callback) { } /** - * @summary Gets the quota usage information of an app (or deployment slot, if - * specified). + * @summary List a triggered web job's history for an app, or a deployment + * slot. * - * Gets the quota usage information of an app (or deployment slot, if - * specified). + * 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. @@ -66965,14 +71259,14 @@ function _listTriggeredWebJobHistoryNext(nextPageLink, 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 CsmUsageQuotaCollection} for more + * 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 _listUsagesNext(nextPageLink, options, callback) { +function _listTriggeredWebJobHistoryNext(nextPageLink, options, callback) { /* jshint validthis: true */ let client = this.client; if(!callback && typeof options === 'function') { @@ -67025,7 +71319,7 @@ function _listUsagesNext(nextPageLink, options, callback) { return callback(err); } let statusCode = response.statusCode; - if (statusCode !== 200) { + if (statusCode !== 200 && statusCode !== 404) { let error = new Error(responseBody); error.statusCode = response.statusCode; error.request = msRest.stripRequest(httpRequest); @@ -67054,6 +71348,139 @@ function _listUsagesNext(nextPageLink, options, callback) { let result = null; if (responseBody === '') responseBody = null; // Deserialize Response + if (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 { @@ -67164,12 +71591,13 @@ function _listWebJobsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -67222,7 +71650,6 @@ class WebApps { this._applySlotConfigToProduction = _applySlotConfigToProduction; this._backup = _backup; this._listBackups = _listBackups; - this._discoverRestore = _discoverRestore; this._getBackupStatus = _getBackupStatus; this._deleteBackup = _deleteBackup; this._listBackupStatusSecrets = _listBackupStatusSecrets; @@ -67246,6 +71673,10 @@ class WebApps { 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; @@ -67253,7 +71684,7 @@ class WebApps { this._getConfigurationSnapshot = _getConfigurationSnapshot; this._recoverSiteConfigurationSnapshot = _recoverSiteConfigurationSnapshot; this._getWebSiteContainerLogs = _getWebSiteContainerLogs; - this._getWebSiteContainerLogsZip = _getWebSiteContainerLogsZip; + this._getContainerLogsZip = _getContainerLogsZip; this._listContinuousWebJobs = _listContinuousWebJobs; this._getContinuousWebJob = _getContinuousWebJob; this._deleteContinuousWebJob = _deleteContinuousWebJob; @@ -67264,6 +71695,7 @@ class WebApps { this._createDeployment = _createDeployment; this._deleteDeployment = _deleteDeployment; this._listDeploymentLog = _listDeploymentLog; + this._discoverBackup = _discoverBackup; this._listDomainOwnershipIdentifiers = _listDomainOwnershipIdentifiers; this._getDomainOwnershipIdentifier = _getDomainOwnershipIdentifier; this._createOrUpdateDomainOwnershipIdentifier = _createOrUpdateDomainOwnershipIdentifier; @@ -67322,6 +71754,9 @@ class WebApps { 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; @@ -67335,9 +71770,11 @@ class WebApps { this._createOrUpdatePublicCertificate = _createOrUpdatePublicCertificate; this._deletePublicCertificate = _deletePublicCertificate; this._listPublishingProfileXmlWithSecrets = _listPublishingProfileXmlWithSecrets; - this._recover = _recover; this._resetProductionSlotConfig = _resetProductionSlotConfig; this._restart = _restart; + this._restoreFromBackupBlob = _restoreFromBackupBlob; + this._restoreFromDeletedApp = _restoreFromDeletedApp; + this._restoreSnapshot = _restoreSnapshot; this._listSiteExtensions = _listSiteExtensions; this._getSiteExtension = _getSiteExtension; this._installSiteExtension = _installSiteExtension; @@ -67351,7 +71788,6 @@ class WebApps { this._applySlotConfigurationSlot = _applySlotConfigurationSlot; this._backupSlot = _backupSlot; this._listBackupsSlot = _listBackupsSlot; - this._discoverRestoreSlot = _discoverRestoreSlot; this._getBackupStatusSlot = _getBackupStatusSlot; this._deleteBackupSlot = _deleteBackupSlot; this._listBackupStatusSecretsSlot = _listBackupStatusSecretsSlot; @@ -67373,6 +71809,10 @@ class WebApps { 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; @@ -67380,7 +71820,7 @@ class WebApps { this._getConfigurationSnapshotSlot = _getConfigurationSnapshotSlot; this._recoverSiteConfigurationSnapshotSlot = _recoverSiteConfigurationSnapshotSlot; this._getWebSiteContainerLogsSlot = _getWebSiteContainerLogsSlot; - this._getWebSiteContainerLogsZipSlot = _getWebSiteContainerLogsZipSlot; + this._getContainerLogsZipSlot = _getContainerLogsZipSlot; this._listContinuousWebJobsSlot = _listContinuousWebJobsSlot; this._getContinuousWebJobSlot = _getContinuousWebJobSlot; this._deleteContinuousWebJobSlot = _deleteContinuousWebJobSlot; @@ -67391,6 +71831,7 @@ class WebApps { this._createDeploymentSlot = _createDeploymentSlot; this._deleteDeploymentSlot = _deleteDeploymentSlot; this._listDeploymentLogSlot = _listDeploymentLogSlot; + this._discoverBackupSlot = _discoverBackupSlot; this._listDomainOwnershipIdentifiersSlot = _listDomainOwnershipIdentifiersSlot; this._getDomainOwnershipIdentifierSlot = _getDomainOwnershipIdentifierSlot; this._createOrUpdateDomainOwnershipIdentifierSlot = _createOrUpdateDomainOwnershipIdentifierSlot; @@ -67447,6 +71888,9 @@ class WebApps { 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; @@ -67460,9 +71904,11 @@ class WebApps { this._createOrUpdatePublicCertificateSlot = _createOrUpdatePublicCertificateSlot; this._deletePublicCertificateSlot = _deletePublicCertificateSlot; this._listPublishingProfileXmlWithSecretsSlot = _listPublishingProfileXmlWithSecretsSlot; - this._recoverSlot = _recoverSlot; this._resetSlotConfigurationSlot = _resetSlotConfigurationSlot; this._restartSlot = _restartSlot; + this._restoreFromBackupBlobSlot = _restoreFromBackupBlobSlot; + this._restoreFromDeletedAppSlot = _restoreFromDeletedAppSlot; + this._restoreSnapshotSlot = _restoreSnapshotSlot; this._listSiteExtensionsSlot = _listSiteExtensionsSlot; this._getSiteExtensionSlot = _getSiteExtensionSlot; this._installSiteExtensionSlot = _installSiteExtensionSlot; @@ -67531,7 +71977,9 @@ class WebApps { this._beginCreateInstanceMSDeployOperation = _beginCreateInstanceMSDeployOperation; this._beginMigrateStorage = _beginMigrateStorage; this._beginMigrateMySql = _beginMigrateMySql; - this._beginRecover = _beginRecover; + this._beginRestoreFromBackupBlob = _beginRestoreFromBackupBlob; + this._beginRestoreFromDeletedApp = _beginRestoreFromDeletedApp; + this._beginRestoreSnapshot = _beginRestoreSnapshot; this._beginInstallSiteExtension = _beginInstallSiteExtension; this._beginCreateOrUpdateSlot = _beginCreateOrUpdateSlot; this._beginRestoreSlot = _beginRestoreSlot; @@ -67539,7 +71987,9 @@ class WebApps { this._beginCreateMSDeployOperationSlot = _beginCreateMSDeployOperationSlot; this._beginCreateInstanceFunctionSlot = _beginCreateInstanceFunctionSlot; this._beginCreateInstanceMSDeployOperationSlot = _beginCreateInstanceMSDeployOperationSlot; - this._beginRecoverSlot = _beginRecoverSlot; + this._beginRestoreFromBackupBlobSlot = _beginRestoreFromBackupBlobSlot; + this._beginRestoreFromDeletedAppSlot = _beginRestoreFromDeletedAppSlot; + this._beginRestoreSnapshotSlot = _beginRestoreSnapshotSlot; this._beginInstallSiteExtensionSlot = _beginInstallSiteExtensionSlot; this._beginSwapSlotSlot = _beginSwapSlotSlot; this._beginCreateOrUpdateSourceControlSlot = _beginCreateOrUpdateSourceControlSlot; @@ -67902,6 +72352,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -67920,6 +72372,9 @@ class WebApps { * @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. @@ -68118,9 +72573,29 @@ class WebApps { * @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. @@ -68196,51 +72671,17 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests * * @param {object} [siteEnvelope.identity] * - * @param {object} [siteEnvelope.identity.type] Type of managed service - * 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. * @@ -68250,19 +72691,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -68316,6 +72744,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -68334,6 +72764,9 @@ class WebApps { * @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. @@ -68532,9 +72965,29 @@ class WebApps { * @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. @@ -68610,51 +73063,17 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests * * @param {object} [siteEnvelope.identity] * - * @param {object} [siteEnvelope.identity.type] Type of managed service - * 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. * @@ -68664,19 +73083,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -68742,9 +73148,6 @@ class WebApps { * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -68788,9 +73191,6 @@ class WebApps { * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -68865,6 +73265,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -68883,6 +73285,9 @@ class WebApps { * @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. @@ -69081,9 +73486,29 @@ class WebApps { * @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. @@ -69159,43 +73584,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -69204,19 +73592,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -69270,6 +73645,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -69288,6 +73665,9 @@ class WebApps { * @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. @@ -69486,9 +73866,29 @@ class WebApps { * @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. @@ -69564,43 +73964,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -69609,19 +73972,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -69890,8 +74240,6 @@ class WebApps { * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName 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. @@ -69922,9 +74270,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -69965,8 +74310,6 @@ class WebApps { * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName 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. @@ -69997,9 +74340,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -70141,184 +74481,6 @@ class WebApps { } } - /** - * @summary Discovers an existing app backup that can be restored from a blob - * in Azure storage. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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. - */ - discoverRestoreWithHttpOperationResponse(resourceGroupName, name, request, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._discoverRestore(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. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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. - */ - discoverRestore(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._discoverRestore(resourceGroupName, name, request, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._discoverRestore(resourceGroupName, name, request, options, optionalCallback); - } - } - /** * @summary Gets a backup of an app by its ID. * @@ -70530,8 +74692,6 @@ class WebApps { * * @param {object} request Information on backup request. * - * @param {string} request.backupRequestName 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. @@ -70562,9 +74722,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -70612,8 +74769,6 @@ class WebApps { * * @param {object} request Information on backup request. * - * @param {string} request.backupRequestName 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. @@ -70644,9 +74799,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -70739,7 +74891,7 @@ class WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -70757,7 +74909,7 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -70818,7 +74970,7 @@ class WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -70841,7 +74993,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {RestoreResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -70849,8 +75001,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} 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. * @@ -71240,6 +75391,9 @@ class WebApps { * 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 @@ -71418,6 +75572,9 @@ class WebApps { * 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 @@ -71647,8 +75804,6 @@ class WebApps { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName 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. @@ -71679,9 +75834,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -71721,8 +75873,6 @@ class WebApps { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName 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. @@ -71753,9 +75903,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. @@ -73135,7 +77282,126 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - listSlotConfigurationNames(resourceGroupName, name, options, optionalCallback) { + 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 {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 {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') { @@ -73144,39 +77410,136 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listSlotConfigurationNames(resourceGroupName, name, options, (err, result, request, response) => { + self._updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listSlotConfigurationNames(resourceGroupName, name, options, optionalCallback); + return self._updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, options, optionalCallback); } } /** - * @summary Updates the names of application settings and connection string - * that remain with the slot during swap operation. + * @summary Gets a Swift Virtual Network connection. * - * Updates the names of application settings and connection string that remain - * with the slot during swap operation. + * 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} slotConfigNames Names of application settings and connection - * strings. See example. + * @param {object} [options] Optional Parameters. * - * @param {array} [slotConfigNames.connectionStringNames] List of connection - * string names. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {array} [slotConfigNames.appSettingNames] List of application - * settings names. + * @returns {Promise} A promise is returned * - * @param {string} [slotConfigNames.kind] Kind of resource. + * @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. * @@ -73185,15 +77548,15 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - updateSlotConfigurationNamesWithHttpOperationResponse(resourceGroupName, name, slotConfigNames, options) { + createOrUpdateSwiftVirtualNetworkConnectionWithHttpOperationResponse(resourceGroupName, name, connectionEnvelope, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, options, (err, result, request, response) => { + self._createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -73204,27 +77567,32 @@ class WebApps { } /** - * @summary Updates the names of application settings and connection string - * that remain with the slot during swap operation. + * @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. * - * Updates the names of application settings and connection string that remain - * with the slot during swap operation. + * 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} slotConfigNames Names of application settings and connection - * strings. See example. + * @param {object} connectionEnvelope Properties of the Virtual Network + * connection. See example. * - * @param {array} [slotConfigNames.connectionStringNames] List of connection - * string names. + * @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 {array} [slotConfigNames.appSettingNames] List of application - * settings names. + * @param {boolean} [connectionEnvelope.swiftSupported] A flag that specifies + * if the scale unit this Web App is on supports Swift integration. * - * @param {string} [slotConfigNames.kind] Kind of resource. + * @param {string} [connectionEnvelope.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -73238,7 +77606,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {SlotConfigNamesResource} - The deserialized result object. + * @resolve {SwiftVirtualNetwork} - The deserialized result object. * * @reject {Error} - The error object. * @@ -73247,14 +77615,13 @@ class WebApps { * {Error} 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. + * 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. */ - updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, options, optionalCallback) { + createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -73263,14 +77630,235 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, options, (err, result, request, response) => { + self._createOrUpdateSwiftVirtualNetworkConnection(resourceGroupName, name, connectionEnvelope, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._updateSlotConfigurationNames(resourceGroupName, name, slotConfigNames, options, optionalCallback); + 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); } } @@ -73397,6 +77985,9 @@ class WebApps { * * @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. * @@ -73574,8 +78165,28 @@ class WebApps { * @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. @@ -73630,6 +78241,9 @@ class WebApps { * * @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. * @@ -73807,8 +78421,28 @@ class WebApps { * @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. @@ -73885,6 +78519,9 @@ class WebApps { * * @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. * @@ -74062,8 +78699,28 @@ class WebApps { * @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. @@ -74118,6 +78775,9 @@ class WebApps { * * @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. * @@ -74295,8 +78955,28 @@ class WebApps { * @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. @@ -74748,11 +79428,11 @@ class WebApps { * * @reject {Error} - The error object. */ - getWebSiteContainerLogsZipWithHttpOperationResponse(resourceGroupName, name, options) { + getContainerLogsZipWithHttpOperationResponse(resourceGroupName, name, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getWebSiteContainerLogsZip(resourceGroupName, name, options, (err, result, request, response) => { + self._getContainerLogsZip(resourceGroupName, name, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -74798,7 +79478,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getWebSiteContainerLogsZip(resourceGroupName, name, options, optionalCallback) { + getContainerLogsZip(resourceGroupName, name, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -74807,14 +79487,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getWebSiteContainerLogsZip(resourceGroupName, name, options, (err, result, request, response) => { + self._getContainerLogsZip(resourceGroupName, name, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getWebSiteContainerLogsZip(resourceGroupName, name, options, optionalCallback); + return self._getContainerLogsZip(resourceGroupName, name, options, optionalCallback); } } @@ -75464,7 +80144,348 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getDeployment(resourceGroupName, name, id, options, optionalCallback) { + 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') { @@ -75473,174 +80494,70 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeployment(resourceGroupName, name, id, options, (err, result, request, response) => { + self._listDeploymentLog(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); + return self._listDeploymentLog(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 {string} [deployment.deploymentId] Identifier for deployment. - * - * @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. + * @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. * - * Create a deployment for an app, or a deployment slot. + * 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 {string} id ID of an existing deployment. - * - * @param {object} deployment Deployment details. - * - * @param {string} [deployment.deploymentId] Identifier for deployment. - * - * @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. + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. * - * {Promise} A promise is returned + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @resolve {Deployment} - The deserialized result object. + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @reject {Error} - The error object. + * @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. * - * {function} optionalCallback(err, result, request, response) + * @param {string} [request.siteName] Name of an app. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Deployment} for more information. + * @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. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * {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. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * Delete a deployment by its ID for an app, or a deployment slot. + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. * - * @param {string} name Name of the app. + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). * - * @param {string} id Deployment ID. + * @param {string} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -75649,15 +80566,15 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - deleteDeploymentWithHttpOperationResponse(resourceGroupName, name, id, options) { + discoverBackupWithHttpOperationResponse(resourceGroupName, name, request, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._deleteDeployment(resourceGroupName, name, id, options, (err, result, request, response) => { + self._discoverBackup(resourceGroupName, name, request, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -75668,119 +80585,58 @@ class WebApps { } /** - * @summary Delete a deployment by its ID for an app, or a deployment slot. + * @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. * - * Delete a deployment by its ID for an app, or a deployment slot. + * 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 {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 {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @param {string} name Name of the app. + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @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 {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 {object} [options] Optional Parameters. + * @param {string} [request.siteName] Name of an app. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. * - * @returns {Promise} A promise is returned + * @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. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * @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. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * List deployment log for specific deployment for an app, or a deployment - * slot. + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. * - * @param {string} name Name of the app. + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). * - * @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} [request.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -75794,7 +80650,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Deployment} - The deserialized result object. + * @resolve {RestoreRequest} - The deserialized result object. * * @reject {Error} - The error object. * @@ -75803,13 +80659,13 @@ class WebApps { * {Error} 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. + * 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. */ - listDeploymentLog(resourceGroupName, name, id, options, optionalCallback) { + discoverBackup(resourceGroupName, name, request, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -75818,14 +80674,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listDeploymentLog(resourceGroupName, name, id, options, (err, result, request, response) => { + self._discoverBackup(resourceGroupName, name, request, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listDeploymentLog(resourceGroupName, name, id, options, optionalCallback); + return self._discoverBackup(resourceGroupName, name, request, options, optionalCallback); } } @@ -76980,6 +81836,8 @@ class WebApps { * * @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. @@ -77038,6 +81896,8 @@ class WebApps { * * @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. @@ -81846,12 +86706,6 @@ class WebApps { * * @param {string} [premierAddOn.vendor] Premier add on Vendor. * - * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * * @param {string} [premierAddOn.marketplacePublisher] Premier add on * Marketplace publisher. * @@ -81910,12 +86764,6 @@ class WebApps { * * @param {string} [premierAddOn.vendor] Premier add on Vendor. * - * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * * @param {string} [premierAddOn.marketplacePublisher] Premier add on * Marketplace publisher. * @@ -82070,6 +86918,346 @@ class WebApps { } } + /** + * @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. @@ -83384,46 +88572,256 @@ class WebApps { } /** - * @summary Recovers a web app to a previous snapshot. + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * Recovers a web app to a previous snapshot. + * 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 web app. + * @param {string} name Name of the app. * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} [options] Optional Parameters. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @returns {Promise} A promise is returned * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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. + * @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. * - * @param {boolean} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. + * Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {boolean} [recoveryEntity.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} 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 {string} [recoveryEntity.kind] Kind of resource. + * @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. * @@ -83436,11 +88834,11 @@ class WebApps { * * @reject {Error} - The error object. */ - recoverWithHttpOperationResponse(resourceGroupName, name, recoveryEntity, options) { + restoreFromBackupBlobWithHttpOperationResponse(resourceGroupName, name, request, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._recover(resourceGroupName, name, recoveryEntity, options, (err, result, request, response) => { + self._restoreFromBackupBlob(resourceGroupName, name, request, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -83451,46 +88849,175 @@ class WebApps { } /** - * @summary Recovers a web app to a previous snapshot. + * @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. * - * Recovers a web app to a previous snapshot. + * 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Deleted web app restore information. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @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} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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 {string} [restoreRequest.kind] Kind of resource. * - * @param {boolean} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. + * @param {object} [options] Optional Parameters. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {boolean} [recoveryEntity.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. + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -83518,7 +89045,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - recover(resourceGroupName, name, recoveryEntity, options, optionalCallback) { + restoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -83527,132 +89054,62 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._recover(resourceGroupName, name, recoveryEntity, options, (err, result, request, response) => { + self._restoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._recover(resourceGroupName, name, recoveryEntity, options, optionalCallback); + return self._restoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, optionalCallback); } } /** - * @summary Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * @summary Restores a web app from a snapshot. * - * Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * 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 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. + * @param {string} name Name of web app. * - * @reject {Error} - The error object. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * {function} optionalCallback(err, result, request, response) + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @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. * - * {null} [result] - The deserialized result object if an error did not occur. + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * {object} [request] - The HTTP Request object if an error did not occur. + * @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. * - * {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). + * @param {boolean} restoreRequest.overwrite If true the restore + * operation can overwrite source app; otherwise, false. * - * Restarts an app (or deployment slot, if specified). + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site + * configuration, in addition to content, will be reverted. * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @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} name Name of the app. + * @param {string} [restoreRequest.kind] Kind of resource. * * @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 * @@ -83662,11 +89119,11 @@ class WebApps { * * @reject {Error} - The error object. */ - restartWithHttpOperationResponse(resourceGroupName, name, options) { + restoreSnapshotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._restart(resourceGroupName, name, options, (err, result, request, response) => { + self._restoreSnapshot(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -83677,24 +89134,49 @@ class WebApps { } /** - * @summary Restarts an app (or deployment slot, if specified). + * @summary Restores a web app from a snapshot. * - * Restarts an app (or deployment slot, if specified). + * 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 the app. + * @param {string} name Name of web app. * - * @param {object} [options] Optional Parameters. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @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 {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @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} [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 @@ -83720,7 +89202,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - restart(resourceGroupName, name, options, optionalCallback) { + restoreSnapshot(resourceGroupName, name, restoreRequest, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -83729,14 +89211,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._restart(resourceGroupName, name, options, (err, result, request, response) => { + self._restoreSnapshot(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._restart(resourceGroupName, name, options, optionalCallback); + return self._restoreSnapshot(resourceGroupName, name, restoreRequest, options, optionalCallback); } } @@ -84344,6 +89826,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -84362,6 +89846,9 @@ class WebApps { * @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. @@ -84560,9 +90047,29 @@ class WebApps { * @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. @@ -84638,51 +90145,17 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests * * @param {object} [siteEnvelope.identity] * - * @param {object} [siteEnvelope.identity.type] Type of managed service - * 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. * @@ -84695,19 +90168,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -84761,6 +90221,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -84779,6 +90241,9 @@ class WebApps { * @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. @@ -84977,9 +90442,29 @@ class WebApps { * @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. @@ -85055,51 +90540,17 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests * * @param {object} [siteEnvelope.identity] * - * @param {object} [siteEnvelope.identity.type] Type of managed service - * 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. * @@ -85112,19 +90563,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -85193,9 +90631,6 @@ class WebApps { * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -85242,9 +90677,6 @@ class WebApps { * empty App Service plan. By default, the empty App Service plan is not * deleted. * - * @param {boolean} [options.skipDnsRegistration] If true, DNS registration is - * skipped. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -85319,6 +90751,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -85337,6 +90771,9 @@ class WebApps { * @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. @@ -85535,9 +90972,29 @@ class WebApps { * @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. @@ -85613,43 +91070,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -85661,19 +91081,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -85727,6 +91134,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -85745,6 +91154,9 @@ class WebApps { * @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. @@ -85943,9 +91355,29 @@ class WebApps { * @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. @@ -86021,43 +91453,6 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests @@ -86069,19 +91464,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -86362,8 +91744,6 @@ class WebApps { * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName 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. @@ -86394,9 +91774,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -86440,8 +91817,6 @@ class WebApps { * @param {object} request Backup configuration. You can use the JSON response * from the POST action as input here. * - * @param {string} request.backupRequestName 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. @@ -86472,9 +91847,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -86625,190 +91997,6 @@ class WebApps { } } - /** - * @summary Discovers an existing app backup that can be restored from a blob - * in Azure storage. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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. - */ - discoverRestoreSlotWithHttpOperationResponse(resourceGroupName, name, request, slot, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._discoverRestoreSlot(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. - * - * Discovers an existing app backup that can be restored from a 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 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' - * - * @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. - */ - discoverRestoreSlot(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._discoverRestoreSlot(resourceGroupName, name, request, slot, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._discoverRestoreSlot(resourceGroupName, name, request, slot, options, optionalCallback); - } - } - /** * @summary Gets a backup of an app by its ID. * @@ -87032,93 +92220,6 @@ class WebApps { * * @param {object} request Information on backup request. * - * @param {string} request.backupRequestName 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.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * - * @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.backupRequestName 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. @@ -87149,8 +92250,85 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * @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 {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. * @@ -87247,7 +92425,7 @@ class WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -87268,7 +92446,7 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -87329,7 +92507,7 @@ class WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -87355,7 +92533,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {RestoreResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -87363,8 +92541,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} 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. * @@ -87776,186 +92953,192 @@ class WebApps { * More information on OpenID Connect Discovery: * http://openid.net/specs/openid-connect-discovery-1_0.html * - * @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 + * + * @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 @@ -88195,8 +93378,6 @@ class WebApps { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName 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. @@ -88227,9 +93408,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -88273,8 +93451,6 @@ class WebApps { * * @param {object} request Edited backup configuration. * - * @param {string} request.backupRequestName 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. @@ -88305,9 +93481,6 @@ class WebApps { * * @param {array} [request.databases] Databases included in the backup. * - * @param {string} [request.backupRequestType] Type of the backup. Possible - * values include: 'Default', 'Clone', 'Relocation', 'Snapshot' - * * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not @@ -89574,7 +94747,105 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, options, optionalCallback) { + 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') { @@ -89583,29 +94854,30 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, options, (err, result, request, response) => { + self._listSitePushSettingsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._updateSitePushSettingsSlot(resourceGroupName, name, pushSettings, slot, options, optionalCallback); + return self._listSitePushSettingsSlot(resourceGroupName, name, slot, options, optionalCallback); } } /** - * @summary Gets the Push settings associated with web app. + * @summary Gets a Swift Virtual Network connection. * - * Gets the Push settings associated with web app. + * Gets a Swift Virtual Network connection. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -89614,15 +94886,15 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - listSitePushSettingsSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + getSwiftVirtualNetworkConnectionSlotWithHttpOperationResponse(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) => { + self._getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -89633,17 +94905,18 @@ class WebApps { } /** - * @summary Gets the Push settings associated with web app. + * @summary Gets a Swift Virtual Network connection. * - * Gets the Push settings associated with web app. + * Gets a Swift Virtual Network connection. * * @param {string} resourceGroupName Name of the resource group to which the * resource belongs. * - * @param {string} name Name of web app. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -89657,7 +94930,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {PushSettings} - The deserialized result object. + * @resolve {SwiftVirtualNetwork} - The deserialized result object. * * @reject {Error} - The error object. * @@ -89666,13 +94939,13 @@ class WebApps { * {Error} 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. + * 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. */ - listSitePushSettingsSlot(resourceGroupName, name, slot, options, optionalCallback) { + getSwiftVirtualNetworkConnectionSlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -89681,14 +94954,381 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listSitePushSettingsSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._getSwiftVirtualNetworkConnectionSlot(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); + 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); } } @@ -89821,6 +95461,9 @@ class WebApps { * * @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. * @@ -89998,8 +95641,28 @@ class WebApps { * @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 @@ -90057,6 +95720,9 @@ class WebApps { * * @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. * @@ -90234,8 +95900,28 @@ class WebApps { * @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 @@ -90315,6 +96001,9 @@ class WebApps { * * @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. * @@ -90492,8 +96181,28 @@ class WebApps { * @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 @@ -90551,6 +96260,9 @@ class WebApps { * * @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. * @@ -90728,8 +96440,28 @@ class WebApps { * @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 @@ -91211,11 +96943,11 @@ class WebApps { * * @reject {Error} - The error object. */ - getWebSiteContainerLogsZipSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + getContainerLogsZipSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._getContainerLogsZipSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -91264,7 +96996,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, optionalCallback) { + getContainerLogsZipSlot(resourceGroupName, name, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -91273,14 +97005,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._getContainerLogsZipSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._getWebSiteContainerLogsZipSlot(resourceGroupName, name, slot, options, optionalCallback); + return self._getContainerLogsZipSlot(resourceGroupName, name, slot, options, optionalCallback); } } @@ -91972,7 +97704,366 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - getDeploymentSlot(resourceGroupName, name, id, slot, options, optionalCallback) { + 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') { @@ -91981,183 +98072,73 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._getDeploymentSlot(resourceGroupName, name, id, slot, options, (err, result, request, response) => { + self._listDeploymentLogSlot(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); + return self._listDeploymentLogSlot(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 {string} [deployment.deploymentId] Identifier for deployment. - * - * @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. + * @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. * - * Create a deployment for an app, or a deployment slot. + * 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 {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 {string} [deployment.deploymentId] Identifier for deployment. - * - * @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. + * @param {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. * - * {Promise} A promise is returned + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @resolve {Deployment} - The deserialized result object. + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @reject {Error} - The error object. + * @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. * - * {function} optionalCallback(err, result, request, response) + * @param {string} [request.siteName] Name of an app. * - * {Error} err - The Error object if an error occurred, null otherwise. + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link Deployment} for more information. + * @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. * - * {object} [request] - The HTTP Request object if an error did not occur. + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * {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. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * Delete a deployment by its ID for an app, or a deployment slot. + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. * - * @param {string} name Name of the app. + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). * - * @param {string} id Deployment ID. + * @param {string} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API deletes a deployment for the production slot. + * specified, the API will perform discovery for the production slot. * * @param {object} [options] Optional Parameters. * @@ -92166,15 +98147,15 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - deleteDeploymentSlotWithHttpOperationResponse(resourceGroupName, name, id, slot, options) { + discoverBackupSlotWithHttpOperationResponse(resourceGroupName, name, request, 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) => { + 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); } @@ -92185,128 +98166,61 @@ class WebApps { } /** - * @summary Delete a deployment by its ID for an app, or a deployment slot. + * @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. * - * Delete a deployment by its ID for an app, or a deployment slot. + * 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 {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 {object} request A RestoreRequest object that includes Azure storage + * URL and blog name for discovery of backup. * - * @param {string} name Name of the app. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @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} [request.blobName] Name of a blob which contains the backup. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. + * @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 {object} [options] Optional Parameters. + * @param {string} [request.siteName] Name of an app. * - * @param {object} [options.customHeaders] Headers that will be added to the - * request + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. * - * @returns {Promise} A promise is returned + * @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. * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * @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. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * List deployment log for specific deployment for an app, or a deployment - * slot. + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * - * @param {string} resourceGroupName Name of the resource group to which the - * resource belongs. + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. * - * @param {string} name Name of the app. + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). * - * @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} [request.kind] Kind of resource. * * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API returns deployments for the production slot. + * specified, the API will perform discovery for the production slot. * * @param {object} [options] Optional Parameters. * @@ -92320,7 +98234,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Deployment} - The deserialized result object. + * @resolve {RestoreRequest} - The deserialized result object. * * @reject {Error} - The error object. * @@ -92329,13 +98243,13 @@ class WebApps { * {Error} 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. + * 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. */ - listDeploymentLogSlot(resourceGroupName, name, id, slot, options, optionalCallback) { + discoverBackupSlot(resourceGroupName, name, request, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -92344,14 +98258,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._listDeploymentLogSlot(resourceGroupName, name, id, slot, options, (err, result, request, response) => { + self._discoverBackupSlot(resourceGroupName, name, request, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._listDeploymentLogSlot(resourceGroupName, name, id, slot, options, optionalCallback); + return self._discoverBackupSlot(resourceGroupName, name, request, slot, options, optionalCallback); } } @@ -93575,6 +99489,8 @@ class WebApps { * * @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. @@ -93636,6 +99552,8 @@ class WebApps { * * @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. @@ -98437,12 +104355,6 @@ class WebApps { * * @param {string} [premierAddOn.vendor] Premier add on Vendor. * - * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * * @param {string} [premierAddOn.marketplacePublisher] Premier add on * Marketplace publisher. * @@ -98504,12 +104416,6 @@ class WebApps { * * @param {string} [premierAddOn.vendor] Premier add on Vendor. * - * @param {string} [premierAddOn.premierAddOnName] Premier add on Name. - * - * @param {string} [premierAddOn.premierAddOnLocation] Premier add on Location. - * - * @param {object} [premierAddOn.premierAddOnTags] Premier add on Tags. - * * @param {string} [premierAddOn.marketplacePublisher] Premier add on * Marketplace publisher. * @@ -98673,6 +104579,360 @@ class WebApps { } } + /** + * @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. @@ -100065,49 +106325,271 @@ class WebApps { } /** - * @summary Recovers a web app to a previous snapshot. + * @summary Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * Recovers a web app to a previous snapshot. + * 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 web app. + * @param {string} name Name of the app. * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {string} slot Name of the deployment slot. If a slot is not + * specified, the API resets configuration settings for the production slot. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {object} [options] Optional Parameters. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @param {object} [options.customHeaders] Headers that will be added to the + * request * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @returns {Promise} A promise is returned * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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. + * @resolve {HttpOperationResponse} - The deserialized result object. * - * @param {boolean} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. + * @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. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. + * Resets the configuration settings of the current slot if they were + * previously modified by calling the API with POST. * - * @param {boolean} [recoveryEntity.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} resourceGroupName Name of the resource group to which the + * resource belongs. * - * @param {string} [recoveryEntity.kind] Kind of resource. + * @param {string} name Name of the app. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -100120,11 +106602,11 @@ class WebApps { * * @reject {Error} - The error object. */ - recoverSlotWithHttpOperationResponse(resourceGroupName, name, recoveryEntity, slot, options) { + restoreFromBackupBlobSlotWithHttpOperationResponse(resourceGroupName, name, request, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, (err, result, request, response) => { + 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); } @@ -100135,49 +106617,57 @@ class WebApps { } /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores an app from a backup blob in Azure Storage. * - * Recovers a web app to a previous snapshot. + * 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 web app. + * @param {string} name Name of the app. * - * @param {object} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} request Information on restore request . * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} request.storageAccountUrl SAS URL to the container. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @param {string} [request.blobName] Name of a blob which contains the backup. * - * @param {string} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @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} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target 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 {string} [request.siteName] Name of an app. * - * @param {boolean} recoveryEntity.overwrite If true the recovery - * operation can overwrite source app; otherwise, false. + * @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} [recoveryEntity.recoverConfiguration] If true, site - * configuration, in addition to content, will be reverted. + * @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} [recoveryEntity.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 {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content * - * @param {string} [recoveryEntity.kind] Kind of resource. + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. * - * @param {string} slot Name of web app slot. If not specified then will - * default to production slot. + * @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. * @@ -100205,7 +106695,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, optionalCallback) { + restoreFromBackupBlobSlot(resourceGroupName, name, request, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -100214,31 +106704,44 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, (err, result, request, response) => { + self._restoreFromBackupBlobSlot(resourceGroupName, name, request, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._recoverSlot(resourceGroupName, name, recoveryEntity, slot, options, optionalCallback); + return self._restoreFromBackupBlobSlot(resourceGroupName, name, request, slot, options, optionalCallback); } } /** - * @summary Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * @summary Restores a deleted web app to this web app. * - * Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * 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 the app. + * @param {string} name Name of web 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} 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. * @@ -100251,11 +106754,11 @@ class WebApps { * * @reject {Error} - The error object. */ - resetSlotConfigurationSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + restoreFromDeletedAppSlotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._resetSlotConfigurationSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + 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); } @@ -100266,19 +106769,32 @@ class WebApps { } /** - * @summary Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * @summary Restores a deleted web app to this web app. * - * Resets the configuration settings of the current slot if they were - * previously modified by calling the API with POST. + * 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 the app. + * @param {string} name Name of web 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} 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. * @@ -100306,7 +106822,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - resetSlotConfigurationSlot(resourceGroupName, name, slot, options, optionalCallback) { + restoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -100315,39 +106831,64 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._resetSlotConfigurationSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._restoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._resetSlotConfigurationSlot(resourceGroupName, name, slot, options, optionalCallback); + return self._restoreFromDeletedAppSlot(resourceGroupName, name, restoreRequest, slot, options, optionalCallback); } } /** - * @summary Restarts an app (or deployment slot, if specified). + * @summary Restores a web app from a snapshot. * - * Restarts an app (or deployment slot, if specified). + * 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 the app. + * @param {string} name Name of web app. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will restart the production slot. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {object} [options] Optional Parameters. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @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 {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 {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 {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 @@ -100358,11 +106899,11 @@ class WebApps { * * @reject {Error} - The error object. */ - restartSlotWithHttpOperationResponse(resourceGroupName, name, slot, options) { + restoreSnapshotSlotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._restartSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + 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); } @@ -100373,27 +106914,52 @@ class WebApps { } /** - * @summary Restarts an app (or deployment slot, if specified). + * @summary Restores a web app from a snapshot. * - * Restarts an app (or deployment slot, if specified). + * 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 the app. + * @param {string} name Name of web app. * - * @param {string} slot Name of the deployment slot. If a slot is not - * specified, the API will restart the production slot. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {object} [options] Optional Parameters. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @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 {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 {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 {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 @@ -100419,7 +106985,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - restartSlot(resourceGroupName, name, slot, options, optionalCallback) { + restoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -100428,14 +106994,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._restartSlot(resourceGroupName, name, slot, options, (err, result, request, response) => { + self._restoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._restartSlot(resourceGroupName, name, slot, options, optionalCallback); + return self._restoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, optionalCallback); } } @@ -106893,6 +113459,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -106911,6 +113479,9 @@ class WebApps { * @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. @@ -107109,9 +113680,29 @@ class WebApps { * @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. @@ -107187,51 +113778,17 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests * * @param {object} [siteEnvelope.identity] * - * @param {object} [siteEnvelope.identity.type] Type of managed service - * 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. * @@ -107241,19 +113798,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -107307,6 +113851,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -107325,6 +113871,9 @@ class WebApps { * @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. @@ -107523,9 +114072,29 @@ class WebApps { * @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. @@ -107601,51 +114170,17 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests * * @param {object} [siteEnvelope.identity] * - * @param {object} [siteEnvelope.identity.type] Type of managed service - * 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. * @@ -107655,19 +114190,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -107756,7 +114278,7 @@ class WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -107774,7 +114296,7 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -107835,7 +114357,7 @@ class WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -107858,7 +114380,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {RestoreResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -107866,8 +114388,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} 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. * @@ -108147,6 +114668,8 @@ class WebApps { * * @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. @@ -108205,6 +114728,8 @@ class WebApps { * * @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. @@ -108583,15 +115108,159 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. + * + * @reject {Error} - The error object. + */ + beginMigrateMySqlWithHttpOperationResponse(resourceGroupName, name, migrationRequestEnvelope, options) { + let client = this.client; + let self = this; + return new Promise((resolve, reject) => { + self._beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, (err, result, request, response) => { + let httpOperationResponse = new msRest.HttpOperationResponse(request, response); + httpOperationResponse.body = result; + if (err) { reject(err); } + else { resolve(httpOperationResponse); } + return; + }); + }); + } + + /** + * @summary Migrates a local (in-app) MySql database to a remote MySql + * database. + * + * Migrates a local (in-app) MySql database to a remote MySql database. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of web app. + * + * @param {object} migrationRequestEnvelope MySql migration options. + * + * @param {string} migrationRequestEnvelope.connectionString Connection string + * to the remote MySQL database. + * + * @param {string} migrationRequestEnvelope.migrationType The type of migration + * operation to be done. Possible values include: 'LocalToRemote', + * 'RemoteToLocal' + * + * @param {string} [migrationRequestEnvelope.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @param {function} [optionalCallback] - The optional callback. + * + * @returns {function|Promise} If a callback was passed as the last parameter + * then it returns the callback else returns a Promise. + * + * {Promise} A promise is returned + * + * @resolve {Operation} - The deserialized result object. + * + * @reject {Error} - The error object. + * + * {function} optionalCallback(err, result, request, response) + * + * {Error} err - The Error object if an error occurred, null otherwise. + * + * {object} [result] - The deserialized result object if an error did not occur. + * See {@link Operation} for more information. + * + * {object} [request] - The HTTP Request object if an error did not occur. + * + * {stream} [response] - The HTTP Response stream if an error did not occur. + */ + beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, optionalCallback) { + let client = this.client; + let self = this; + if (!optionalCallback && typeof options === 'function') { + optionalCallback = options; + options = null; + } + if (!optionalCallback) { + return new Promise((resolve, reject) => { + self._beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, (err, result, request, response) => { + if (err) { reject(err); } + else { resolve(result); } + return; + }); + }); + } else { + return self._beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, optionalCallback); + } + } + + /** + * @summary Restores an app from a backup blob in Azure Storage. + * + * Restores an app from a backup blob in Azure Storage. + * + * @param {string} resourceGroupName Name of the resource group to which the + * resource belongs. + * + * @param {string} name Name of the app. + * + * @param {object} request Information on restore request . + * + * @param {string} request.storageAccountUrl SAS URL to the container. + * + * @param {string} [request.blobName] Name of a blob which contains the backup. + * + * @param {boolean} request.overwrite true if the restore + * operation can overwrite target app; otherwise, false. + * true is needed if trying to restore over an existing app. + * + * @param {string} [request.siteName] Name of an app. + * + * @param {array} [request.databases] Collection of databases which should be + * restored. This list has to match the list of databases included in the + * backup. + * + * @param {boolean} [request.ignoreConflictingHostNames] Changes a logic when + * restoring an app with custom domains. true to remove custom + * domains automatically. If false, custom domains are added to + * the app's object when it is being restored, but that might fail due to + * conflicts during the operation. + * + * @param {boolean} [request.ignoreDatabases] Ignore the databases and only + * restore the site content + * + * @param {string} [request.appServicePlan] Specify app service plan that will + * own restored site. + * + * @param {string} [request.operationType] Operation type. Possible values + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' + * + * @param {boolean} [request.adjustConnectionStrings] true if + * SiteConfig.ConnectionStrings should be set in new app; otherwise, + * false. + * + * @param {string} [request.hostingEnvironment] App Service Environment name, + * if needed (only when restoring an app to an App Service Environment). + * + * @param {string} [request.kind] Kind of resource. + * + * @param {object} [options] Optional Parameters. + * + * @param {object} [options.customHeaders] Headers that will be added to the + * request + * + * @returns {Promise} A promise is returned + * + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ - beginMigrateMySqlWithHttpOperationResponse(resourceGroupName, name, migrationRequestEnvelope, options) { + beginRestoreFromBackupBlobWithHttpOperationResponse(resourceGroupName, name, request, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, (err, result, request, response) => { + self._beginRestoreFromBackupBlob(resourceGroupName, name, request, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -108602,26 +115271,175 @@ class WebApps { } /** - * @summary Migrates a local (in-app) MySql database to a remote MySql - * database. + * @summary Restores an app from a backup blob in Azure Storage. * - * Migrates a local (in-app) MySql database to a remote MySql database. + * 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} migrationRequestEnvelope MySql migration options. + * @param {object} restoreRequest Deleted web app restore information. * - * @param {string} migrationRequestEnvelope.connectionString Connection string - * to the remote MySQL database. + * @param {string} [restoreRequest.deletedSiteId] ARM resource ID of the + * deleted app. Example: + * /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} * - * @param {string} migrationRequestEnvelope.migrationType The type of migration - * operation to be done. Possible values include: 'LocalToRemote', - * 'RemoteToLocal' + * @param {boolean} [restoreRequest.recoverConfiguration] If true, deleted site + * configuration, in addition to content, will be restored. * - * @param {string} [migrationRequestEnvelope.kind] Kind of resource. + * @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. * @@ -108635,7 +115453,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {Operation} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -108643,14 +115461,13 @@ class WebApps { * * {Error} 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. + * {null} [result] - The deserialized result object if an error did not occur. * * {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) { + beginRestoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -108659,58 +115476,59 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, (err, result, request, response) => { + self._beginRestoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginMigrateMySql(resourceGroupName, name, migrationRequestEnvelope, options, optionalCallback); + return self._beginRestoreFromDeletedApp(resourceGroupName, name, restoreRequest, options, optionalCallback); } } /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -108723,11 +115541,11 @@ class WebApps { * * @reject {Error} - The error object. */ - beginRecoverWithHttpOperationResponse(resourceGroupName, name, recoveryEntity, options) { + beginRestoreSnapshotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginRecover(resourceGroupName, name, recoveryEntity, options, (err, result, request, response) => { + self._beginRestoreSnapshot(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { let httpOperationResponse = new msRest.HttpOperationResponse(request, response); httpOperationResponse.body = result; if (err) { reject(err); } @@ -108738,46 +115556,47 @@ class WebApps { } /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {object} [options] Optional Parameters. * @@ -108805,7 +115624,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginRecover(resourceGroupName, name, recoveryEntity, options, optionalCallback) { + beginRestoreSnapshot(resourceGroupName, name, restoreRequest, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -108814,14 +115633,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginRecover(resourceGroupName, name, recoveryEntity, options, (err, result, request, response) => { + self._beginRestoreSnapshot(resourceGroupName, name, restoreRequest, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginRecover(resourceGroupName, name, recoveryEntity, options, optionalCallback); + return self._beginRestoreSnapshot(resourceGroupName, name, restoreRequest, options, optionalCallback); } } @@ -108951,6 +115770,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -108969,6 +115790,9 @@ class WebApps { * @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. @@ -109167,9 +115991,29 @@ class WebApps { * @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. @@ -109245,51 +116089,17 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests * * @param {object} [siteEnvelope.identity] * - * @param {object} [siteEnvelope.identity.type] Type of managed service - * 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. * @@ -109302,19 +116112,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -109368,6 +116165,8 @@ class WebApps { * @param {boolean} [siteEnvelope.reserved] true if reserved; * otherwise, false. * + * @param {boolean} [siteEnvelope.isXenon] Hyper-V sandbox. + * * @param {object} [siteEnvelope.siteConfig] Configuration of the app. * * @param {number} [siteEnvelope.siteConfig.numberOfWorkers] Number of workers. @@ -109386,6 +116185,9 @@ class WebApps { * @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. @@ -109584,9 +116386,29 @@ class WebApps { * @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. @@ -109662,51 +116484,17 @@ class WebApps { * Traffic Manager profile to create. This is only needed if Traffic Manager * profile does not already exist. * - * @param {boolean} [siteEnvelope.cloningInfo.ignoreQuotas] true - * if quotas should be ignored; otherwise, false. - * - * @param {object} [siteEnvelope.snapshotInfo] If specified during app - * creation, the app is created from a previous snapshot. - * - * @param {string} [siteEnvelope.snapshotInfo.snapshotTime] Point in time in - * which the app recovery should be attempted, formatted as a DateTime string. - * - * @param {object} [siteEnvelope.snapshotInfo.recoveryTarget] Specifies the web - * app that snapshot contents will be written to. - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.location] - * Geographical location of the target web app, e.g. SouthEastAsia, - * SouthCentralUS - * - * @param {string} [siteEnvelope.snapshotInfo.recoveryTarget.id] ARM resource - * ID of the target 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} siteEnvelope.snapshotInfo.overwrite If true - * the recovery operation can overwrite source app; otherwise, - * false. - * - * @param {boolean} [siteEnvelope.snapshotInfo.recoverConfiguration] If true, - * site configuration, in addition to content, will be reverted. - * - * @param {boolean} [siteEnvelope.snapshotInfo.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} [siteEnvelope.snapshotInfo.kind] Kind of resource. - * * @param {boolean} [siteEnvelope.httpsOnly] HttpsOnly: configures a web site * to accept only https requests. Issues redirect for * http requests * * @param {object} [siteEnvelope.identity] * - * @param {object} [siteEnvelope.identity.type] Type of managed service - * 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. * @@ -109719,19 +116507,6 @@ class WebApps { * * @param {object} [options] Optional Parameters. * - * @param {boolean} [options.skipDnsRegistration] If true web app hostname is - * not registered with DNS on creation. This parameter is - * only used for app creation. - * - * @param {boolean} [options.skipCustomDomainVerification] If true, custom (non - * *.azurewebsites.net) domains associated with web app are not verified. - * - * @param {boolean} [options.forceDnsRegistration] If true, web app hostname is - * force registered with DNS. - * - * @param {string} [options.ttlInSeconds] Time to live in seconds for web app's - * default domain name. - * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -109820,7 +116595,7 @@ class WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -109841,7 +116616,7 @@ class WebApps { * * @returns {Promise} A promise is returned * - * @resolve {HttpOperationResponse} - The deserialized result object. + * @resolve {HttpOperationResponse} - The deserialized result object. * * @reject {Error} - The error object. */ @@ -109902,7 +116677,7 @@ class WebApps { * own restored site. * * @param {string} [request.operationType] Operation type. Possible values - * include: 'Default', 'Clone', 'Relocation', 'Snapshot' + * include: 'Default', 'Clone', 'Relocation', 'Snapshot', 'CloudFS' * * @param {boolean} [request.adjustConnectionStrings] true if * SiteConfig.ConnectionStrings should be set in new app; otherwise, @@ -109928,7 +116703,7 @@ class WebApps { * * {Promise} A promise is returned * - * @resolve {RestoreResponse} - The deserialized result object. + * @resolve {null} - The deserialized result object. * * @reject {Error} - The error object. * @@ -109936,8 +116711,7 @@ class WebApps { * * {Error} err - The Error object if an error occurred, null otherwise. * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link RestoreResponse} 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. * @@ -110234,6 +117008,8 @@ class WebApps { * * @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. @@ -110295,6 +117071,8 @@ class WebApps { * * @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. @@ -110520,46 +117298,351 @@ class WebApps { } /** - * @summary Recovers a web app to a previous snapshot. + * @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. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will * default to production slot. @@ -110575,11 +117658,11 @@ class WebApps { * * @reject {Error} - The error object. */ - beginRecoverSlotWithHttpOperationResponse(resourceGroupName, name, recoveryEntity, slot, options) { + beginRestoreSnapshotSlotWithHttpOperationResponse(resourceGroupName, name, restoreRequest, slot, options) { let client = this.client; let self = this; return new Promise((resolve, reject) => { - self._beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, (err, result, request, response) => { + 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); } @@ -110590,46 +117673,47 @@ class WebApps { } /** - * @summary Recovers a web app to a previous snapshot. + * @summary Restores a web app from a snapshot. * - * Recovers a web app to a previous 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} recoveryEntity Snapshot data used for web app recovery. - * Snapshot information can be obtained by calling GetDeletedSites or - * GetSiteSnapshots API. + * @param {object} restoreRequest Snapshot restore settings. Snapshot + * information can be obtained by calling GetDeletedSites or GetSiteSnapshots + * API. * - * @param {string} [recoveryEntity.snapshotTime] Point in time in which the app - * recovery should be attempted, formatted as a DateTime string. + * @param {string} [restoreRequest.snapshotTime] Point in time in which the app + * restore should be done, formatted as a DateTime string. * - * @param {object} [recoveryEntity.recoveryTarget] Specifies the web app that - * snapshot contents will be written to. + * @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} [recoveryEntity.recoveryTarget.location] Geographical - * location of the target web app, e.g. SouthEastAsia, SouthCentralUS + * @param {string} [restoreRequest.recoverySource.location] Geographical + * location of the source web app, e.g. SouthEastAsia, SouthCentralUS * - * @param {string} [recoveryEntity.recoveryTarget.id] ARM resource ID of the - * target app. + * @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} recoveryEntity.overwrite If true the recovery + * @param {boolean} restoreRequest.overwrite If true the restore * operation can overwrite source app; otherwise, false. * - * @param {boolean} [recoveryEntity.recoverConfiguration] If true, site + * @param {boolean} [restoreRequest.recoverConfiguration] If true, site * configuration, in addition to content, will be reverted. * - * @param {boolean} [recoveryEntity.ignoreConflictingHostNames] If true, custom + * @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} [recoveryEntity.kind] Kind of resource. + * @param {string} [restoreRequest.kind] Kind of resource. * * @param {string} slot Name of web app slot. If not specified then will * default to production slot. @@ -110660,7 +117744,7 @@ class WebApps { * * {stream} [response] - The HTTP Response stream if an error did not occur. */ - beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, optionalCallback) { + beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, optionalCallback) { let client = this.client; let self = this; if (!optionalCallback && typeof options === 'function') { @@ -110669,14 +117753,14 @@ class WebApps { } if (!optionalCallback) { return new Promise((resolve, reject) => { - self._beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, (err, result, request, response) => { + self._beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, (err, result, request, response) => { if (err) { reject(err); } else { resolve(result); } return; }); }); } else { - return self._beginRecoverSlot(resourceGroupName, name, recoveryEntity, slot, options, optionalCallback); + return self._beginRestoreSnapshotSlot(resourceGroupName, name, restoreRequest, slot, options, optionalCallback); } } diff --git a/lib/services/webSiteManagement2/lib/webSiteManagementClient.d.ts b/lib/services/webSiteManagement2/lib/webSiteManagementClient.d.ts index 79d156d867..6227b53ace 100644 --- a/lib/services/webSiteManagement2/lib/webSiteManagementClient.d.ts +++ b/lib/services/webSiteManagement2/lib/webSiteManagementClient.d.ts @@ -13,7 +13,7 @@ import { AzureServiceClient, AzureServiceClientOptions } from 'ms-rest-azure'; import * as models from "./models"; import * as operations from "./operations"; -declare class WebSiteManagementClient extends AzureServiceClient { +export default class WebSiteManagementClient extends AzureServiceClient { /** * Initializes a new instance of the WebSiteManagementClient class. * @constructor @@ -34,11 +34,11 @@ declare class WebSiteManagementClient 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 @@ declare class WebSiteManagementClient extends AzureServiceClient { subscriptionId: string; + apiVersion: string; + acceptLanguage: string; longRunningOperationRetryTimeout: number; @@ -131,8 +133,6 @@ declare class WebSiteManagementClient extends AzureServiceClient { * * @param {object} userDetails Details of publishing user * - * @param {string} [userDetails.userName] Username - * * @param {string} userDetails.publishingUserName Username used for publishing. * * @param {string} [userDetails.publishingPassword] Password used for @@ -144,6 +144,8 @@ declare class WebSiteManagementClient extends AzureServiceClient { * @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. @@ -166,8 +168,6 @@ declare class WebSiteManagementClient extends AzureServiceClient { * * @param {object} userDetails Details of publishing user * - * @param {string} [userDetails.userName] Username - * * @param {string} userDetails.publishingUserName Username used for publishing. * * @param {string} [userDetails.publishingPassword] Password used for @@ -179,6 +179,8 @@ declare class WebSiteManagementClient extends AzureServiceClient { * @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. @@ -337,9 +339,6 @@ declare class WebSiteManagementClient extends AzureServiceClient { * * @param {object} requestMessage Source control token information * - * @param {string} [requestMessage.sourceControlName] Name or source control - * type. - * * @param {string} [requestMessage.token] OAuth access token. * * @param {string} [requestMessage.tokenSecret] OAuth access token secret. @@ -372,9 +371,6 @@ declare class WebSiteManagementClient extends AzureServiceClient { * * @param {object} requestMessage Source control token information * - * @param {string} [requestMessage.sourceControlName] Name or source control - * type. - * * @param {string} [requestMessage.token] OAuth access token. * * @param {string} [requestMessage.tokenSecret] OAuth access token secret. @@ -417,6 +413,72 @@ declare class WebSiteManagementClient extends AzureServiceClient { 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. * @@ -555,11 +617,14 @@ declare class WebSiteManagementClient extends AzureServiceClient { * * @param {string} [options.sku] Name of SKU used to filter the regions. * Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', - * 'PremiumV2', 'Dynamic', 'Isolated' + * 'Dynamic', 'Isolated', 'PremiumV2' * * @param {boolean} [options.linuxWorkersEnabled] Specify true if * you want to filter to only regions that support Linux workers. * + * @param {boolean} [options.xenonWorkersEnabled] Specify true if + * you want to filter to only regions that support Xenon workers. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -569,7 +634,7 @@ declare class WebSiteManagementClient extends AzureServiceClient { * * @reject {Error|ServiceError} - The error object. */ - listGeoRegionsWithHttpOperationResponse(options?: { sku? : string, linuxWorkersEnabled? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; + listGeoRegionsWithHttpOperationResponse(options?: { sku? : string, linuxWorkersEnabled? : boolean, xenonWorkersEnabled? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise>; /** * @summary Get a list of available geographical regions. @@ -580,11 +645,14 @@ declare class WebSiteManagementClient extends AzureServiceClient { * * @param {string} [options.sku] Name of SKU used to filter the regions. * Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', - * 'PremiumV2', 'Dynamic', 'Isolated' + * 'Dynamic', 'Isolated', 'PremiumV2' * * @param {boolean} [options.linuxWorkersEnabled] Specify true if * you want to filter to only regions that support Linux workers. * + * @param {boolean} [options.xenonWorkersEnabled] Specify true if + * you want to filter to only regions that support Xenon workers. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -610,9 +678,9 @@ declare class WebSiteManagementClient extends AzureServiceClient { * * {http.IncomingMessage} [response] - The HTTP Response stream if an error did not occur. */ - listGeoRegions(options?: { sku? : string, linuxWorkersEnabled? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; + listGeoRegions(options?: { sku? : string, linuxWorkersEnabled? : boolean, xenonWorkersEnabled? : boolean, customHeaders? : { [headerName: string]: string; } }): Promise; listGeoRegions(callback: ServiceCallback): void; - listGeoRegions(options: { sku? : string, linuxWorkersEnabled? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; + listGeoRegions(options: { sku? : string, linuxWorkersEnabled? : boolean, xenonWorkersEnabled? : boolean, customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; /** @@ -976,6 +1044,9 @@ declare class WebSiteManagementClient extends AzureServiceClient { * @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 @@ -1024,6 +1095,9 @@ declare class WebSiteManagementClient extends AzureServiceClient { * @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 @@ -1192,6 +1266,68 @@ declare class WebSiteManagementClient extends AzureServiceClient { 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. * @@ -1376,4 +1512,4 @@ declare class WebSiteManagementClient extends AzureServiceClient { listPremierAddOnOffersNext(nextPageLink: string, options: { customHeaders? : { [headerName: string]: string; } }, callback: ServiceCallback): void; } -export = WebSiteManagementClient; +export { WebSiteManagementClient, models as WebSiteManagementModels }; diff --git a/lib/services/webSiteManagement2/lib/webSiteManagementClient.js b/lib/services/webSiteManagement2/lib/webSiteManagementClient.js index 0bfe01a5a7..b02aa8611e 100644 --- a/lib/services/webSiteManagement2/lib/webSiteManagementClient.js +++ b/lib/services/webSiteManagement2/lib/webSiteManagementClient.js @@ -56,9 +56,11 @@ function _getPublishingUser(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // 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.'); } @@ -70,7 +72,7 @@ function _getPublishingUser(options, callback) { let baseUrl = this.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/publishingUsers/web'; let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -112,12 +114,13 @@ function _getPublishingUser(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -159,8 +162,6 @@ function _getPublishingUser(options, callback) { * * @param {object} userDetails Details of publishing user * - * @param {string} [userDetails.userName] Username - * * @param {string} userDetails.publishingUserName Username used for publishing. * * @param {string} [userDetails.publishingPassword] Password used for @@ -172,6 +173,8 @@ function _getPublishingUser(options, callback) { * @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. @@ -202,12 +205,14 @@ function _updatePublishingUser(userDetails, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // 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.'); } @@ -219,7 +224,7 @@ function _updatePublishingUser(userDetails, options, callback) { let baseUrl = this.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/publishingUsers/web'; let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -275,12 +280,13 @@ function _updatePublishingUser(userDetails, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -349,9 +355,11 @@ function _listSourceControls(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // 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.'); } @@ -363,7 +371,7 @@ function _listSourceControls(options, callback) { let baseUrl = this.baseUri; let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/sourcecontrols'; let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -405,12 +413,13 @@ function _listSourceControls(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -480,12 +489,14 @@ function _getSourceControl(sourceControlType, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // 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.'); } @@ -498,7 +509,7 @@ function _getSourceControl(sourceControlType, options, callback) { let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/sourcecontrols/{sourceControlType}'; requestUrl = requestUrl.replace('{sourceControlType}', encodeURIComponent(sourceControlType)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -540,12 +551,13 @@ function _getSourceControl(sourceControlType, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -589,9 +601,6 @@ function _getSourceControl(sourceControlType, options, callback) { * * @param {object} requestMessage Source control token information * - * @param {string} [requestMessage.sourceControlName] Name or source control - * type. - * * @param {string} [requestMessage.token] OAuth access token. * * @param {string} [requestMessage.tokenSecret] OAuth access token secret. @@ -630,7 +639,6 @@ function _updateSourceControl(sourceControlType, requestMessage, options, callba if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (sourceControlType === null || sourceControlType === undefined || typeof sourceControlType.valueOf() !== 'string') { @@ -639,6 +647,9 @@ function _updateSourceControl(sourceControlType, requestMessage, options, callba 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.'); } @@ -651,7 +662,7 @@ function _updateSourceControl(sourceControlType, requestMessage, options, callba let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'providers/Microsoft.Web/sourcecontrols/{sourceControlType}'; requestUrl = requestUrl.replace('{sourceControlType}', encodeURIComponent(sourceControlType)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -707,12 +718,13 @@ function _updateSourceControl(sourceControlType, requestMessage, options, callba try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -747,6 +759,162 @@ function _updateSourceControl(sourceControlType, requestMessage, options, callba }); } +/** + * @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. * @@ -791,12 +959,14 @@ function _checkNameAvailability(name, type, options, callback) { throw new Error('callback cannot be null.'); } let isFqdn = (options && options.isFqdn !== undefined) ? options.isFqdn : undefined; - let apiVersion = '2016-03-01'; // 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.'); } @@ -825,7 +995,7 @@ function _checkNameAvailability(name, type, options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -881,12 +1051,13 @@ function _checkNameAvailability(name, type, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -954,12 +1125,14 @@ function _getSubscriptionDeploymentLocations(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // 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.'); } @@ -972,7 +1145,7 @@ function _getSubscriptionDeploymentLocations(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1014,12 +1187,13 @@ function _getSubscriptionDeploymentLocations(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1063,11 +1237,14 @@ function _getSubscriptionDeploymentLocations(options, callback) { * * @param {string} [options.sku] Name of SKU used to filter the regions. * Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', - * 'PremiumV2', 'Dynamic', 'Isolated' + * 'Dynamic', 'Isolated', 'PremiumV2' * * @param {boolean} [options.linuxWorkersEnabled] Specify true if * you want to filter to only regions that support Linux workers. * + * @param {boolean} [options.xenonWorkersEnabled] Specify true if + * you want to filter to only regions that support Xenon workers. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -1096,7 +1273,7 @@ function _listGeoRegions(options, callback) { } let sku = (options && options.sku !== undefined) ? options.sku : undefined; let linuxWorkersEnabled = (options && options.linuxWorkersEnabled !== undefined) ? options.linuxWorkersEnabled : undefined; - let apiVersion = '2016-03-01'; + let xenonWorkersEnabled = (options && options.xenonWorkersEnabled !== undefined) ? options.xenonWorkersEnabled : undefined; // Validate try { if (sku !== null && sku !== undefined && typeof sku.valueOf() !== 'string') { @@ -1105,9 +1282,15 @@ function _listGeoRegions(options, callback) { if (linuxWorkersEnabled !== null && linuxWorkersEnabled !== undefined && typeof linuxWorkersEnabled !== 'boolean') { throw new Error('linuxWorkersEnabled must be of type boolean.'); } + if (xenonWorkersEnabled !== null && xenonWorkersEnabled !== undefined && typeof xenonWorkersEnabled !== 'boolean') { + throw new Error('xenonWorkersEnabled must be of type boolean.'); + } if (this.subscriptionId === null || this.subscriptionId === undefined || typeof this.subscriptionId.valueOf() !== 'string') { throw new Error('this.subscriptionId cannot be null or undefined and it must be of type string.'); } + if (this.apiVersion === null || this.apiVersion === undefined || typeof this.apiVersion.valueOf() !== 'string') { + throw new Error('this.apiVersion cannot be null or undefined and it must be of type string.'); + } if (this.acceptLanguage !== null && this.acceptLanguage !== undefined && typeof this.acceptLanguage.valueOf() !== 'string') { throw new Error('this.acceptLanguage must be of type string.'); } @@ -1126,7 +1309,10 @@ function _listGeoRegions(options, callback) { if (linuxWorkersEnabled !== null && linuxWorkersEnabled !== undefined) { queryParameters.push('linuxWorkersEnabled=' + encodeURIComponent(linuxWorkersEnabled.toString())); } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + if (xenonWorkersEnabled !== null && xenonWorkersEnabled !== undefined) { + queryParameters.push('xenonWorkersEnabled=' + encodeURIComponent(xenonWorkersEnabled.toString())); + } + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1168,12 +1354,13 @@ function _listGeoRegions(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1244,12 +1431,14 @@ function _listSiteIdentifiersAssignedToHostName(options, callback) { throw new Error('callback cannot be null.'); } let name = (options && options.name !== undefined) ? options.name : undefined; - let apiVersion = '2016-03-01'; // 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.'); } @@ -1270,7 +1459,7 @@ function _listSiteIdentifiersAssignedToHostName(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1326,12 +1515,13 @@ function _listSiteIdentifiersAssignedToHostName(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1400,12 +1590,14 @@ function _listPremierAddOnOffers(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // 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.'); } @@ -1418,7 +1610,7 @@ function _listPremierAddOnOffers(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1460,12 +1652,13 @@ function _listPremierAddOnOffers(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1533,12 +1726,14 @@ function _listSkus(options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // 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.'); } @@ -1551,7 +1746,7 @@ function _listSkus(options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1593,12 +1788,13 @@ function _listSkus(options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1680,7 +1876,6 @@ function _verifyHostingEnvironmentVnet(parameters, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (parameters === null || parameters === undefined) { @@ -1689,6 +1884,9 @@ function _verifyHostingEnvironmentVnet(parameters, options, callback) { 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.'); } @@ -1701,7 +1899,7 @@ function _verifyHostingEnvironmentVnet(parameters, options, callback) { 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(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1757,12 +1955,13 @@ function _verifyHostingEnvironmentVnet(parameters, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -1839,7 +2038,6 @@ function _move(resourceGroupName, moveResourceEnvelope, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -1865,6 +2063,9 @@ function _move(resourceGroupName, moveResourceEnvelope, options, callback) { 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.'); } @@ -1878,7 +2079,7 @@ function _move(resourceGroupName, moveResourceEnvelope, options, callback) { requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -1992,6 +2193,9 @@ function _move(resourceGroupName, moveResourceEnvelope, options, callback) { * @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 @@ -2020,7 +2224,6 @@ function _validate(resourceGroupName, validateRequest, options, callback) { if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2046,6 +2249,9 @@ function _validate(resourceGroupName, validateRequest, options, callback) { 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.'); } @@ -2059,7 +2265,7 @@ function _validate(resourceGroupName, validateRequest, options, callback) { requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2115,12 +2321,13 @@ function _validate(resourceGroupName, validateRequest, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2197,7 +2404,6 @@ function _validateMove(resourceGroupName, moveResourceEnvelope, options, callbac if (!callback) { throw new Error('callback cannot be null.'); } - let apiVersion = '2016-03-01'; // Validate try { if (resourceGroupName === null || resourceGroupName === undefined || typeof resourceGroupName.valueOf() !== 'string') { @@ -2223,6 +2429,9 @@ function _validateMove(resourceGroupName, moveResourceEnvelope, options, callbac 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.'); } @@ -2236,7 +2445,7 @@ function _validateMove(resourceGroupName, moveResourceEnvelope, options, callbac requestUrl = requestUrl.replace('{resourceGroupName}', encodeURIComponent(resourceGroupName)); requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.subscriptionId)); let queryParameters = []; - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); + queryParameters.push('api-version=' + encodeURIComponent(this.apiVersion)); if (queryParameters.length > 0) { requestUrl += '?' + queryParameters.join('&'); } @@ -2405,12 +2614,13 @@ function _listSourceControlsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2445,6 +2655,137 @@ function _listSourceControlsNext(nextPageLink, options, callback) { }); } +/** + * @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. * @@ -2534,12 +2875,13 @@ function _listGeoRegionsNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2663,12 +3005,13 @@ function _listSiteIdentifiersAssignedToHostNameNext(nextPageLink, options, callb try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2793,12 +3136,13 @@ function _listPremierAddOnOffersNext(nextPageLink, options, callback) { try { parsedErrorResponse = JSON.parse(responseBody); if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; + let internalError = null; + if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; + error.code = internalError ? internalError.code : parsedErrorResponse.code; + error.message = internalError ? internalError.message : parsedErrorResponse.message; } if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); + let resultMapper = new client.models['DefaultErrorResponse']().mapper(); error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); } } catch (defaultError) { @@ -2845,9 +3189,9 @@ class WebSiteManagementClient 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) { @@ -2861,6 +3205,7 @@ class WebSiteManagementClient extends ServiceClient { super(credentials, options); + this.apiVersion = '2018-02-01'; this.acceptLanguage = 'en-US'; this.longRunningOperationRetryTimeout = 30; this.generateClientRequestId = true; @@ -2901,6 +3246,7 @@ class WebSiteManagementClient extends ServiceClient { this._listSourceControls = _listSourceControls; this._getSourceControl = _getSourceControl; this._updateSourceControl = _updateSourceControl; + this._listBillingMeters = _listBillingMeters; this._checkNameAvailability = _checkNameAvailability; this._getSubscriptionDeploymentLocations = _getSubscriptionDeploymentLocations; this._listGeoRegions = _listGeoRegions; @@ -2912,6 +3258,7 @@ class WebSiteManagementClient extends ServiceClient { this._validate = _validate; this._validateMove = _validateMove; this._listSourceControlsNext = _listSourceControlsNext; + this._listBillingMetersNext = _listBillingMetersNext; this._listGeoRegionsNext = _listGeoRegionsNext; this._listSiteIdentifiersAssignedToHostNameNext = _listSiteIdentifiersAssignedToHostNameNext; this._listPremierAddOnOffersNext = _listPremierAddOnOffersNext; @@ -3007,8 +3354,6 @@ class WebSiteManagementClient extends ServiceClient { * * @param {object} userDetails Details of publishing user * - * @param {string} [userDetails.userName] Username - * * @param {string} userDetails.publishingUserName Username used for publishing. * * @param {string} [userDetails.publishingPassword] Password used for @@ -3020,6 +3365,8 @@ class WebSiteManagementClient extends ServiceClient { * @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. @@ -3054,8 +3401,6 @@ class WebSiteManagementClient extends ServiceClient { * * @param {object} userDetails Details of publishing user * - * @param {string} [userDetails.userName] Username - * * @param {string} userDetails.publishingUserName Username used for publishing. * * @param {string} [userDetails.publishingPassword] Password used for @@ -3067,6 +3412,8 @@ class WebSiteManagementClient extends ServiceClient { * @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. @@ -3294,9 +3641,6 @@ class WebSiteManagementClient extends ServiceClient { * * @param {object} requestMessage Source control token information * - * @param {string} [requestMessage.sourceControlName] Name or source control - * type. - * * @param {string} [requestMessage.token] OAuth access token. * * @param {string} [requestMessage.tokenSecret] OAuth access token secret. @@ -3341,9 +3685,6 @@ class WebSiteManagementClient extends ServiceClient { * * @param {object} requestMessage Source control token information * - * @param {string} [requestMessage.sourceControlName] Name or source control - * type. - * * @param {string} [requestMessage.token] OAuth access token. * * @param {string} [requestMessage.tokenSecret] OAuth access token secret. @@ -3401,6 +3742,99 @@ class WebSiteManagementClient extends ServiceClient { } } + /** + * @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. * @@ -3593,11 +4027,14 @@ class WebSiteManagementClient extends ServiceClient { * * @param {string} [options.sku] Name of SKU used to filter the regions. * Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', - * 'PremiumV2', 'Dynamic', 'Isolated' + * 'Dynamic', 'Isolated', 'PremiumV2' * * @param {boolean} [options.linuxWorkersEnabled] Specify true if * you want to filter to only regions that support Linux workers. * + * @param {boolean} [options.xenonWorkersEnabled] Specify true if + * you want to filter to only regions that support Xenon workers. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -3630,11 +4067,14 @@ class WebSiteManagementClient extends ServiceClient { * * @param {string} [options.sku] Name of SKU used to filter the regions. * Possible values include: 'Free', 'Shared', 'Basic', 'Standard', 'Premium', - * 'PremiumV2', 'Dynamic', 'Isolated' + * 'Dynamic', 'Isolated', 'PremiumV2' * * @param {boolean} [options.linuxWorkersEnabled] Specify true if * you want to filter to only regions that support Linux workers. * + * @param {boolean} [options.xenonWorkersEnabled] Specify true if + * you want to filter to only regions that support Xenon workers. + * * @param {object} [options.customHeaders] Headers that will be added to the * request * @@ -4176,6 +4616,9 @@ class WebSiteManagementClient extends ServiceClient { * @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 @@ -4236,6 +4679,9 @@ class WebSiteManagementClient extends ServiceClient { * @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 @@ -4473,6 +4919,95 @@ class WebSiteManagementClient extends ServiceClient { } } + /** + * @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. * @@ -4741,3 +5276,6 @@ class WebSiteManagementClient extends ServiceClient { } module.exports = WebSiteManagementClient; +module.exports['default'] = WebSiteManagementClient; +module.exports.WebSiteManagementClient = WebSiteManagementClient; +module.exports.WebSiteManagementModels = models; diff --git a/lib/services/webSiteManagement2/package-lock.json b/lib/services/webSiteManagement2/package-lock.json index cc9efc54b8..d3c1ebf2ef 100644 --- a/lib/services/webSiteManagement2/package-lock.json +++ b/lib/services/webSiteManagement2/package-lock.json @@ -5,17 +5,9 @@ "requires": true, "dependencies": { "@types/node": { - "version": "8.10.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.2.tgz", - "integrity": "sha512-A6Uv1anbsCvrRDtaUXS2xZ5tlzD+Kg7yMRlSLFDy3z0r7KlGXDzL14vELXIAgpk2aJbU3XeZZQRcEkLkowT92g==" - }, - "@types/uuid": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-3.4.3.tgz", - "integrity": "sha512-5fRLCYhLtDb3hMWqQyH10qtF+Ud2JnNCXTCZ+9ktNdCcgslcuXkDTkFcJNk++MT29yDntDnlF1+jD+uVGumsbw==", - "requires": { - "@types/node": "*" - } + "version": "8.10.21", + "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.21.tgz", + "integrity": "sha512-87XkD9qDXm8fIax+5y7drx84cXsu34ZZqfB7Cial3Q/2lxSoJ/+DRaWckkCbxP41wFSIrrb939VhzaNxj4eY1w==" }, "adal-node": { "version": "0.1.28", @@ -73,32 +65,19 @@ "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=" }, "aws4": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.6.0.tgz", - "integrity": "sha1-g+9cqGCysy5KDe7e6MdxudtXRx4=" - }, - "base64url": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/base64url/-/base64url-2.0.0.tgz", - "integrity": "sha1-6sFuA+oUOO/5Qj1puqNiYu0fcLs=" + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.7.0.tgz", + "integrity": "sha512-32NDda82rhwD9/JBCCkB+MRYDp0oSvlo2IL6rQWA10PQi7tDUM3eqMSltXmY+Oyl/7N3P3qNtAlv7X0d9bI28w==" }, "bcrypt-pbkdf": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.1.tgz", - "integrity": "sha1-Y7xdy2EzG5K8Bf1SiVPDNGKgb40=", + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", "optional": true, "requires": { "tweetnacl": "^0.14.3" } }, - "boom": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/boom/-/boom-4.3.1.tgz", - "integrity": "sha1-T4owBctKfjiJ90kDD9JbluAdLjE=", - "requires": { - "hoek": "4.x.x" - } - }, "buffer-equal-constant-time": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", @@ -127,24 +106,6 @@ "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=" }, - "cryptiles": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-3.1.2.tgz", - "integrity": "sha1-qJ+7Ig9c4l7FboxKqKT9e1sNKf4=", - "requires": { - "boom": "5.x.x" - }, - "dependencies": { - "boom": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/boom/-/boom-5.2.0.tgz", - "integrity": "sha512-Z5BTk6ZRe4tXXQlkqftmsAUANpXmuwlsF5Oov8ThoMbQRzdGTA1ngYRW160GexgOgjsFOKJz0LYhoNi+2AMBUw==", - "requires": { - "hoek": "4.x.x" - } - } - } - }, "dashdash": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", @@ -178,18 +139,17 @@ } }, "ecdsa-sig-formatter": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.9.tgz", - "integrity": "sha1-S8kmJ07Dtau1AW5+HWCSGsJisqE=", + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.10.tgz", + "integrity": "sha1-HFlQAPBKiJffuFAAiSoPTDOvhsM=", "requires": { - "base64url": "^2.0.0", "safe-buffer": "^5.0.1" } }, "extend": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.1.tgz", - "integrity": "sha1-p1Xqe8Gt/MWjHOfnYtuq3F5jZEQ=" + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" }, "extsprintf": { "version": "1.3.0", @@ -243,22 +203,6 @@ "har-schema": "^2.0.0" } }, - "hawk": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/hawk/-/hawk-6.0.2.tgz", - "integrity": "sha512-miowhl2+U7Qle4vdLqDdPt9m09K6yZhkLDTWGoUiUzrQCn+mHHSmfJgAyGaLRZbPmTqfFFjRV1QWCW0VWUJBbQ==", - "requires": { - "boom": "4.x.x", - "cryptiles": "3.x.x", - "hoek": "4.x.x", - "sntp": "2.x.x" - } - }, - "hoek": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/hoek/-/hoek-4.2.1.tgz", - "integrity": "sha512-QLg82fGkfnJ/4iy1xZ81/9SIJiq1NGFUMGs6ParyjBZr6jW2Ufj/snDqTHixNlHdPNwN2RLVD0Pi3igeK9+JfA==" - }, "http-signature": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", @@ -322,48 +266,46 @@ } }, "jwa": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.5.tgz", - "integrity": "sha1-oFUs4CIHQs1S4VN3SjKQXDDnVuU=", + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-1.1.6.tgz", + "integrity": "sha512-tBO/cf++BUsJkYql/kBbJroKOgHWEigTKBAjjBEmrMGYd1QMBC74Hr4Wo2zCZw6ZrVhlJPvoMrkcOnlWR/DJfw==", "requires": { - "base64url": "2.0.0", "buffer-equal-constant-time": "1.0.1", - "ecdsa-sig-formatter": "1.0.9", + "ecdsa-sig-formatter": "1.0.10", "safe-buffer": "^5.0.1" } }, "jws": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/jws/-/jws-3.1.4.tgz", - "integrity": "sha1-+ei5M46KhHJ31kRLFGT2GIDgUKI=", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/jws/-/jws-3.1.5.tgz", + "integrity": "sha512-GsCSexFADNQUr8T5HPJvayTjvPIfoyJPtLQBwn5a4WZQchcrPMPMAWcC1AzJVRDKyD6ZPROPAxgv6rfHViO4uQ==", "requires": { - "base64url": "^2.0.0", - "jwa": "^1.1.4", + "jwa": "^1.1.5", "safe-buffer": "^5.0.1" } }, "lodash": { - "version": "4.17.5", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.5.tgz", - "integrity": "sha512-svL3uiZf1RwhH+cWrfZn3A4+U58wbP0tGVTLQPbjplZxZ8ROD9VLuNgsRniTlLe7OlSqR79RUehXgpBW/s0IQw==" + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" }, "mime-db": { - "version": "1.33.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.33.0.tgz", - "integrity": "sha512-BHJ/EKruNIqJf/QahvxwQZXKygOQ256myeN/Ew+THcAa5q+PjyTTMMeNQC4DZw5AwfvelsUrA6B67NKMqXDbzQ==" + "version": "1.35.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.35.0.tgz", + "integrity": "sha512-JWT/IcCTsB0Io3AhWUMjRqucrHSPsSf2xKLaRldJVULioggvkJvggZ3VXNNSRkCddE6D+BUI4HEIZIA2OjwIvg==" }, "mime-types": { - "version": "2.1.18", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.18.tgz", - "integrity": "sha512-lc/aahn+t4/SWV/qcmumYjymLsWfN3ELhpmVuUFjgsORruuZPVSwAQryq+HHGvO/SI2KVX26bx+En+zhM8g8hQ==", + "version": "2.1.19", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.19.tgz", + "integrity": "sha512-P1tKYHVSZ6uFo26mtnve4HQFE3koh1UWVkp8YUC+ESBHe945xWSoXuHHiGarDqcEZ+whpCDnlNw5LON0kLo+sw==", "requires": { - "mime-db": "~1.33.0" + "mime-db": "~1.35.0" } }, "moment": { - "version": "2.22.0", - "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.0.tgz", - "integrity": "sha512-1muXCh8jb1N/gHRbn9VDUBr0GYb8A/aVcHlII9QSB68a50spqEVLIGN6KVmCOnSvJrUhC0edGgKU5ofnGXdYdg==" + "version": "2.22.2", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.2.tgz", + "integrity": "sha1-PCV/mDn8DpP/UxSWMiOeuQeD/2Y=" }, "ms-rest": { "version": "2.3.6", @@ -378,56 +320,18 @@ "through": "^2.3.8", "tunnel": "0.0.5", "uuid": "^3.2.1" - }, - "dependencies": { - "request": { - "version": "2.87.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz", - "integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==", - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.6.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.5", - "extend": "~3.0.1", - "forever-agent": "~0.6.1", - "form-data": "~2.3.1", - "har-validator": "~5.0.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.17", - "oauth-sign": "~0.8.2", - "performance-now": "^2.1.0", - "qs": "~6.5.1", - "safe-buffer": "^5.1.1", - "tough-cookie": "~2.3.3", - "tunnel-agent": "^0.6.0", - "uuid": "^3.1.0" - } - } } }, "ms-rest-azure": { - "version": "2.5.5", - "resolved": "https://registry.npmjs.org/ms-rest-azure/-/ms-rest-azure-2.5.5.tgz", - "integrity": "sha512-LnP5YlgqvNAOi1x2b4Ru+1ubz/PtYQgNeH74aiolP+Sb5lpOw5ewzbncXae1pR5OWu9NGwxjX59adzSWosqnzw==", + "version": "2.5.7", + "resolved": "https://registry.npmjs.org/ms-rest-azure/-/ms-rest-azure-2.5.7.tgz", + "integrity": "sha512-e4lgB0z29Dx4ufu/c+PmEAYY1WXq98GYUBkE+iRx7WsxsN04lrM3B1vj8y+B8rKt7clPUE0niqB9VovVL8zvag==", "requires": { - "@types/node": "^9.4.6", - "@types/uuid": "^3.4.3", - "adal-node": "^0.1.27", + "adal-node": "^0.1.28", "async": "2.6.0", - "moment": "^2.20.1", + "moment": "^2.22.2", "ms-rest": "^2.3.2", "uuid": "^3.2.1" - }, - "dependencies": { - "@types/node": { - "version": "9.6.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-9.6.2.tgz", - "integrity": "sha512-UWkRY9X7RQHp5OhhRIIka58/gVVycL1zHZu0OTsT5LI86ABaMOSbUjAl+b0FeDhQcxclrkyft3kW5QWdMRs8wQ==" - } } }, "oauth-sign": { @@ -446,14 +350,14 @@ "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=" }, "qs": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.1.tgz", - "integrity": "sha512-eRzhrN1WSINYCDCbrz796z37LOe3m5tmW7RQf6oBntukAG1nmovJvhnwHHRMAfeoItc1m2Hk02WER2aQ/iqs+A==" + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==" }, "request": { - "version": "2.85.0", - "resolved": "https://registry.npmjs.org/request/-/request-2.85.0.tgz", - "integrity": "sha512-8H7Ehijd4js+s6wuVPLjwORxD4zeuyjYugprdOXlPSqaApmL/QOy+EB/beICHVCHkGMKNh5rvihb5ov+IDw4mg==", + "version": "2.87.0", + "resolved": "https://registry.npmjs.org/request/-/request-2.87.0.tgz", + "integrity": "sha512-fcogkm7Az5bsS6Sl0sibkbhcKsnyon/jV1kF3ajGmF0c8HrttdKTPRT9hieOaQHA5HEq6r8OyWOo/o781C1tNw==", "requires": { "aws-sign2": "~0.7.0", "aws4": "^1.6.0", @@ -463,7 +367,6 @@ "forever-agent": "~0.6.1", "form-data": "~2.3.1", "har-validator": "~5.0.3", - "hawk": "~6.0.2", "http-signature": "~1.2.0", "is-typedarray": "~1.0.0", "isstream": "~0.1.2", @@ -473,29 +376,25 @@ "performance-now": "^2.1.0", "qs": "~6.5.1", "safe-buffer": "^5.1.1", - "stringstream": "~0.0.5", "tough-cookie": "~2.3.3", "tunnel-agent": "^0.6.0", "uuid": "^3.1.0" } }, "safe-buffer": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", - "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" }, - "sntp": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/sntp/-/sntp-2.1.0.tgz", - "integrity": "sha512-FL1b58BDrqS3A11lJ0zEdnJ3UOKqVxawAkF3k7F0CVN7VQ34aZrV+G8BZ1WC9ZL7NyrwsW0oviwsWDgRuVYtJg==", - "requires": { - "hoek": "4.x.x" - } + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" }, "sshpk": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.1.tgz", - "integrity": "sha1-Ew9Zde3a2WPx1W+SuaxsUfqfg+s=", + "version": "1.14.2", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", + "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", "requires": { "asn1": "~0.2.3", "assert-plus": "^1.0.0", @@ -504,14 +403,10 @@ "ecc-jsbn": "~0.1.1", "getpass": "^0.1.1", "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", "tweetnacl": "~0.14.0" } }, - "stringstream": { - "version": "0.0.5", - "resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz", - "integrity": "sha1-TkhM1N5aC7vuGORjB3EKioFiGHg=" - }, "through": { "version": "2.3.8", "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", @@ -545,14 +440,14 @@ "optional": true }, "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=" + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", + "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==" }, "uuid": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.2.1.tgz", - "integrity": "sha512-jZnMwlb9Iku/O3smGWvZhauCf6cvvpKi4BKRiliS3cxnI+Gz9j5MEpTz2UFuXiKPJocb7gnsLHwiS05ige5BEA==" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" }, "verror": { "version": "1.10.0", diff --git a/lib/services/webSiteManagement2/package.json b/lib/services/webSiteManagement2/package.json index cb5857a305..bbf762e2d5 100644 --- a/lib/services/webSiteManagement2/package.json +++ b/lib/services/webSiteManagement2/package.json @@ -1,37 +1,25 @@ { "name": "azure-arm-website", "author": "Microsoft Corporation", - "contributors": [ - "Wang, Yugang ", - "Zavery, Amar ", - "Stempniewicz, Lukasz " - ], - "version": "3.0.0-preview", - "description": "Microsoft Azure WebSite Management Client Library for node", - "tags": [ - "azure", - "sdk" - ], + "description": "WebSiteManagementClient Library with typescript type definitions for node", + "version": "4.0.0", + "dependencies": { + "ms-rest": "^2.3.3", + "ms-rest-azure": "^2.5.5" + }, "keywords": [ "node", "azure" ], + "license": "MIT", "main": "./lib/webSiteManagementClient.js", "types": "./lib/webSiteManagementClient.d.ts", - "license": "MIT", - "dependencies": { - "ms-rest": "^2.3.0", - "ms-rest-azure": "^2.5.0" - }, - "homepage": "http://github.com/Azure/azure-sdk-for-node", + "homepage": "https://github.com/azure/azure-sdk-for-node/lib/services/webSiteManagement2", "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" } } diff --git a/lib/services/websiteManagement2/lib/operations/billingMeters.js b/lib/services/websiteManagement2/lib/operations/billingMeters.js deleted file mode 100644 index 19ed4bd40c..0000000000 --- a/lib/services/websiteManagement2/lib/operations/billingMeters.js +++ /dev/null @@ -1,483 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.billingLocation] Azure Location of billable - * resource - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link BillingMeterCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _list(options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - let billingLocation = (options && options.billingLocation !== undefined) ? options.billingLocation : undefined; - let apiVersion = '2016-03-01'; - // Validate - try { - if (billingLocation !== null && billingLocation !== undefined && typeof billingLocation.valueOf() !== 'string') { - throw new Error('billingLocation must be of type string.'); - } - if (this.client.subscriptionId === null || this.client.subscriptionId === undefined || typeof this.client.subscriptionId.valueOf() !== 'string') { - throw new Error('this.client.subscriptionId cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let baseUrl = this.client.baseUri; - let requestUrl = baseUrl + (baseUrl.endsWith('/') ? '' : '/') + 'subscriptions/{subscriptionId}/providers/Microsoft.Web/billingMeters'; - requestUrl = requestUrl.replace('{subscriptionId}', encodeURIComponent(this.client.subscriptionId)); - let queryParameters = []; - if (billingLocation !== null && billingLocation !== undefined) { - queryParameters.push('billingLocation=' + encodeURIComponent(billingLocation)); - } - queryParameters.push('api-version=' + encodeURIComponent(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BillingMeterCollection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} callback - The callback. - * - * @returns {function} callback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link BillingMeterCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ -function _listNext(nextPageLink, options, callback) { - /* jshint validthis: true */ - let client = this.client; - if(!callback && typeof options === 'function') { - callback = options; - options = null; - } - if (!callback) { - throw new Error('callback cannot be null.'); - } - // Validate - try { - if (nextPageLink === null || nextPageLink === undefined || typeof nextPageLink.valueOf() !== 'string') { - throw new Error('nextPageLink cannot be null or undefined and it must be of type string.'); - } - if (this.client.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(error); - } - - // Construct URL - let requestUrl = '{nextLink}'; - requestUrl = requestUrl.replace('{nextLink}', nextPageLink); - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - if (parsedErrorResponse.error) parsedErrorResponse = parsedErrorResponse.error; - if (parsedErrorResponse.code) error.code = parsedErrorResponse.code; - if (parsedErrorResponse.message) error.message = parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['CloudError']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (statusCode === 200) { - let parsedResponse = null; - try { - parsedResponse = JSON.parse(responseBody); - result = JSON.parse(responseBody); - if (parsedResponse !== null && parsedResponse !== undefined) { - let resultMapper = new client.models['BillingMeterCollection']().mapper(); - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred in deserializing the responseBody - ${responseBody}`); - deserializationError.request = msRest.stripRequest(httpRequest); - deserializationError.response = msRest.stripResponse(response); - return callback(deserializationError); - } - } - - return callback(null, result, httpRequest, response); - }); -} - -/** Class representing a BillingMeters. */ -class BillingMeters { - /** - * Create a BillingMeters. - * @param {WebSiteManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._list = _list; - this._listNext = _listNext; - } - - /** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.billingLocation] Azure Location of billable - * resource - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {object} [options] Optional Parameters. - * - * @param {string} [options.billingLocation] Azure Location of billable - * resource - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {BillingMeterCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link BillingMeterCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - list(options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._list(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._list(options, optionalCallback); - } - } - - /** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - listNextWithHttpOperationResponse(nextPageLink, options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._listNext(nextPageLink, options, (err, result, request, response) => { - let httpOperationResponse = new msRest.HttpOperationResponse(request, response); - httpOperationResponse.body = result; - if (err) { reject(err); } - else { resolve(httpOperationResponse); } - return; - }); - }); - } - - /** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {string} nextPageLink The NextLink from the previous successful call - * to List operation. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} If a callback was passed as the last parameter - * then it returns the callback else returns a Promise. - * - * {Promise} A promise is returned - * - * @resolve {BillingMeterCollection} - The deserialized result object. - * - * @reject {Error} - The error object. - * - * {function} optionalCallback(err, result, request, response) - * - * {Error} err - The Error object if an error occurred, null otherwise. - * - * {object} [result] - The deserialized result object if an error did not occur. - * See {@link BillingMeterCollection} for more - * information. - * - * {object} [request] - The HTTP Request object if an error did not occur. - * - * {stream} [response] - The HTTP Response stream if an error did not occur. - */ - listNext(nextPageLink, options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._listNext(nextPageLink, options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._listNext(nextPageLink, options, optionalCallback); - } - } - -} - -module.exports = BillingMeters; diff --git a/lib/services/websiteManagement2/lib/operations/global.js b/lib/services/websiteManagement2/lib/operations/global.js deleted file mode 100644 index 4491f2ad19..0000000000 --- a/lib/services/websiteManagement2/lib/operations/global.js +++ /dev/null @@ -1,257 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {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 _getBillingMeters(options, callback) { - /* jshint 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 = '2016-03-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.Web/billingMeters'; - 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 = { - required: false, - serializedName: 'parsedResponse', - type: { - name: 'Sequence', - element: { - required: false, - serializedName: 'BillingMeterElementType', - type: { - name: 'Composite', - className: 'BillingMeter' - } - } - } - }; - result = client.deserialize(resultMapper, parsedResponse, 'result'); - } - } catch (error) { - let deserializationError = new Error(`Error ${error} occurred 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 Global. */ -class Global { - /** - * Create a Global. - * @param {WebSiteManagementClient} client Reference to the service client. - */ - constructor(client) { - this.client = client; - this._getBillingMeters = _getBillingMeters; - } - - /** - * @summary Gets a list of meters for a given location. - * - * Gets a list of meters for a given location. - * - * @param {object} [options] Optional Parameters. - * - * @param {object} [options.customHeaders] Headers that will be added to the - * request - * - * @returns {Promise} A promise is returned - * - * @resolve {HttpOperationResponse} - The deserialized result object. - * - * @reject {Error} - The error object. - */ - getBillingMetersWithHttpOperationResponse(options) { - let client = this.client; - let self = this; - return new Promise((resolve, reject) => { - self._getBillingMeters(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 {object} [options.customHeaders] Headers that will be added to the - * request - * - * @param {function} [optionalCallback] - The optional callback. - * - * @returns {function|Promise} 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. - */ - getBillingMeters(options, optionalCallback) { - let client = this.client; - let self = this; - if (!optionalCallback && typeof options === 'function') { - optionalCallback = options; - options = null; - } - if (!optionalCallback) { - return new Promise((resolve, reject) => { - self._getBillingMeters(options, (err, result, request, response) => { - if (err) { reject(err); } - else { resolve(result); } - return; - }); - }); - } else { - return self._getBillingMeters(options, optionalCallback); - } - } - -} - -module.exports = Global; diff --git a/lib/services/websiteManagement2/lib/operations/resourceHealthMetadataOperations.js b/lib/services/websiteManagement2/lib/operations/resourceHealthMetadataOperations.js deleted file mode 100644 index 22c45328e6..0000000000 --- a/lib/services/websiteManagement2/lib/operations/resourceHealthMetadataOperations.js +++ /dev/null @@ -1,2470 +0,0 @@ -/* - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for - * license information. - * - * Code generated by Microsoft (R) AutoRest Code Generator. - * Changes may cause incorrect behavior and will be lost if the code is - * regenerated. - */ - -'use strict'; - -const msRest = require('ms-rest'); -const msRestAzure = require('ms-rest-azure'); -const WebResource = msRest.WebResource; - -/** - * @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.'); - } - let apiVersion = '2016-03-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.Web/resourceHealthMetadata'; - 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['DefaultErrorResponse']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - 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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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.'); - } - let apiVersion = '2016-03-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 (resourceGroupName !== null && resourceGroupName !== undefined) { - if (resourceGroupName.length > 90) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MaxLength": 90'); - } - if (resourceGroupName.length < 1) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "MinLength": 1'); - } - if (resourceGroupName.match(/^[-\w\._\(\)]+[^\.]$/) === null) - { - throw new Error('"resourceGroupName" should satisfy the constraint - "Pattern": /^[-\w\._\(\)]+[^\.]$/'); - } - } - if (name === 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.acceptLanguage !== null && this.client.acceptLanguage !== undefined && typeof this.client.acceptLanguage.valueOf() !== 'string') { - throw new Error('this.client.acceptLanguage must be of type string.'); - } - } catch (error) { - return callback(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(apiVersion)); - if (queryParameters.length > 0) { - requestUrl += '?' + queryParameters.join('&'); - } - - // Create HTTP transport objects - let httpRequest = new WebResource(); - httpRequest.method = 'GET'; - httpRequest.url = requestUrl; - httpRequest.headers = {}; - // Set Headers - httpRequest.headers['Content-Type'] = 'application/json; charset=utf-8'; - if (this.client.generateClientRequestId) { - httpRequest.headers['x-ms-client-request-id'] = msRestAzure.generateUuid(); - } - if (this.client.acceptLanguage !== undefined && this.client.acceptLanguage !== null) { - httpRequest.headers['accept-language'] = this.client.acceptLanguage; - } - if(options) { - for(let headerName in options['customHeaders']) { - if (options['customHeaders'].hasOwnProperty(headerName)) { - httpRequest.headers[headerName] = options['customHeaders'][headerName]; - } - } - } - httpRequest.body = null; - // Send Request - return client.pipeline(httpRequest, (err, response, responseBody) => { - if (err) { - return callback(err); - } - let statusCode = response.statusCode; - if (statusCode !== 200) { - let error = new Error(responseBody); - error.statusCode = response.statusCode; - error.request = msRest.stripRequest(httpRequest); - error.response = msRest.stripResponse(response); - if (responseBody === '') responseBody = null; - let parsedErrorResponse; - try { - parsedErrorResponse = JSON.parse(responseBody); - if (parsedErrorResponse) { - let internalError = null; - if (parsedErrorResponse.error) internalError = parsedErrorResponse.error; - error.code = internalError ? internalError.code : parsedErrorResponse.code; - error.message = internalError ? internalError.message : parsedErrorResponse.message; - } - if (parsedErrorResponse !== null && parsedErrorResponse !== undefined) { - let resultMapper = new client.models['DefaultErrorResponse']().mapper(); - error.body = client.deserialize(resultMapper, parsedErrorResponse, 'error.body'); - } - } catch (defaultError) { - error.message = `Error "${defaultError.message}" occurred in deserializing the responseBody ` + - `- "${responseBody}" for the default response.`; - return callback(error); - } - return callback(error); - } - // Create Result - let result = null; - if (responseBody === '') responseBody = null; - // Deserialize Response - if (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/package.json b/lib/services/websiteManagement2/package.json index 1334d7fee4..bbf762e2d5 100644 --- a/lib/services/websiteManagement2/package.json +++ b/lib/services/websiteManagement2/package.json @@ -14,7 +14,7 @@ "license": "MIT", "main": "./lib/webSiteManagementClient.js", "types": "./lib/webSiteManagementClient.d.ts", - "homepage": "https://github.com/azure/azure-sdk-for-node/lib/services/websiteManagement2", + "homepage": "https://github.com/azure/azure-sdk-for-node/lib/services/webSiteManagement2", "repository": { "type": "git", "url": "https://github.com/azure/azure-sdk-for-node.git"